Decompiled source of RobItems v1.3.3

RobItems.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using HarmonyLib;
using IL.RoR2;
using KinematicCharacterController;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI.MainMenu;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ContentManagement;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.UI.MainMenu;
using RobItems.Components;
using RobItems.Content;
using RobItems.Modules;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

[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("RobItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RobItems")]
[assembly: AssemblyTitle("RobItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace RobItems
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rob.RobItems", "RobItems", "1.3.3")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "DirectorAPI", "LoadoutAPI", "UnlockableAPI", "NetworkingAPI", "RecalculateStatsAPI" })]
	public class Plugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.RobItems";

		public List<ItemBase> Items = new List<ItemBase>();

		public static HashSet<ItemDef> BlacklistedFromPrinter = new HashSet<ItemDef>();

		public static ExpansionDef RobItemsExpansionDef = ScriptableObject.CreateInstance<ExpansionDef>();

		public static Dictionary<ItemBase, bool> ItemStatusDictionary = new Dictionary<ItemBase, bool>();

		public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		public static bool ancientWispInstalled => Chainloader.PluginInfos.ContainsKey("com.Moffein.AncientWisp");

		private void Awake()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			Config.myConfig = ((BaseUnityPlugin)this).Config;
			RobAssets.PopulateAssets();
			Config.Init();
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			foreach (Type item in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (ValidateItem(itemBase, Items))
				{
					itemBase.Init(((BaseUnityPlugin)this).Config);
				}
			}
			ShopTerminalBehavior.GenerateNewPickupServer_bool += new Manipulator(ItemBase.BlacklistFromPrinter);
			ContagiousItemManager.Init += new hook_Init(ItemBase.RegisterVoidPairings);
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			bool value = Config.ItemEnableConfig("Item: " + item.ItemInternalName).Value;
			bool value2 = Config.BindAndOptions("Item: " + item.ItemInternalName, "Blacklist Item from AI Use?", defaultValue: false, "Should the AI not be able to obtain this item?").Value;
			bool value3 = Config.BindAndOptions("Item: " + item.ItemInternalName, "Blacklist Item from Printers?", defaultValue: false, "Should the printers be able to print this item?").Value;
			ItemStatusDictionary.Add(item, value);
			if (value)
			{
				itemList.Add(item);
				if (value2)
				{
					item.AIBlacklisted = true;
				}
				if (value3)
				{
					item.PrinterBlacklisted = true;
				}
			}
			return value;
		}

		public void GenerateExpansionDef()
		{
			LanguageAPI.Add("ROBITEMS_EXPANSION_DEF_NAME", "RobItems");
			LanguageAPI.Add("ROBITEMS_EXPANSION_DEF_DESCRIPTION", "A whole world of weird items, equipment, elites, and interactables await you.");
			RobItemsExpansionDef.descriptionToken = "ROBITEMS_EXPANSION_DEF_DESCRIPTION";
			RobItemsExpansionDef.nameToken = "ROBITEMS_EXPANSION_DEF_NAME";
			RobItemsExpansionDef.iconSprite = null;
			RobItemsExpansionDef.disabledIconSprite = null;
			ContentAddition.AddExpansionDef(RobItemsExpansionDef);
		}
	}
}
namespace RobItems.Modules
{
	internal static class Buffs
	{
		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isHidden = false)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			val.isHidden = isHidden;
			ContentAddition.AddBuffDef(val);
			return val;
		}
	}
	internal static class Config
	{
		public static ConfigFile myConfig;

		public static ConfigEntry<bool> enableAncientWispCompat;

		public static void Init()
		{
			InitROO(RobAssets.mainAssetBundle.LoadAsset<Sprite>("texChipIcon"), "sup.");
			enableAncientWispCompat = BindAndOptions("01 - General", "Enable Ancient Wisp Compat", defaultValue: true, "If true, Legendary Spark will be boss tier and drop from Moffein's Ancient Wisp if that mod is installed. Otherwise it will be a standard red item.", restartRequired: true);
		}

		public static void InitROO(Sprite modSprite, string modDescription)
		{
			if (Plugin.rooInstalled)
			{
				_InitROO(modSprite, modDescription);
			}
		}

		public static void _InitROO(Sprite modSprite, string modDescription)
		{
			ModSettingsManager.SetModIcon(modSprite);
			ModSettingsManager.SetModDescription(modDescription);
		}

		public static ConfigEntry<T> BindAndOptions<T>(string section, string name, T defaultValue, string description = "", bool restartRequired = false)
		{
			if (string.IsNullOrEmpty(description))
			{
				description = name;
			}
			if (restartRequired)
			{
				description += " (restart required)";
			}
			ConfigEntry<T> val = myConfig.Bind<T>(section, name, defaultValue, description);
			if (Plugin.rooInstalled)
			{
				TryRegisterOption<T>(val, restartRequired);
			}
			return val;
		}

		public static ConfigEntry<float> BindAndOptionsSlider(string section, string name, float defaultValue, string description = "", float min = 0f, float max = 20f, bool restartRequired = false)
		{
			if (string.IsNullOrEmpty(description))
			{
				description = name;
			}
			description = description + " (Default: " + defaultValue + ")";
			if (restartRequired)
			{
				description += " (restart required)";
			}
			ConfigEntry<float> val = myConfig.Bind<float>(section, name, defaultValue, description);
			if (Plugin.rooInstalled)
			{
				TryRegisterOptionSlider(val, min, max, restartRequired);
			}
			return val;
		}

		public static ConfigEntry<int> BindAndOptionsSlider(string section, string name, int defaultValue, string description = "", int min = 0, int max = 20, bool restartRequired = false)
		{
			if (string.IsNullOrEmpty(description))
			{
				description = name;
			}
			description = description + " (Default: " + defaultValue + ")";
			if (restartRequired)
			{
				description += " (restart required)";
			}
			ConfigEntry<int> val = myConfig.Bind<int>(section, name, defaultValue, description);
			if (Plugin.rooInstalled)
			{
				TryRegisterOptionSlider(val, min, max, restartRequired);
			}
			return val;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void TryRegisterOption<T>(ConfigEntry<T> entry, bool restartRequired)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Expected O, but got Unknown
			if (entry is ConfigEntry<float>)
			{
				ModSettingsManager.AddOption((BaseOption)new SliderOption(entry as ConfigEntry<float>, new SliderConfig
				{
					min = 0f,
					max = 20f,
					formatString = "{0:0.00}",
					restartRequired = restartRequired
				}));
			}
			if (entry is ConfigEntry<int>)
			{
				ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry as ConfigEntry<int>, restartRequired));
			}
			if (entry is ConfigEntry<bool>)
			{
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry as ConfigEntry<bool>, restartRequired));
			}
			if (entry is ConfigEntry<KeyboardShortcut>)
			{
				ModSettingsManager.AddOption((BaseOption)new KeyBindOption(entry as ConfigEntry<KeyboardShortcut>, restartRequired));
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void TryRegisterOptionSlider(ConfigEntry<int> entry, int min, int max, bool restartRequired)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry, new IntSliderConfig
			{
				min = min,
				max = max,
				formatString = "{0:0.00}",
				restartRequired = restartRequired
			}));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void TryRegisterOptionSlider(ConfigEntry<float> entry, float min, float max, bool restartRequired)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new SliderOption(entry, new SliderConfig
			{
				min = min,
				max = max,
				formatString = "{0:0.00}",
				restartRequired = restartRequired
			}));
		}

		internal static ConfigEntry<bool> ItemEnableConfig(string itemName)
		{
			return BindAndOptions(itemName, "Enabled", defaultValue: true, "Set to false to disable this item and all its functionality", restartRequired: true);
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "com.rob.RobItems";

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	internal static class RobAssets
	{
		internal static AssetBundle mainAssetBundle;

		internal static Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/HGStandard");

		internal static Material commandoMat;

		internal static void PopulateAssets()
		{
			if ((Object)(object)mainAssetBundle == (Object)null)
			{
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("RobItems.robitems");
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("RobItems.RobItemsBank.bnk");
			byte[] array = new byte[stream2.Length];
			stream2.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}

		internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			val.akId = AkSoundEngine.GetIDFromString(eventName);
			val.eventName = eventName;
			ContentAddition.AddNetworkSoundEventDef(val);
			return val;
		}

		internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert)
		{
			Renderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.material) && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<LineRenderer>()))
				{
					Texture val2 = null;
					if (val.material.HasProperty("_BumpMap"))
					{
						val2 = val.material.GetTexture("_BumpMap");
					}
					val.material.shader = hotpoo;
					if ((Object)(object)val2 != (Object)null)
					{
						val.material.SetTexture("_NormalTex", val2);
						val.material.SetFloat("_NormalStrength", 1f);
					}
				}
			}
		}

		internal static RendererInfo[] SetupRendererInfos(GameObject obj)
		{
			//IL_001a: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length];
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				array[i] = new RendererInfo
				{
					defaultMaterial = ((Renderer)componentsInChildren[i]).material,
					renderer = (Renderer)(object)componentsInChildren[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		public static GameObject LoadSurvivorModel(string modelName)
		{
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(modelName);
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			return PrefabAPI.InstantiateClone(val, ((Object)val).name, false);
		}

		internal static Texture LoadCharacterIcon(string characterName)
		{
			return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon");
		}

		internal static GameObject LoadCrosshair(string crosshairName)
		{
			return Resources.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair");
		}

		private static GameObject LoadEffect(string resourceName)
		{
			return LoadEffect(resourceName, "", parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, string soundName)
		{
			return LoadEffect(resourceName, soundName, parentToTransform: false);
		}

		private static GameObject LoadEffect(string resourceName, bool parentToTransform)
		{
			return LoadEffect(resourceName, "", parentToTransform);
		}

		private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName);
			val.AddComponent<DestroyOnTimer>().duration = 12f;
			val.AddComponent<NetworkIdentity>();
			val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			EffectComponent val2 = val.AddComponent<EffectComponent>();
			val2.applyScale = false;
			val2.effectIndex = (EffectIndex)(-1);
			val2.parentToReferencedTransform = parentToTransform;
			val2.positionAtReferencedTransform = true;
			val2.soundName = soundName;
			AddNewEffectDef(val, soundName);
			return val;
		}

		internal static void AddNewEffectDef(GameObject effectPrefab)
		{
			AddNewEffectDef(effectPrefab, "");
		}

		internal static void AddNewEffectDef(GameObject effectPrefab, string soundName)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			EffectDef val = new EffectDef();
			val.prefab = effectPrefab;
			val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>();
			val.prefabName = ((Object)effectPrefab).name;
			val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>();
			val.spawnSoundEventName = soundName;
			ContentAddition.AddEffect(effectPrefab);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)commandoMat))
			{
				commandoMat = Resources.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial;
			}
			Material val = Object.Instantiate<Material>(commandoMat);
			Material val2 = mainAssetBundle.LoadAsset<Material>(materialName);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return commandoMat;
			}
			((Object)val).name = materialName;
			val.SetColor("_Color", val2.GetColor("_Color"));
			val.SetTexture("_MainTex", val2.GetTexture("_MainTex"));
			val.SetColor("_EmColor", emissionColor);
			val.SetFloat("_EmPower", emission);
			val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap"));
			val.SetFloat("_NormalStrength", normalStrength);
			return val;
		}

		public static Material CreateMaterial(string materialName)
		{
			return CreateMaterial(materialName, 0f);
		}

		public static Material CreateMaterial(string materialName, float emission)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, Color.black);
		}

		public static Material CreateMaterial(string materialName, float emission, Color emissionColor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return CreateMaterial(materialName, emission, emissionColor, 0f);
		}
	}
	internal class Utils
	{
		public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false)
		{
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			RobAssets.ConvertAllRenderersToHopooShader(obj);
			List<Renderer> list = new List<Renderer>();
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			if (componentsInChildren.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
			}
			SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
			if (componentsInChildren2.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
			}
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
			for (int i = 0; i < list.Count; i++)
			{
				if (debugmode)
				{
					MaterialControllerComponents.HGControllerFinder hGControllerFinder = ((Component)list[i]).gameObject.AddComponent<MaterialControllerComponents.HGControllerFinder>();
					hGControllerFinder.Renderer = list[i];
				}
				array[i] = new RendererInfo
				{
					defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
					renderer = list[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails)
		{
			string[] value = new string[19]
			{
				"<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>",
				"<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>",
				"",
				"<indent=1%><style=cIsDamage><size=125%><u>  Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>",
				"",
				"<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>",
				"<indent=4%><style=cStack>Tracking Number:  " + trackingNumber + "</style></indent>",
				"",
				"<indent=2%>-Order Description: " + devicePickupDesc + "</indent>",
				"",
				"<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>",
				"",
				"",
				"",
				"<indent=2%>-Order Details: " + orderDetails + "</indent>",
				"",
				"",
				"",
				"<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>"
			};
			return string.Join("\n", value);
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = duration;
				}
			}
		}

		public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration)
		{
			//IL_003b: 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)
			if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
			{
				return;
			}
			int num = 0;
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (buffDef.buffIndex == timedBuff.buffIndex)
				{
					timedBuff.timer = taperStart + (float)num * taperDuration;
					num++;
				}
			}
		}
	}
}
namespace RobItems.Content
{
	public class AwesomePie : ItemBase<AwesomePie>
	{
		public static GameObject ItemBodyModelPrefab;

		public static GameObject pieProjectile;

		public static GameObject pieProjectileImpactEffect;

		public override string ItemName => "Freshly-Baked Pie";

		public override string ItemInternalName => "AwesomePie";

		public override string ItemLangTokenName => "PIE";

		public override string ItemPickupDesc => "Chance to throw fresh pies.";

		public override string ItemFullDescription => "<style=cIsDamage>10%</style> chance to throw a pie that deals <style=cIsDamage>400%</style> <style=cStack>(+400% per stack)</style> TOTAL damage.";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)1;

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

		public override string CorruptsItem => "";

		public override GameObject ItemModel => RobAssets.mainAssetBundle.LoadAsset<GameObject>("mdlPie");

		public override Sprite ItemIcon => RobAssets.mainAssetBundle.LoadAsset<Sprite>("texPieIcon");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			CreateProjectile();
			Hooks();
		}

		private void CreateProjectile()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: 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_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			pieProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion(), "RobPieProjectile", true);
			pieProjectile.AddComponent<RocketRotation>();
			pieProjectile.AddComponent<DelayedGravity>();
			ProjectileController component = pieProjectile.GetComponent<ProjectileController>();
			ProjectileDamage component2 = pieProjectile.GetComponent<ProjectileDamage>();
			ProjectileSimple component3 = pieProjectile.GetComponent<ProjectileSimple>();
			ProjectileImpactExplosion component4 = pieProjectile.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component4).blastRadius = 5f;
			pieProjectileImpactEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Treebot/OmniExplosionVFXTreebotSeedPodMortar.prefab").WaitForCompletion(), "RobPieImpact", true);
			if (!Object.op_Implicit((Object)(object)pieProjectileImpactEffect.GetComponent<NetworkIdentity>()))
			{
				pieProjectileImpactEffect.AddComponent<NetworkIdentity>();
			}
			pieProjectileImpactEffect.GetComponent<EffectComponent>().soundName = "sfx_rob_pie_impact";
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Loader/matOmniHitspark1Loader.mat").WaitForCompletion());
			val.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampParent.png").WaitForCompletion());
			((Renderer)((Component)pieProjectileImpactEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).material = val;
			((Renderer)((Component)pieProjectileImpactEffect.transform.GetChild(1)).GetComponent<ParticleSystemRenderer>()).material = val;
			((Renderer)((Component)pieProjectileImpactEffect.transform.GetChild(5)).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matOmniRing2.mat").WaitForCompletion();
			((Component)pieProjectileImpactEffect.transform.GetChild(7)).gameObject.SetActive(false);
			((Component)pieProjectileImpactEffect.transform.GetChild(9)).gameObject.SetActive(false);
			((Component)pieProjectileImpactEffect.transform.GetChild(12)).gameObject.SetActive(false);
			pieProjectileImpactEffect.GetComponentInChildren<Light>().color = new Color(1f, 41f / 51f, 0f, 1f);
			val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matOpaqueDustLight.mat").WaitForCompletion());
			val.SetColor("_TintColor", new Color(0.7647059f, 0f, 1f, 1f));
			val.SetColor("_EmissionColor", new Color(0.5019608f, 0.09019608f, 28f / 51f, 1f));
			((Renderer)((Component)pieProjectileImpactEffect.transform.GetChild(2)).GetComponent<ParticleSystemRenderer>()).material = val;
			pieProjectileImpactEffect.transform.GetChild(2).localScale = Vector3.one * 1.5f;
			Object.Destroy((Object)(object)pieProjectileImpactEffect.GetComponent<OmniEffect>());
			((Component)pieProjectileImpactEffect.transform.GetChild(0)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(1)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(2)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(3)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(4)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(5)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(8)).gameObject.SetActive(false);
			((Component)pieProjectileImpactEffect.transform.GetChild(10)).gameObject.SetActive(true);
			((Component)pieProjectileImpactEffect.transform.GetChild(11)).gameObject.SetActive(true);
			GameObject val2 = PrefabAPI.InstantiateClone(RobAssets.mainAssetBundle.LoadAsset<GameObject>("PieGhost"), "RobPieGhost", false);
			val2.AddComponent<ProjectileGhostController>();
			val2.AddComponent<EnableOneRandomChild>();
			RobAssets.ConvertAllRenderersToHopooShader(val2);
			component.ghostPrefab = val2;
			ContentAddition.AddEffect(pieProjectileImpactEffect);
			component4.lifetimeExpiredSound = RobAssets.CreateNetworkSoundEventDef("sfx_rob_pie_throw");
			component4.offsetForLifetimeExpiredSound = 0.1f;
			component4.destroyOnEnemy = false;
			component4.destroyOnWorld = false;
			component4.timerAfterImpact = true;
			((ProjectileExplosion)component4).falloffModel = (FalloffModel)1;
			component4.lifetime = 12f;
			component4.lifetimeAfterImpact = 0f;
			component4.lifetimeRandomOffset = 0f;
			((ProjectileExplosion)component4).blastDamageCoefficient = 1f;
			((ProjectileExplosion)component4).blastProcCoefficient = 0f;
			((ProjectileExplosion)component4).fireChildren = false;
			((ProjectileExplosion)component4).childrenCount = 0;
			((ProjectileExplosion)component4).childrenProjectilePrefab = null;
			((ProjectileExplosion)component4).childrenDamageCoefficient = 0f;
			component4.impactEffect = pieProjectileImpactEffect;
			component.startSound = "";
			component.procCoefficient = 0f;
			component2.crit = false;
			component2.damage = 0f;
			component2.damageColorIndex = (DamageColorIndex)0;
			component2.force = 0f;
			ContentAddition.AddProjectile(pieProjectile);
		}

		private void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: 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_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: 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_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04be: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Unknown result type (might be due to invalid IL or missing references)
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_0646: Unknown result type (might be due to invalid IL or missing references)
			//IL_065c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_0677: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0714: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_0730: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_0767: Unknown result type (might be due to invalid IL or missing references)
			//IL_076c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0782: Unknown result type (might be due to invalid IL or missing references)
			//IL_0787: Unknown result type (might be due to invalid IL or missing references)
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0815: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_088d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0892: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_093b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0940: Unknown result type (might be due to invalid IL or missing references)
			//IL_0956: Unknown result type (might be due to invalid IL or missing references)
			//IL_095b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0960: Unknown result type (might be due to invalid IL or missing references)
			//IL_0961: Unknown result type (might be due to invalid IL or missing references)
			//IL_097c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ade: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
			ItemBodyModelPrefab = RobAssets.mainAssetBundle.LoadAsset<GameObject>("DisplayPie");
			ItemDisplay val = ItemBodyModelPrefab.AddComponent<ItemDisplay>();
			val.rendererInfos = Utils.ItemDisplaySetup(ItemBodyModelPrefab);
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Head",
					localPos = new Vector3(0f, 0.37828f, -1E-05f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(0.07975f, 0.07975f, 0.07975f)
				}
			});
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "ThighR",
					localPos = new Vector3(-0.10419f, 0.14945f, 0.07268f),
					localAngles = new Vector3(4.05035f, 30.11378f, 100.932f),
					localScale = new Vector3(0.05912f, 0.05912f, 0.05912f)
				}
			});
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Hip",
					localPos = new Vector3(-0.59383f, 0.38539f, 1.48411f),
					localAngles = new Vector3(354.2642f, 351.2072f, 147.1327f),
					localScale = new Vector3(0.63697f, 0.63697f, 0.63697f)
				}
			});
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "CannonHeadR",
					localPos = new Vector3(0f, 0.01861f, 0.0931f),
					localAngles = new Vector3(74.52697f, 180f, 180f),
					localScale = new Vector3(0.09299f, 0.09299f, 0.09299f)
				}
			});
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-0.08007f, 0.29128f, -0.03731f),
					localAngles = new Vector3(17.90203f, 335.5591f, 25.53785f),
					localScale = new Vector3(0.04496f, 0.04496f, 0.04496f)
				}
			});
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "ClavicleR",
					localPos = new Vector3(0.07168f, 0.10448f, -0.10009f),
					localAngles = new Vector3(279.2579f, 1E-05f, 332.1362f),
					localScale = new Vector3(0.07689f, 0.07689f, 0.07689f)
				}
			});
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "FlowerBase",
					localPos = new Vector3(-0.52454f, 0.5604f, 0f),
					localAngles = new Vector3(0f, 0f, 348.033f),
					localScale = new Vector3(0.26775f, 0.26775f, 0.26775f)
				}
			});
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "MechHandR",
					localPos = new Vector3(0f, 0.08609f, 0.02985f),
					localAngles = new Vector3(0.16855f, 0f, 0f),
					localScale = new Vector3(0.20373f, 0.29487f, 0.20373f)
				}
			});
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "UpperArmR",
					localPos = new Vector3(0.80725f, 2.26472f, 0.31656f),
					localAngles = new Vector3(10.6713f, 329.1888f, 287.2493f),
					localScale = new Vector3(1.01134f, 1.01134f, 1.01134f)
				}
			});
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "ThighL",
					localPos = new Vector3(0.08273f, 0.33643f, 0.02572f),
					localAngles = new Vector3(332.3598f, 337.3707f, 282.9324f),
					localScale = new Vector3(0.11047f, 0.11047f, 0.11047f)
				}
			});
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Pelvis",
					localPos = new Vector3(0.08643f, -0.00976f, -0.17556f),
					localAngles = new Vector3(312.4219f, 177.7703f, 175.3371f),
					localScale = new Vector3(0.04879f, 0.04879f, 0.04879f)
				}
			});
			val2.Add("RobDriverBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Pelvis",
					localPos = new Vector3(0.18012f, 0.05259f, -0.03364f),
					localAngles = new Vector3(359.1773f, 191.7485f, 106.2844f),
					localScale = new Vector3(0.04879f, 0.04879f, 0.04879f)
				}
			});
			val2.Add("RobRavagerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Sword",
					localPos = new Vector3(1E-05f, -0.15967f, -0.04171f),
					localAngles = new Vector3(282.4446f, 336.3754f, 21.10846f),
					localScale = new Vector3(0.04879f, 0.04879f, 0.04879f)
				}
			});
			val2.Add("RobHunkBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(14.87735f, 10.22004f, -7.63679f),
					localAngles = new Vector3(4.76658f, 53.92681f, 282.4793f),
					localScale = new Vector3(7.21967f, 7.21967f, 7.21967f)
				}
			});
			val2.Add("RobBelmontBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Pelvis",
					localPos = new Vector3(0.23021f, -0.07659f, -0.0993f),
					localAngles = new Vector3(359.1773f, 191.7485f, 124.6783f),
					localScale = new Vector3(0.06185f, 0.06185f, 0.06185f)
				}
			});
			val2.Add("Executioner2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Gun",
					localPos = new Vector3(0.06176f, 0.27819f, 0f),
					localAngles = new Vector3(0f, 0f, 49.03857f),
					localScale = new Vector3(0.06952f, 0.06952f, 0.06952f)
				}
			});
			val2.Add("NemCommandoBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(0f, 1.81438f, -1.01009f),
					localAngles = new Vector3(332.5974f, 0f, 0f),
					localScale = new Vector3(0.41388f, 0.41388f, 0.41388f)
				}
			});
			val2.Add("ChirrBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(0.10636f, 0.6198f, 0.36443f),
					localAngles = new Vector3(3.05622f, 142.962f, 70.08968f),
					localScale = new Vector3(0.25959f, 0.25959f, 0.25959f)
				}
			});
			val2.Add("NemMercBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Pelvis",
					localPos = new Vector3(-0.18609f, 0.06135f, -0.06585f),
					localAngles = new Vector3(15.82456f, 180f, 209.9806f),
					localScale = new Vector3(0.05858f, 0.05858f, 0.05858f)
				}
			});
			return val2;
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo);
			if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory) && Object.op_Implicit((Object)(object)component.master))
			{
				int itemCount = component.inventory.GetItemCount(ItemBase<AwesomePie>.instance.ItemDef);
				if (itemCount > 0 && damageInfo.damage > 0f && Util.CheckRoll(10f * damageInfo.procCoefficient, component.master))
				{
					ProjectileManager obj = ProjectileManager.instance;
					FireProjectileInfo val = new FireProjectileInfo
					{
						crit = Util.CheckRoll(component.crit, 0f, (CharacterMaster)null),
						damage = damageInfo.damage * 4f * (float)itemCount,
						damageColorIndex = (DamageColorIndex)0,
						force = 20f,
						owner = ((Component)component).gameObject,
						position = component.aimOrigin,
						procChainMask = default(ProcChainMask),
						projectilePrefab = pieProjectile,
						rotation = Util.QuaternionSafeLookRotation(component.inputBank.aimDirection)
					};
					((FireProjectileInfo)(ref val)).speedOverride = 60f;
					val._speedOverride = 60f;
					val.useFuseOverride = false;
					val.useSpeedOverride = true;
					obj.FireProjectileServer(val, (NetworkConnection)null, (ushort)0, 0.0);
				}
			}
		}
	}
	public class Bident : ItemBase<Bident>
	{
		public static GameObject ItemBodyModelPrefab;

		public static GameObject bidentProjectile;

		public static GameObject bidentProjectileImpactEffect;

		public static GameObject bidentReturnEffect;

		public static BuffDef bidentReadyBuff;

		public static GameObject orbEffect;

		public override string ItemName => "Accursed Bident";

		public override string ItemInternalName => "Bident";

		public override string ItemLangTokenName => "BIDENT";

		public override string ItemPickupDesc => "Activating your Utility skill throws a Bident that strikes with savage hellfire and then returns to you. <style=cIsVoid>Corrupts all Tridents of Retribution.</style>";

		public override string ItemFullDescription => "Activating your <style=cIsUtility>Utility</style> skill throws a Bident that deals <style=cIsDamage>1200%</style> <style=cStack>(+1000% per stack)</style> base damage. Can't be thrown again until it returns to you. <style=cIsVoid>Corrupts all Tridents of Retribution.</style>";

		public override string ItemLore => "";

		public override ItemTier Tier => (ItemTier)8;

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

		public override string CorruptsItem => "TRIDENT";

		public override GameObject ItemModel => RobAssets.mainAssetBundle.LoadAsset<GameObject>("mdlBident");

		public override Sprite ItemIcon => RobAssets.mainAssetBundle.LoadAsset<Sprite>("texBidentIcon");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateBuffs();
			CreateItem();
			CreateProjectile();
			CreateVisuals();
			Hooks();
		}

		private void CreateVisuals()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_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_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_0158: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			orbEffect = PrefabAPI.InstantiateClone(Resources.Load<GameObject>("Prefabs/Effects/OrbEffects/InfusionOrbEffect"), "RobBidentOrbEffect", true);
			if (!Object.op_Implicit((Object)(object)orbEffect.GetComponent<NetworkIdentity>()))
			{
				orbEffect.AddComponent<NetworkIdentity>();
			}
			TrailRenderer component = ((Component)orbEffect.transform.Find("TrailParent").Find("Trail")).GetComponent<TrailRenderer>();
			component.widthMultiplier = 0.35f;
			((Renderer)component).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matMagmaWormFireballTrail.mat").WaitForCompletion();
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Loader/matOmniRing2Loader.mat").WaitForCompletion());
			val.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampHelfire.png").WaitForCompletion());
			val.SetColor("_TintColor", Color.white);
			Material val2 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Grandparent/matGrandParentSunGlow.mat").WaitForCompletion());
			val2.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampHuntressSoft2.png").WaitForCompletion());
			val2.SetColor("_TintColor", Color.white);
			((Renderer)((Component)orbEffect.transform.Find("VFX").Find("Core")).GetComponent<ParticleSystemRenderer>()).material = val;
			orbEffect.transform.Find("VFX").localScale = Vector3.one * 0.5f;
			orbEffect.transform.Find("VFX").Find("Core").localScale = Vector3.one * 3f;
			((Renderer)((Component)orbEffect.transform.Find("VFX").Find("PulseGlow")).GetComponent<ParticleSystemRenderer>()).material = val2;
			orbEffect.transform.Find("VFX").Find("PulseGlow").localScale = Vector3.one * 0.5f;
			orbEffect.GetComponent<OrbEffect>().endEffect = bidentReturnEffect;
			GameObject val3 = Object.Instantiate<GameObject>(ItemBodyModelPrefab);
			val3.transform.parent = orbEffect.transform;
			val3.transform.localPosition = new Vector3(0f, 0f, -1.5f);
			val3.transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
			val3.transform.localScale = Vector3.one * 4f;
			RobAssets.AddNewEffectDef(orbEffect);
		}

		private void CreateBuffs()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			bidentReadyBuff = Buffs.AddNewBuff("buffRobBidentReady", null, Color.red, canStack: false, isDebuff: false, isHidden: true);
		}

		private void CreateProjectile()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_010e: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			bidentProjectileImpactEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lightning/LightningStrikeImpact.prefab").WaitForCompletion(), "RobBidentImpact");
			((Component)bidentProjectileImpactEffect.transform.Find("PostProcess")).GetComponent<PostProcessVolume>().sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppLocalMagmaWorm.asset").WaitForCompletion();
			((Component)bidentProjectileImpactEffect.transform.Find("LightningRibbon")).GetComponent<ParticleSystemRenderer>().trailMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matMagmaWormFireballTrail.mat").WaitForCompletion();
			((Component)bidentProjectileImpactEffect.transform.Find("LightningRibbon")).transform.localScale = new Vector3(2f, 0.3f, 2f);
			((Component)bidentProjectileImpactEffect.transform.Find("Flash Lines")).gameObject.SetActive(false);
			((Component)bidentProjectileImpactEffect.transform.Find("Ring")).gameObject.SetActive(false);
			Transform obj = bidentProjectileImpactEffect.transform.Find("Flash");
			obj.localScale *= 0.25f;
			((Component)bidentProjectileImpactEffect.transform.Find("Point light")).GetComponent<Light>().color = Color.red;
			((Renderer)((Component)bidentProjectileImpactEffect.transform.Find("Sphere")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSuvivorEnterCorruptionSphere2.mat").WaitForCompletion();
			bidentProjectileImpactEffect.GetComponent<ShakeEmitter>().wave.amplitude *= 0.1f;
			bidentProjectileImpactEffect.GetComponent<EffectComponent>().soundName = "sfx_rob_trident_impact";
			bidentProjectileImpactEffect.AddComponent<PlaySoundOnAwake>().soundString = "Play_env_meridian_lunarStorm_bolt_strike";
			RobAssets.AddNewEffectDef(bidentProjectileImpactEffect, "sfx_rob_trident_impact");
			bidentReturnEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercExposeConsumeEffect.prefab").WaitForCompletion(), "RobBidentReturnEffect");
			Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercExposed.mat").WaitForCompletion());
			val.SetColor("_TintColor", Color.red);
			val.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampGolem.png").WaitForCompletion());
			((Renderer)((Component)bidentReturnEffect.transform.Find("Visual, Consumed/PulseEffect, Ring (1)")).gameObject.GetComponent<ParticleSystemRenderer>()).material = val;
			((Component)bidentReturnEffect.transform.Find("Visual, Consumed/PulseEffect, Backdrop")).gameObject.SetActive(false);
			((Component)bidentReturnEffect.transform.Find("Visual, Consumed/PulseEffect, Slash")).gameObject.SetActive(false);
			RobAssets.AddNewEffectDef(bidentReturnEffect);
			bidentProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion(), "RobBidentProjectile", true);
			bidentProjectile.AddComponent<RocketRotation>();
			bidentProjectile.AddComponent<DelayedGravity>();
			bidentProjectile.AddComponent<BidentReturn>();
			ProjectileController component = bidentProjectile.GetComponent<ProjectileController>();
			ProjectileDamage component2 = bidentProjectile.GetComponent<ProjectileDamage>();
			ProjectileSimple component3 = bidentProjectile.GetComponent<ProjectileSimple>();
			ProjectileImpactExplosion component4 = bidentProjectile.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component4).blastRadius = 12f;
			GameObject val2 = PrefabAPI.InstantiateClone(RobAssets.mainAssetBundle.LoadAsset<GameObject>("BidentGhost"), "RobBidentGhost", false);
			val2.AddComponent<ProjectileGhostController>();
			val2.AddComponent<PlaySoundOnAwake>().soundString = "sfx_rob_trident_throw";
			RobAssets.ConvertAllRenderersToHopooShader(val2);
			component.ghostPrefab = val2;
			Material material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matMagmaWormFireballTrail.mat").WaitForCompletion();
			TrailRenderer[] componentsInChildren = val2.GetComponentsInChildren<TrailRenderer>();
			foreach (TrailRenderer val3 in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val3))
				{
					((Renderer)val3).material = material;
				}
			}
			component4.lifetimeExpiredSound = null;
			component4.offsetForLifetimeExpiredSound = 0.1f;
			component4.destroyOnEnemy = false;
			component4.destroyOnWorld = false;
			component4.timerAfterImpact = true;
			((ProjectileExplosion)component4).falloffModel = (FalloffModel)1;
			component4.lifetime = 50f;
			component4.lifetimeAfterImpact = 0f;
			component4.lifetimeRandomOffset = 0f;
			((ProjectileExplosion)component4).blastDamageCoefficient = 1f;
			((ProjectileExplosion)component4).blastProcCoefficient = 0f;
			((ProjectileExplosion)component4).fireChildren = false;
			((ProjectileExplosion)component4).childrenCount = 0;
			((ProjectileExplosion)component4).childrenProjectilePrefab = null;
			((ProjectileExplosion)component4).childrenDamageCoefficient = 0f;
			component4.impactEffect = bidentProjectileImpactEffect;
			component.startSound = "";
			component.procCoefficient = 0f;
			component2.crit = false;
			component2.damage = 0f;
			component2.damageColorIndex = (DamageColorIndex)0;
			component2.damageType = DamageTypeCombo.op_Implicit((DamageType)16777216);
			component2.force = 0f;
			ContentAddition.AddProjectile(bidentProjectile);
		}

		private void CreateConfig(ConfigFile config)
		{
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05be: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_064c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Unknown result type (might be due to invalid IL or missing references)
			//IL_0772: Unknown result type (might be due to invalid IL or missing references)
			//IL_0777: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0792: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0805: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0820: Unknown result type (might be due to invalid IL or missing references)
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0898: Unknown result type (might be due to invalid IL or missing references)
			//IL_089d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
			ItemBodyModelPrefab = RobAssets.mainAssetBundle.LoadAsset<GameObject>("DisplayBident");
			ItemDisplay val = ItemBodyModelPrefab.AddComponent<ItemDisplay>();
			val.rendererInfos = Utils.ItemDisplaySetup(ItemBodyModelPrefab);
			ItemBodyModelPrefab.AddComponent<BidentDisplayController>();
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-0.07764f, 0.04554f, -0.25754f),
					localAngles = new Vector3(296.1814f, 63.53795f, 26.32158f),
					localScale = new Vector3(1.93137f, 1.93137f, 1.93137f)
				}
			});
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-0.05894f, -0.06162f, -0.14143f),
					localAngles = new Vector3(305.5684f, 79.40447f, 352.06f),
					localScale = new Vector3(1.55077f, 1.55077f, 1.55077f)
				}
			});
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "LowerArmL",
					localPos = new Vector3(1.11347f, 1.00909f, -0.46193f),
					localAngles = new Vector3(276.5597f, 104.4454f, 103.9028f),
					localScale = new Vector3(17.30232f, 17.30232f, 17.30232f)
				}
			});
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-0.24042f, 0.09188f, -0.25698f),
					localAngles = new Vector3(289.4335f, 85.38448f, 184.2397f),
					localScale = new Vector3(2.20071f, 2.20071f, 2.20071f)
				}
			});
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-0.01937f, -0.27309f, -0.25668f),
					localAngles = new Vector3(274.7674f, 59.73555f, 225.6058f),
					localScale = new Vector3(2f, 2f, 2f)
				}
			});
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "HandL",
					localPos = new Vector3(-0.09395f, 0.1258f, -0.036f),
					localAngles = new Vector3(0f, 249.0321f, 0f),
					localScale = new Vector3(2.48407f, 2.48407f, 2.48407f)
				}
			});
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "FlowerBase",
					localPos = new Vector3(-0.91623f, 2.79036f, 0.33554f),
					localAngles = new Vector3(78.47236f, 120.75f, 281.6509f),
					localScale = new Vector3(4.87154f, 4.87154f, 4.87154f)
				}
			});
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "MechHandL",
					localPos = new Vector3(-0.03364f, -0.31763f, 0.12477f),
					localAngles = new Vector3(274.6371f, 0f, 74.36546f),
					localScale = new Vector3(2.01601f, 2.01601f, 2.01601f)
				}
			});
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "LowerArmL",
					localPos = new Vector3(-0.81186f, 1.22193f, 0.09156f),
					localAngles = new Vector3(278.9285f, 61.67479f, 298.6179f),
					localScale = new Vector3(21.55685f, 21.55685f, 21.55685f)
				}
			});
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "LowerArmL",
					localPos = new Vector3(0.01283f, 0.54638f, -0.00288f),
					localAngles = new Vector3(277.5837f, 282.9926f, 180f),
					localScale = new Vector3(2.56903f, 2.56903f, 1.74518f)
				}
			});
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "MuzzleShotgun",
					localPos = new Vector3(-0.03394f, -0.00863f, 2E-05f),
					localAngles = new Vector3(0f, 0f, 0f),
					localScale = new Vector3(2.64932f, 2.64932f, 1.52403f)
				}
			});
			val2.Add("RobDriverBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(0.01114f, 0.01706f, -0.20639f),
					localAngles = new Vector3(299.148f, 86.86702f, 182.3423f),
					localScale = new Vector3(2.68796f, 2.68796f, 2.68796f)
				}
			});
			val2.Add("RobRavagerBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Sword",
					localPos = new Vector3(0.06126f, 0.36585f, 3E-05f),
					localAngles = new Vector3(270f, 0f, 0f),
					localScale = new Vector3(2.94562f, 2.94562f, 2.94562f)
				}
			});
			val2.Add("RobHunkBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(-9.1478f, 2.32206f, -13.87299f),
					localAngles = new Vector3(285.5569f, 82.02939f, 209.9158f),
					localScale = new Vector3(217.0586f, 217.0586f, 217.0586f)
				}
			});
			val2.Add("RobBelmontBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = ItemBodyModelPrefab,
					childName = "Chest",
					localPos = new Vector3(0.01114f, 0.01706f, -0.20639f),
					localAngles = new Vector3(299.148f, 86.86702f, 182.3423f),
					localScale = new Vector3(2.68796f, 2.68796f, 2.68796f)
				}
			});
			return val2;
		}

		public override void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged);
		}

		private static void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && NetworkServer.active)
			{
				self.AddItemBehavior<BidentBehavior>(self.inventory.GetItemCount(ItemBase<Bident>.instance.ItemDef));
			}
		}
	}
	public class BidentBehavior : ItemBehavior
	{
		private const float damageCoefficientBase = 12f;

		private const float damageCoefficientPerStack = 12f;

		private SkillLocator skillLocator;

		private InputBankTest inputBank;

		private void Awake()
		{
			((Behaviour)this).enabled = false;
		}

		private void OnEnable()
		{
			if (Object.op_Implicit((Object)(object)base.body))
			{
				base.body.onSkillActivatedServer += OnSkillActivated;
				skillLocator = ((Component)base.body).GetComponent<SkillLocator>();
				inputBank = ((Component)base.body).GetComponent<InputBankTest>();
				if (!base.body.HasBuff(Bident.bidentReadyBuff))
				{
					base.body.AddBuff(Bident.bidentReadyBuff);
				}
			}
		}

		private void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)base.body))
			{
				base.body.onSkillActivatedServer -= OnSkillActivated;
				while (base.body.HasBuff(Bident.bidentReadyBuff))
				{
					base.body.RemoveBuff(Bident.bidentReadyBuff);
				}
			}
			inputBank = null;
			skillLocator = null;
		}

		private void OnSkillActivated(GenericSkill skill)
		{
			SkillLocator val = skillLocator;
			if ((Object)(object)(((Object)(object)val != (Object)null) ? val.utility : null) == (Object)(object)skill && base.body.GetBuffCount(Bident.bidentReadyBuff) > 0)
			{
				base.body.RemoveBuff(Bident.bidentReadyBuff);
				Fire();
			}
		}

		private void Fire()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = GetAimRay();
			ProjectileManager.instance.FireProjectile(Bident.bidentProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((Component)this).gameObject, base.body.damage * (12f + 12f * (float)base.stack), 0f, Util.CheckRoll(base.body.crit, base.body.master), (DamageColorIndex)3, (GameObject)null, -1f, (DamageTypeCombo?)null);
		}

		private Ray GetAimRay()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)inputBank))
			{
				return new Ray(inputBank.aimOrigin, inputBank.aimDirection);
			}
			return new Ray(((Component)this).transform.position, ((Component)this).transform.forward);
		}
	}
	public class BidentReturn : MonoBehaviour
	{
		private ProjectileController projectileController;

		private void Awake()
		{
			projectileController = ((Component)this).GetComponent<ProjectileController>();
		}

		private void OnDisable()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && Object.op_Implicit((Object)(object)projectileController) && Object.op_Implicit((Object)(object)projectileController.owner))
			{
				CharacterBody component = projectileController.owner.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && component.healthComponent.alive)
				{
					BidentOrb bidentOrb = new BidentOrb();
					((Orb)bidentOrb).origin = ((Component)this).transform.position;
					((Orb)bidentOrb).target = Util.FindBodyMainHurtBox(component);
					OrbManager.instance.AddOrb((Orb)(object)bidentOrb);
				}
			}
		}
	}
	public class BidentOrb : Orb
	{
		public override void Begin()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			((Orb)this).duration = ((Orb)this).distanceToTarget / 30f;
			EffectData val = new EffectData
			{
				origin = base.origin,
				genericFloat = ((Orb)this).duration
			};
			val.SetHurtBoxReference(base.target);
			EffectManager.SpawnEffect(Bident.orbEffect, val, true);
		}

		public override void OnArrival()
		{
			if (Object.op_Implicit((Object)(object)base.target) && Object.op_Implicit((Object)(object)base.target.healthComponent) && Object.op_Implicit((Object)(object)base.target.healthComponent.body))
			{
				base.target.healthComponent.body.AddBuff(Bident.bidentReadyBuff);
			}
		}
	}
	public class ChorusFruit : ItemBase<ChorusFruit>
	{
		public static GameObject ItemBodyModelPrefab;

		public static GameObject warpEffect;

		public override string ItemName => "Chorus Fruit";

		public override string ItemInternalName => "ChorusFruit";

		public override string ItemLangTokenName => "CHORUS_FRUIT";

		public override string ItemPickupDesc => "Occasionally heal and warp to a random point nearby. <style=cIsVoid>Corrupts all Perfect Apples.</style>";

		public override string ItemFullDescription => "Every <style=cIsDamage>20</style> seconds, <style=cIsHealing>heal</style> for <style=cIsHealing>20</style> plus an additional <style=cIsHealing>5% <style=cStack>(+5% per stack)</style></style> of <style=cIsHealing>maximum health</style> and <color=#FF7F7F>teleport to a random point nearby</color>. <style=cIsVoid>Corrupts all Perfect Apples.</style>";

		public override string ItemLore => "...while at a glance, these fruits may resemble a common apple, it’s important to know the differences: looking for their deep, purple coloration, checking for the presence of barnacles (or other organisms) growing on or around the plant or its fruit, and listening for a faint humming or hissing after picking the fruit may very well be the difference between enjoying a plant or becoming a plant as you’re warped into the ground. Alternatively, cooking on a strong flame until the fruit pops will negate anomalous properties.\n\n- Interstellar Flora and Fauna Guide, Third Edition";

		public override ItemTier Tier => (ItemTier)7;

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 };

		public override string CorruptsItem => "PERFECT_APPLE";

		public override GameObject ItemModel => RobAssets.mainAssetBundle.LoadAsset<GameObject>("mdlChorusFruit");

		public override Sprite ItemIcon => RobAssets.mainAssetBundle.LoadAsset<Sprite>("texChorusFruitIcon");

		public override void Init(ConfigFile config)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			CreateConfig(config);
			CreateLang();
			CreateIte