Decompiled source of WolfoQualityOfLife v5.1.0

WolfoQoL_Client.dll

Decompiled a day 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 BepInEx.Logging;
using EntityStates;
using EntityStates.Bell.BellWeapon;
using EntityStates.Croco;
using EntityStates.DroneCombiner;
using EntityStates.DroneScrapper;
using EntityStates.FalseSonBoss;
using EntityStates.Interactables.GoldBeacon;
using EntityStates.Interactables.MSObelisk;
using EntityStates.Loader;
using EntityStates.MealPrep;
using EntityStates.Merc;
using EntityStates.Merc.Weapon;
using EntityStates.MeridianEvent;
using EntityStates.Missions.AccessCodes.Node;
using EntityStates.Missions.Arena.NullWard;
using EntityStates.Missions.BrotherEncounter;
using EntityStates.Missions.GeodeSecretMission;
using EntityStates.Missions.Moon;
using EntityStates.QuestVolatileBattery;
using EntityStates.Scrapper;
using EntityStates.ShrineHalcyonite;
using EntityStates.SolusWing2;
using EntityStates.Toolbot;
using EntityStates.VoidRaidCrab;
using EntityStates.VoidSurvivor.Weapon;
using HG;
using IL.EntityStates.Bell.BellWeapon;
using IL.EntityStates.Merc;
using IL.EntityStates.Merc.Weapon;
using IL.RoR2;
using IL.RoR2.UI;
using IL.RoR2.UI.LogBook;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using On.EntityStates.Croco;
using On.EntityStates.DroneCombiner;
using On.EntityStates.DroneScrapper;
using On.EntityStates.FalseSonBoss;
using On.EntityStates.Interactables.GoldBeacon;
using On.EntityStates.Interactables.MSObelisk;
using On.EntityStates.Loader;
using On.EntityStates.MealPrep;
using On.EntityStates.Merc;
using On.EntityStates.Merc.Weapon;
using On.EntityStates.Missions.AccessCodes.Node;
using On.EntityStates.Missions.Arena.NullWard;
using On.EntityStates.Missions.BrotherEncounter;
using On.EntityStates.Missions.GeodeSecretMission;
using On.EntityStates.Missions.Moon;
using On.EntityStates.QuestVolatileBattery;
using On.EntityStates.Scrapper;
using On.EntityStates.ShrineHalcyonite;
using On.EntityStates.SolusWing2;
using On.EntityStates.Toolbot;
using On.EntityStates.VoidRaidCrab;
using On.EntityStates.VoidSurvivor.Weapon;
using On.RoR2;
using On.RoR2.CharacterAI;
using On.RoR2.Stats;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using On.RoR2.UI.MainMenu;
using On.RoR2.WwiseUtils;
using ProperSave;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Artifacts;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.EntitlementManagement;
using RoR2.ExpansionManagement;
using RoR2.Hologram;
using RoR2.Items;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using RoR2.UI;
using RoR2.UI.LogBook;
using RoR2.UI.MainMenu;
using RoR2.WwiseUtils;
using TMPro;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;
using WolfoFixes;
using WolfoLibrary;
using WolfoQoL_Client.DeathScreen;
using WolfoQoL_Client.Menu;
using WolfoQoL_Client.ProperSaveSupport;
using WolfoQoL_Client.Reminders;
using WolfoQoL_Client.Skins;
using WolfoQoL_Client.Text;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WolfoQoL_Client")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+014d2870e58c0057ec84a2386147b37a60cf16c2")]
[assembly: AssemblyProduct("WolfoQoL_Client")]
[assembly: AssemblyTitle("WolfoQoL_Client")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace WolfoQoL_Client
{
	public static class Assets
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_SetFolders <0>__SetFolders;
		}

		public static AssetBundle Bundle;

		public static PluginInfo PluginInfo;

		public static string Folder = "QualityOfLife\\";

		internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location);

		public static Sprite Load(string s)
		{
			return Bundle.LoadAsset<Sprite>("Assets/WQoL/PingIcons/" + s + ".png");
		}

		internal static void Init(PluginInfo info)
		{
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			PluginInfo = info;
			if (!Directory.Exists(GetPathToFile(Folder)))
			{
				Folder = "plugins\\" + Folder;
			}
			if (Directory.Exists(GetPathToFile(Folder + "AssetBundles")))
			{
				Bundle = AssetBundle.LoadFromFile(GetPathToFile(Folder + "AssetBundles", "wolfoqualityoflife"));
			}
			else
			{
				Debug.LogError((object)"COULD NOT FIND ASSETBUNDLES FOLDER");
			}
			if (WConfig.cfgTestDisableMod.Value)
			{
				return;
			}
			if (Directory.Exists(GetPathToFile(Folder + "Languages")))
			{
				object obj = <>O.<0>__SetFolders;
				if (obj == null)
				{
					hook_SetFolders val = SetFolders;
					<>O.<0>__SetFolders = val;
					obj = (object)val;
				}
				Language.SetFolders += (hook_SetFolders)obj;
			}
			else
			{
				Debug.LogError((object)"COULD NOT FIND LANGUAGES FOLDER");
			}
		}

		private static void SetFolders(orig_SetFolders orig, Language self, IEnumerable<string> newFolders)
		{
			IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(GetPathToFile(Folder + "Languages")), self.name);
			orig.Invoke(self, newFolders.Union(second));
		}

		internal static string GetPathToFile(string folderName)
		{
			return Path.Combine(assemblyDir, folderName);
		}

		internal static string GetPathToFile(string folderName, string fileName)
		{
			return Path.Combine(assemblyDir, folderName, fileName);
		}
	}
	public class ClientChecks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Start <0>__AddClientListeners;

			public static hook_SetBodyPrefabToPreference <1>__PlayerCharacterMasterController_SetBodyPrefabToPreference;

			public static hook_OnDeserialize <2>__ClientCheck_Multishop;

			public static hook_OnEnter <3>__ScrapperBaseState_OnEnter;

			public static hook_OnEnter <4>__ScrappingDroneMessage_Client;

			public static Manipulator <5>__ClientCheck_Purchase;

			public static Manipulator <6>__Inventory_OnDeserialize;

			public static hook_OnDisable <7>__EquipmentDrone_ForceMessage;
		}

		public static void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//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_007f: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			object obj = <>O.<0>__AddClientListeners;
			if (obj == null)
			{
				hook_Start val = AddClientListeners;
				<>O.<0>__AddClientListeners = val;
				obj = (object)val;
			}
			PlayerCharacterMasterController.Start += (hook_Start)obj;
			object obj2 = <>O.<1>__PlayerCharacterMasterController_SetBodyPrefabToPreference;
			if (obj2 == null)
			{
				hook_SetBodyPrefabToPreference val2 = PlayerCharacterMasterController_SetBodyPrefabToPreference;
				<>O.<1>__PlayerCharacterMasterController_SetBodyPrefabToPreference = val2;
				obj2 = (object)val2;
			}
			PlayerCharacterMasterController.SetBodyPrefabToPreference += (hook_SetBodyPrefabToPreference)obj2;
			object obj3 = <>O.<2>__ClientCheck_Multishop;
			if (obj3 == null)
			{
				hook_OnDeserialize val3 = ClientCheck_Multishop;
				<>O.<2>__ClientCheck_Multishop = val3;
				obj3 = (object)val3;
			}
			MultiShopController.OnDeserialize += (hook_OnDeserialize)obj3;
			object obj4 = <>O.<3>__ScrapperBaseState_OnEnter;
			if (obj4 == null)
			{
				hook_OnEnter val4 = ScrapperBaseState_OnEnter;
				<>O.<3>__ScrapperBaseState_OnEnter = val4;
				obj4 = (object)val4;
			}
			ScrapperBaseState.OnEnter += (hook_OnEnter)obj4;
			object obj5 = <>O.<4>__ScrappingDroneMessage_Client;
			if (obj5 == null)
			{
				hook_OnEnter val5 = ScrappingDroneMessage_Client;
				<>O.<4>__ScrappingDroneMessage_Client = val5;
				obj5 = (object)val5;
			}
			DroneScrapperBaseState.OnEnter += (hook_OnEnter)obj5;
			object obj6 = <>O.<5>__ClientCheck_Purchase;
			if (obj6 == null)
			{
				Manipulator val6 = ClientCheck_Purchase;
				<>O.<5>__ClientCheck_Purchase = val6;
				obj6 = (object)val6;
			}
			PurchaseInteraction.OnDeserialize += (Manipulator)obj6;
			object obj7 = <>O.<6>__Inventory_OnDeserialize;
			if (obj7 == null)
			{
				Manipulator val7 = Inventory_OnDeserialize;
				<>O.<6>__Inventory_OnDeserialize = val7;
				obj7 = (object)val7;
			}
			Inventory.OnDeserialize += (Manipulator)obj7;
			object obj8 = <>O.<7>__EquipmentDrone_ForceMessage;
			if (obj8 == null)
			{
				hook_OnDisable val8 = EquipmentDrone_ForceMessage;
				<>O.<7>__EquipmentDrone_ForceMessage = val8;
				obj8 = (object)val8;
			}
			SummonMasterBehavior.OnDisable += (hook_OnDisable)obj8;
		}

		private static void ScrappingDroneMessage_Client(orig_OnEnter orig, DroneScrapperBaseState self)
		{
			orig.Invoke(self);
			if (!NetworkServer.active && self is DroneScrapping)
			{
				DroneLoss_ClientListener.SendMessage();
			}
		}

		private static void PlayerCharacterMasterController_SetBodyPrefabToPreference(orig_SetBodyPrefabToPreference orig, PlayerCharacterMasterController self)
		{
			orig.Invoke(self);
			ItemLossBase_ClientListener itemLossBase_ClientListener = default(ItemLossBase_ClientListener);
			if (((Component)self).TryGetComponent<ItemLossBase_ClientListener>(ref itemLossBase_ClientListener))
			{
				itemLossBase_ClientListener.subjectAsNetworkUser = self.networkUser;
			}
		}

		private static void EquipmentDrone_ForceMessage(orig_OnDisable orig, SummonMasterBehavior self)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Invalid comparison between Unknown and I4
			orig.Invoke(self);
			if (self.callOnEquipmentSpentOnPurchase)
			{
				PurchaseInteraction component = ((Component)self).GetComponent<PurchaseInteraction>();
				if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 7)
				{
					PlayerItemLoss_ClientListener.forceEquip = true;
					PlayerItemLoss_ClientListener.token = "ITEM_LOSS_GENERIC";
					ItemLossBase_ClientListener.TryMessage();
				}
			}
		}

		private static void ClientCheck_Purchase(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.PurchaseInteraction", "available")
			});
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.PurchaseInteraction", "available")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<bool, PurchaseInteraction, bool>>((Func<bool, PurchaseInteraction, bool>)delegate(bool t, PurchaseInteraction pur)
				{
					if (!t)
					{
						CheckInteractable_ClientOnly(pur, isMulti: false);
					}
					return t;
				});
			}
			else
			{
				WQoLMain.log.LogWarning((object)"IL Failed : PurchaseInteraction_OnDeserialize");
			}
		}

		private static void Inventory_OnDeserialize(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdflda(x, "RoR2.Inventory", "permanentItemStacks")
			}))
			{
				val.EmitDelegate<Func<Inventory, Inventory>>((Func<Inventory, Inventory>)delegate(Inventory inventory)
				{
					//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)
					PlayerItemLoss_ClientListener playerItemLoss_ClientListener2 = default(PlayerItemLoss_ClientListener);
					if (((Component)inventory).TryGetComponent<PlayerItemLoss_ClientListener>(ref playerItemLoss_ClientListener2))
					{
						inventory.WriteAllPermanentItemStacks((Span<int>)playerItemLoss_ClientListener2.prevItems);
						playerItemLoss_ClientListener2.prevEquip = inventory.currentEquipmentIndex;
					}
					return inventory;
				});
			}
			else
			{
				WQoLMain.log.LogWarning((object)"IL Failed : Inventory_OnDeserialize 1");
			}
			val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.Inventory", "equipmentDisabled")
			});
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
			}))
			{
				val.EmitDelegate<Func<Inventory, Inventory>>((Func<Inventory, Inventory>)delegate(Inventory inventory)
				{
					//IL_0010: 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)
					PlayerItemLoss_ClientListener playerItemLoss_ClientListener = default(PlayerItemLoss_ClientListener);
					if (((Component)inventory).TryGetComponent<PlayerItemLoss_ClientListener>(ref playerItemLoss_ClientListener))
					{
						playerItemLoss_ClientListener.prevEquip = inventory.currentEquipmentIndex;
					}
					return inventory;
				});
			}
			else
			{
				WQoLMain.log.LogWarning((object)"IL Failed : Inventory_OnDeserialize 2");
			}
		}

		private static void ScrapperBaseState_OnEnter(orig_OnEnter orig, ScrapperBaseState self)
		{
			orig.Invoke(self);
			if (!NetworkServer.active && self is WaitToBeginScrapping)
			{
				PlayerItemLoss_ClientListener.source = ItemLossMessage.Source.Scrapper;
				ItemLossBase_ClientListener.TryMessage();
			}
		}

		public static void AddClientListeners(orig_Start orig, PlayerCharacterMasterController self)
		{
			orig.Invoke(self);
			((Component)self).gameObject.AddComponent<DroneCollection>();
			if (!WQoLMain.HostHasMod)
			{
				((Component)self).gameObject.AddComponent<KillerInfo_ClientListener>();
				((Component)self).gameObject.AddComponent<PlayerItemLoss_ClientListener>();
			}
		}

		private static void ClientCheck_Multishop(orig_OnDeserialize orig, MultiShopController self, NetworkReader reader, bool initialState)
		{
			bool available = self.available;
			orig.Invoke(self, reader, initialState);
			if (available && !self.available && ((Object)self).name.StartsWith("FreeChestMultiShop"))
			{
				CheckInteractable_ClientOnly(null, isMulti: true);
			}
		}

		public static void CheckInteractable_ClientOnly(PurchaseInteraction purchase, bool isMulti)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected I4, but got Unknown
			if (isMulti)
			{
				if (Object.op_Implicit((Object)(object)TreasureReminder.instance.Objective_FreeChest))
				{
					TreasureReminder.instance.DeductFreeChestCount();
				}
				return;
			}
			if (purchase.saleStarCompatible)
			{
				PlayerItemLoss_ClientListener.TrySaleStar(purchase);
			}
			CostTypeIndex costType = purchase.costType;
			CostTypeIndex val = costType;
			switch ((int)val)
			{
			case 4:
			case 5:
			case 6:
			case 10:
				if (((Object)((Component)purchase).gameObject).name.StartsWith("LunarCauldron"))
				{
					PlayerItemLoss_ClientListener.source = ItemLossMessage.Source.LunarCauldron;
					PlayerItemLoss_ClientListener.token = "ITEM_LOSS_CAULDRON";
				}
				else
				{
					PlayerItemLoss_ClientListener.token = "ITEM_LOSS_GENERIC";
				}
				ItemLossBase_ClientListener.TryMessage();
				break;
			case 7:
				PlayerItemLoss_ClientListener.checkEquip = true;
				PlayerItemLoss_ClientListener.token = "ITEM_LOSS_GENERIC";
				ItemLossBase_ClientListener.TryMessage();
				break;
			case 9:
				PlayerItemLoss_ClientListener.checkEquip = true;
				PlayerItemLoss_ClientListener.source = ItemLossMessage.Source.CleansingPool;
				PlayerItemLoss_ClientListener.token = "ITEM_LOSS_CLEANSING";
				ItemLossBase_ClientListener.TryMessage();
				break;
			case 12:
				if (Object.op_Implicit((Object)(object)TreasureReminder.instance))
				{
					TreasureReminder.instance.DeductLockboxCount();
				}
				break;
			case 13:
				if (Object.op_Implicit((Object)(object)TreasureReminder.instance))
				{
					TreasureReminder.instance.DeductLockboxVoidCount();
				}
				break;
			case 0:
				break;
			case 1:
			case 2:
			case 3:
			case 8:
			case 11:
				break;
			}
		}
	}
	public class KillerInfo_ClientListener : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <Delay_DeathMessage>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public KillerInfo_ClientListener <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Delay_DeathMessage>d__8(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.3f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this.SendMessage();
					<>4__this.latestDmg = null;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public GameObject playerBodyObject;

		public CharacterBody charBody;

		public CharacterMaster playerMaster;

		public UnityAction deathEvent;

		public bool killed = false;

		private DamageDealtMessage latestDmg;

		public void OnEnable()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			if (WQoLMain.HostHasMod)
			{
				WQoLMain.log.LogMessage((object)"Host has mod, removing Client Workaround : KillerInfo_ClientListener");
				Object.Destroy((Object)(object)this);
				return;
			}
			PlayerCharacterMasterController component = ((Component)this).GetComponent<PlayerCharacterMasterController>();
			if (!((Object)(object)component == (Object)null))
			{
				GlobalEventManager.onClientDamageNotified += onClientDamageNotified;
				playerMaster = component.master;
				playerMaster.onBodyStart += Master_onBodyStart;
				if (deathEvent == null)
				{
					deathEvent = new UnityAction(OnBodyDeath);
					playerMaster.onBodyDeath.AddListener(deathEvent);
				}
			}
		}

		public void OnDisable()
		{
			if (deathEvent != null)
			{
				playerMaster.onBodyDeath.RemoveListener(deathEvent);
			}
			playerMaster.onBodyStart -= Master_onBodyStart;
			GlobalEventManager.onClientDamageNotified -= onClientDamageNotified;
		}

		public void SendMessage()
		{
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			if (latestDmg == null)
			{
				return;
			}
			if (charBody.healthComponent.alive)
			{
				WQoLMain.log.LogMessage((object)("KillerInfo_ClientListener | Sending message but is Alive?" + (object)charBody));
			}
			if (killed)
			{
				WQoLMain.log.LogMessage((object)("KillerInfo_ClientListener | Already sent message, how are they dying again?" + (object)charBody));
				return;
			}
			killed = true;
			string bestBodyName = Util.GetBestBodyName(latestDmg.attacker);
			CharacterMaster attackerMaster = null;
			CharacterBody val = null;
			if (Object.op_Implicit((Object)(object)latestDmg.attacker))
			{
				val = latestDmg.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)val))
				{
					attackerMaster = val.master;
				}
			}
			DeathMessage.DeathAndKillerInventoryMessage(latestDmg.damage, charBody, val, attackerMaster, latestDmg.damageType, latestDmg.damageColorIndex, latestDmg.delayedHit, sendOverNetwork: false);
		}

		[IteratorStateMachine(typeof(<Delay_DeathMessage>d__8))]
		public IEnumerator Delay_DeathMessage()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Delay_DeathMessage>d__8(0)
			{
				<>4__this = this
			};
		}

		private void Master_onBodyStart(CharacterBody obj)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			killed = false;
			playerBodyObject = ((Component)obj).gameObject;
			charBody = obj;
			if (obj.isRemoteOp)
			{
				DroneChatMessage obj2 = new DroneChatMessage
				{
					baseToken = "REMOTEOP_DRONE",
					_DroneIndex = DroneCatalog.GetDroneIndexFromBodyIndex(obj.bodyIndex)
				};
				((SubjectChatMessage)obj2).subjectAsNetworkUser = playerMaster.playerCharacterMasterController.networkUser;
				Chat.AddMessage((ChatMessageBase)(object)obj2);
			}
		}

		private void OnBodyDeath()
		{
			((MonoBehaviour)this).StartCoroutine(Delay_DeathMessage());
			if (WConfig.cfgTestClient.Value)
			{
				SendMessage();
				killed = false;
			}
		}

		private void onClientDamageNotified(DamageDealtMessage dmg)
		{
			if ((Object)(object)dmg.victim == (Object)(object)playerBodyObject)
			{
				latestDmg = dmg;
			}
		}
	}
	public class ItemLossBase_ClientListener : MonoBehaviour
	{
		public static ItemLossBase_ClientListener latest;

		public Inventory inventory;

		public NetworkUser subjectAsNetworkUser;

		public int[] prevItems = ItemCatalog.RequestItemStackArray();

		public EquipmentIndex prevEquip = (EquipmentIndex)(-1);

		public virtual void OnEnable()
		{
			if (WQoLMain.HostHasMod)
			{
				WQoLMain.log.LogMessage((object)"Host has mod, removing Client Workaround : ItemLoss_ClientListener");
				Object.Destroy((Object)(object)this);
			}
			else
			{
				inventory = ((Component)this).GetComponent<Inventory>();
				inventory.onInventoryChanged += Inventory_onInventoryChanged;
			}
		}

		public virtual void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)inventory))
			{
				inventory.onInventoryChanged -= Inventory_onInventoryChanged;
			}
		}

		public virtual void Inventory_onInventoryChanged()
		{
			latest = this;
		}

		public static void TryMessage()
		{
			if ((Object)(object)latest != (Object)null)
			{
				latest.TryMessageInstance();
			}
		}

		public virtual void TryMessageInstance()
		{
		}
	}
	public class DevotionItemLoss_ClientListener : ItemLossBase_ClientListener
	{
		public override void OnEnable()
		{
			base.OnEnable();
			CharacterMaster summonerMaster = ((Component)this).GetComponent<DevotionInventoryController>().SummonerMaster;
			if ((Object)(object)summonerMaster == (Object)null)
			{
				WQoLMain.log.LogWarning((object)"DevotionItemLoss Client Listener null Summoner Master");
			}
			subjectAsNetworkUser = summonerMaster.playerCharacterMasterController.networkUser;
		}

		public override void Inventory_onInventoryChanged()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			base.Inventory_onInventoryChanged();
			SingleItemLoss(inventory.permanentItemStacks);
		}

		public bool SingleItemLoss(ItemCollection now)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			int num = -1;
			int pickupQuantity = -1;
			for (int i = 0; i < prevItems.Length; i++)
			{
				if (prevItems[i] > ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i))
				{
					flag = true;
					num = i;
					pickupQuantity = prevItems[i] - ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i);
					break;
				}
			}
			if (flag)
			{
				PickupIndex val = PickupCatalog.FindPickupIndex((ItemIndex)num);
				PickupDef pickupDef = ((PickupIndex)(ref val)).pickupDef;
				WQoLMain.log.LogMessage((object)pickupDef.internalName);
				DevotionDeathMessage devotionDeathMessage = new DevotionDeathMessage();
				((SubjectChatMessage)devotionDeathMessage).subjectAsNetworkUser = subjectAsNetworkUser;
				((SubjectChatMessage)devotionDeathMessage).baseToken = "DEVOTED_LEMURIAN_DEATH";
				((PlayerPickupChatMessage)devotionDeathMessage).pickupToken = pickupDef.nameToken;
				((PlayerPickupChatMessage)devotionDeathMessage).pickupColor = Color32.op_Implicit(pickupDef.baseColor);
				((PlayerPickupChatMessage)devotionDeathMessage).pickupQuantity = (uint)pickupQuantity;
				Chat.AddMessage((ChatMessageBase)(object)devotionDeathMessage);
			}
			inventory.WriteAllPermanentItemStacks((Span<int>)prevItems);
			return flag;
		}
	}
	public class DroneLoss_ClientListener : MonoBehaviour
	{
		public static NetworkUser lastDroneOwner;

		public static GameObject lastDeadDrone;

		public static int tier;

		public void OnDisable()
		{
			lastDroneOwner = ((Component)this).GetComponent<MinionOwnership>().ownerMaster.playerCharacterMasterController.networkUser;
			lastDeadDrone = ((Component)this).GetComponent<CharacterMaster>().bodyPrefab;
			tier = ((Component)this).GetComponent<Inventory>().GetItemCountPermanent(Items.DroneUpgradeHidden);
		}

		public static void SendMessage()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)lastDroneOwner == (Object)null) && !((Object)(object)lastDeadDrone == (Object)null))
			{
				ItemLossMessage obj = new ItemLossMessage
				{
					source = ItemLossMessage.Source.DroneScrapper,
					baseToken = "ITEM_LOSS_SCRAP",
					itemCount = tier,
					pickupIndexOnlyOneItem = PickupCatalog.FindPickupIndex(DroneCatalog.GetDroneIndexFromBodyIndex(lastDeadDrone.GetComponent<CharacterBody>().bodyIndex))
				};
				((SubjectChatMessage)obj).subjectAsNetworkUser = lastDroneOwner;
				Chat.AddMessage((ChatMessageBase)(object)obj);
			}
		}
	}
	public class PlayerItemLoss_ClientListener : ItemLossBase_ClientListener
	{
		public static bool forceEquip = false;

		public static bool checkEquip = false;

		public static bool checkSaleStar = false;

		public static string token = "ITEM_LOSS_GENERIC";

		public static ItemLossMessage.Source source;

		public void Start()
		{
			subjectAsNetworkUser = ((Component)this).GetComponent<PlayerCharacterMasterController>().networkUser;
		}

		public override void Inventory_onInventoryChanged()
		{
			base.Inventory_onInventoryChanged();
			if (forceEquip)
			{
				ItemLossBase_ClientListener.TryMessage();
			}
		}

		public static void TrySaleStar(PurchaseInteraction purchase)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected I4, but got Unknown
			if (WConfig.cfgMessagesSaleStar.Value && (Object)(object)ItemLossBase_ClientListener.latest != (Object)null)
			{
				int num = (int)Items.LowerPricedChests.itemIndex;
				int num2 = ItemLossBase_ClientListener.latest.prevItems[num];
				int itemCountEffective = ItemLossBase_ClientListener.latest.inventory.GetItemCountEffective((ItemIndex)num);
				WQoLMain.log.LogMessage((object)("SaleStar " + num2 + " " + itemCountEffective));
				if (num2 > 0 && itemCountEffective == 0)
				{
					ItemLossBase_ClientListener.latest.prevItems[num] = 0;
					InteractableMessage obj = new InteractableMessage
					{
						interactableToken = purchase.displayNameToken
					};
					((SubjectChatMessage)obj).subjectAsNetworkUser = ItemLossBase_ClientListener.latest.subjectAsNetworkUser;
					Chat.AddMessage((ChatMessageBase)(object)obj);
				}
			}
		}

		public override void TryMessageInstance()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Invalid comparison between Unknown and I4
			//IL_004b: 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)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			base.TryMessageInstance();
			bool flag = false;
			if (source == ItemLossMessage.Source.Scrapper)
			{
				flag = ItemScrapMessage(inventory.permanentItemStacks);
			}
			else if (!forceEquip)
			{
				flag = ((!checkEquip || (int)inventory.currentEquipmentIndex != -1) ? ItemMessage(inventory.permanentItemStacks) : EquipmentMessage());
			}
			else
			{
				if ((int)prevEquip == -1)
				{
					prevEquip = inventory.currentEquipmentIndex;
				}
				flag = EquipmentMessage();
			}
			if (!flag)
			{
			}
			forceEquip = false;
			checkEquip = false;
			source = ItemLossMessage.Source.Default;
		}

		public bool ItemScrapMessage(ItemCollection now)
		{
			//IL_00a4: 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)
			if (!WConfig.cfgMessageScrap.Value)
			{
				return false;
			}
			bool flag = false;
			int num = -1;
			int itemCount = -1;
			for (int i = 0; i < prevItems.Length; i++)
			{
				if (prevItems[i] > ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i))
				{
					flag = true;
					num = i;
					itemCount = prevItems[i] - ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i);
					break;
				}
			}
			if (flag)
			{
				ItemLossMessage obj = new ItemLossMessage
				{
					source = ItemLossMessage.Source.Scrapper,
					baseToken = "ITEM_LOSS_SCRAP"
				};
				((SubjectChatMessage)obj).subjectAsNetworkUser = subjectAsNetworkUser;
				obj.pickupIndexOnlyOneItem = PickupCatalog.FindPickupIndex((ItemIndex)num);
				obj.itemCount = itemCount;
				Chat.AddMessage((ChatMessageBase)(object)obj);
			}
			inventory.WriteAllPermanentItemStacks((Span<int>)prevItems);
			return flag;
		}

		public bool ItemMessage(ItemCollection now)
		{
			//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)
			int[] array = ItemCatalog.RequestItemStackArray();
			int num = 0;
			int num2 = -1;
			for (int i = 0; i < prevItems.Length; i++)
			{
				if (prevItems[i] > ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i))
				{
					num++;
					num2 = i;
					array[i] = prevItems[i] - ((ItemCollection)(ref now)).GetStackValue((ItemIndex)i);
				}
			}
			if (num == 1)
			{
				if (token != "ITEM_LOSS_CAULDRON")
				{
					ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)num2);
					if (itemDef.ContainsTag((ItemTag)10))
					{
						token = "ITEM_LOSS_USED";
					}
				}
				ItemLossMessage obj = new ItemLossMessage
				{
					source = source,
					baseToken = token
				};
				((SubjectChatMessage)obj).subjectAsNetworkUser = subjectAsNetworkUser;
				obj.pickupIndexOnlyOneItem = PickupCatalog.FindPickupIndex((ItemIndex)num2);
				Chat.AddMessage((ChatMessageBase)(object)obj);
			}
			else if (num > 0)
			{
				ItemLossMessage obj2 = new ItemLossMessage
				{
					baseToken = token
				};
				((SubjectChatMessage)obj2).subjectAsNetworkUser = subjectAsNetworkUser;
				obj2.itemStacks = array;
				Chat.AddMessage((ChatMessageBase)(object)obj2);
			}
			inventory.WriteAllPermanentItemStacks((Span<int>)prevItems);
			return num > 0;
		}

		public bool EquipmentMessage()
		{
			//IL_0009: 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_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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)
			//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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			bool result = false;
			EquipmentIndex currentEquipmentIndex = inventory.currentEquipmentIndex;
			if ((int)currentEquipmentIndex == -1)
			{
				currentEquipmentIndex = prevEquip;
			}
			if ((int)currentEquipmentIndex != -1)
			{
				result = true;
				ItemLossMessage obj = new ItemLossMessage
				{
					baseToken = token,
					pickupIndexOnlyOneItem = PickupCatalog.FindPickupIndex(currentEquipmentIndex)
				};
				((SubjectChatMessage)obj).subjectAsNetworkUser = subjectAsNetworkUser;
				Chat.AddMessage((ChatMessageBase)(object)obj);
			}
			else
			{
				WQoLMain.log.LogWarning((object)"EquipmentMessage but without Equipment?");
			}
			prevEquip = inventory.currentEquipmentIndex;
			return result;
		}
	}
	public struct AllyDef
	{
		public ItemTier tier;

		public float desiredSortPosition;

		public ColorIndex colorOverride;

		public Texture bgTextureOverride;

		public ExpansionDef requiredExpansion;
	}
	public class AllyCatalog
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_DroneBody <0>__PageBuilder_DroneBody;
		}

		public static Dictionary<BodyIndex, AllyDef> AllyDefs;

		public static void Make()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00d4: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: 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_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: 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_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Expected O, but got Unknown
			Debug.Log((object)"AllyCatalog");
			DroneDefs.BackupDrone.colorOverride = (ColorIndex)5;
			DroneDefs.DTGunnerDrone.colorOverride = (ColorIndex)12;
			DroneDefs.DTHealDrone.colorOverride = (ColorIndex)12;
			DroneDefs.DTHaulerDrone.colorOverride = (ColorIndex)12;
			if (AllyDefs != null)
			{
				return;
			}
			AllyDefs = new Dictionary<BodyIndex, AllyDef>();
			if (WConfig.cfgLogbook_AllyExpansion.Value)
			{
				if (Language.currentLanguage.TokenIsRegistered("LOGBOOK_CATEGORY_DRONE_AND_ALLIES"))
				{
					LanguageAPI.Add("LOGBOOK_CATEGORY_DRONE", Language.GetString("LOGBOOK_CATEGORY_DRONE_AND_ALLIES"));
				}
				AllyDefs.Add(BodyPrefabs.SquidTurretBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 200f,
					tier = (ItemTier)1
				});
				AllyDefs.Add(BodyPrefabs.FriendUnitBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 200f,
					tier = (ItemTier)2,
					requiredExpansion = DLCS.DLC3
				});
				AllyDefs.Add(BodyPrefabs.BeetleGuardAllyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 1f,
					tier = (ItemTier)4
				});
				AllyDefs.Add(BodyPrefabs.RoboBallRedBuddyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 2f,
					tier = (ItemTier)4
				});
				AllyDefs.Add(BodyPrefabs.RoboBallGreenBuddyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 2f,
					tier = (ItemTier)4
				});
				AllyDefs.Add(BodyPrefabs.MinorConstructOnKillBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 3f,
					tier = (ItemTier)4,
					requiredExpansion = DLCS.DLC1
				});
				AllyDefs.Add(BodyPrefabs.EngiTurretBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 30f,
					tier = (ItemTier)6,
					colorOverride = (ColorIndex)12,
					bgTextureOverride = LegacyResourcesAPI.Load<Texture>("Textures/ItemIcons/BG/texSurvivorBGIcon")
				});
				AllyDefs.Add(BodyPrefabs.EngiWalkerTurretBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 31f,
					tier = (ItemTier)6,
					colorOverride = (ColorIndex)12,
					bgTextureOverride = LegacyResourcesAPI.Load<Texture>("Textures/ItemIcons/BG/texSurvivorBGIcon")
				});
				AllyDefs.Add(BodyPrefabs.NullifierAllyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 3f,
					tier = (ItemTier)9,
					requiredExpansion = DLCS.DLC1
				});
				AllyDefs.Add(BodyPrefabs.VoidJailerAllyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 3f,
					tier = (ItemTier)9,
					requiredExpansion = DLCS.DLC1
				});
				AllyDefs.Add(BodyPrefabs.VoidMegaCrabAllyBody.bodyIndex, new AllyDef
				{
					desiredSortPosition = 3f,
					tier = (ItemTier)9,
					requiredExpansion = DLCS.DLC1
				});
				object obj = <>O.<0>__PageBuilder_DroneBody;
				if (obj == null)
				{
					hook_DroneBody val = PageBuilder_DroneBody;
					<>O.<0>__PageBuilder_DroneBody = val;
					obj = (object)val;
				}
				PageBuilder.DroneBody += (hook_DroneBody)obj;
			}
		}

		private static void PageBuilder_DroneBody(orig_DroneBody orig, PageBuilder builder)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			CharacterBody val = (CharacterBody)builder.entry.extraData;
			if ((int)DroneCatalog.GetDroneIndexFromBodyIndex(val.bodyIndex) == -1)
			{
				string text = ((Object)val).name.Replace("Body", "_SKILL_DESCRIPTION").ToUpper();
				if (Language.english.TokenIsRegistered(text))
				{
					builder.AddDescriptionPanel(Language.GetString(text));
				}
				builder.AddSimpleBody(val);
				builder.AddDronePanel(val);
				builder.AddBodyLore(val);
			}
			else
			{
				orig.Invoke(builder);
			}
		}

		public static bool CanSelectDroneEntry(AllyDef allyDef, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			ExpansionDef requiredExpansion = allyDef.requiredExpansion;
			return !Object.op_Implicit((Object)(object)requiredExpansion) || !expansionAvailability.ContainsKey(requiredExpansion) || expansionAvailability[requiredExpansion];
		}

		public static EntryStatus GetAllyStatus(in Entry entry, UserProfile viewerProfile)
		{
			//IL_0020: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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)
			if (viewerProfile == null)
			{
				return (EntryStatus)3;
			}
			if (viewerProfile.statSheet.GetStatValueULong(PerBodyStatDef.timesSummoned, ((Object)((Component)(CharacterBody)entry.extraData).gameObject).name) != 0)
			{
				return (EntryStatus)4;
			}
			return (EntryStatus)3;
		}

		public static ItemTier TierFromBodyDroneOrAlly(CharacterBody body)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_002d: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_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_004d: Unknown result type (might be due to invalid IL or missing references)
			DroneIndex droneIndexFromBodyIndex = DroneCatalog.GetDroneIndexFromBodyIndex(body.bodyIndex);
			if ((int)droneIndexFromBodyIndex != -1)
			{
				return DroneCatalog.GetDroneDef(droneIndexFromBodyIndex).tier;
			}
			if (AllyDefs.TryGetValue(body.bodyIndex, out var value))
			{
				return value.tier;
			}
			return (ItemTier)0;
		}

		public static float SortFromBodyDroneOrAlly(CharacterBody body)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_002d: 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)
			DroneIndex droneIndexFromBodyIndex = DroneCatalog.GetDroneIndexFromBodyIndex(body.bodyIndex);
			if ((int)droneIndexFromBodyIndex != -1)
			{
				return DroneCatalog.GetDroneDef(droneIndexFromBodyIndex).desiredSortPosition;
			}
			if (AllyDefs.TryGetValue(body.bodyIndex, out var value))
			{
				return value.desiredSortPosition;
			}
			return 0f;
		}
	}
	public class Logbook_MoreStats
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_AddBodyStatsPanel <0>__PageBuilder_AddBodyStatsPanel;

			public static hook_AddMonsterPanel <1>__ExtraMonsterStats;

			public static hook_AddSurvivorPanel <2>__PageBuilder_AddSurvivorPanel;

			public static hook_SurvivorBody <3>__PageBuilder_SurvivorBody;

			public static hook_AddStagePanel <4>__PageBuilder_AddStagePanel1;
		}

		public static void MoreStats()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			Logbook_AddRecipes.Add();
			object obj = <>O.<0>__PageBuilder_AddBodyStatsPanel;
			if (obj == null)
			{
				hook_AddBodyStatsPanel val = PageBuilder_AddBodyStatsPanel;
				<>O.<0>__PageBuilder_AddBodyStatsPanel = val;
				obj = (object)val;
			}
			PageBuilder.AddBodyStatsPanel += (hook_AddBodyStatsPanel)obj;
			object obj2 = <>O.<1>__ExtraMonsterStats;
			if (obj2 == null)
			{
				hook_AddMonsterPanel val2 = ExtraMonsterStats;
				<>O.<1>__ExtraMonsterStats = val2;
				obj2 = (object)val2;
			}
			PageBuilder.AddMonsterPanel += (hook_AddMonsterPanel)obj2;
			object obj3 = <>O.<2>__PageBuilder_AddSurvivorPanel;
			if (obj3 == null)
			{
				hook_AddSurvivorPanel val3 = PageBuilder_AddSurvivorPanel;
				<>O.<2>__PageBuilder_AddSurvivorPanel = val3;
				obj3 = (object)val3;
			}
			PageBuilder.AddSurvivorPanel += (hook_AddSurvivorPanel)obj3;
			object obj4 = <>O.<3>__PageBuilder_SurvivorBody;
			if (obj4 == null)
			{
				hook_SurvivorBody val4 = PageBuilder_SurvivorBody;
				<>O.<3>__PageBuilder_SurvivorBody = val4;
				obj4 = (object)val4;
			}
			PageBuilder.SurvivorBody += (hook_SurvivorBody)obj4;
			object obj5 = <>O.<4>__PageBuilder_AddStagePanel1;
			if (obj5 == null)
			{
				hook_AddStagePanel val5 = PageBuilder_AddStagePanel1;
				<>O.<4>__PageBuilder_AddStagePanel1 = val5;
				obj5 = (object)val5;
			}
			PageBuilder.AddStagePanel += (hook_AddStagePanel)obj5;
		}

		private static void PageBuilder_AddStagePanel1(orig_AddStagePanel orig, PageBuilder self, SceneDef sceneDef)
		{
			string @string = Language.GetString(sceneDef.subtitleToken);
			if (@string.Length != 0)
			{
				self.AddSimpleTextPanel("   <color=#D5EBF2><sprite name=\"CloudLeft\" tint=1> " + @string + " <sprite name=\"CloudRight\" tint=1></color>");
			}
			orig.Invoke(self, sceneDef);
		}

		private static void PageBuilder_SurvivorBody(orig_SurvivorBody orig, PageBuilder builder)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(builder);
			CharacterBody val = (CharacterBody)builder.entry.extraData;
			SurvivorDef survivorDef = SurvivorCatalog.GetSurvivorDef(SurvivorCatalog.bodyIndexToSurvivorIndex[val.bodyIndex]);
			string text = string.Empty;
			bool flag = false;
			if (!string.IsNullOrEmpty(survivorDef.outroFlavorToken))
			{
				flag = true;
				text = text + Language.GetString(survivorDef.outroFlavorToken) + "\n";
			}
			if (!string.IsNullOrEmpty(survivorDef.mainEndingEscapeFailureFlavorToken))
			{
				flag = true;
				text = text + Language.GetString(survivorDef.mainEndingEscapeFailureFlavorToken) + "\n";
			}
			if (flag)
			{
				builder.AddSimpleTextPanel(text);
			}
		}

		private static void PageBuilder_AddStagePanel(orig_AddStagePanel orig, PageBuilder self, SceneDef sceneDef)
		{
			orig.Invoke(self, sceneDef);
			TextMeshProUGUI component = ((Component)self.managedObjects.Last().GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
		}

		private static void PageBuilder_AddSimplePickup(orig_AddSimplePickup orig, PageBuilder self, PickupIndex pickupIndex)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, pickupIndex);
			TextMeshProUGUI component = ((Component)self.managedObjects[self.managedObjects.Count - 2].GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
		}

		public static string TimeHHMMSSDisplayValueFormatter(double time2)
		{
			ulong num = (ulong)time2;
			ulong num2 = num / 3600;
			ulong num3 = (num - num2 * 3600) / 60;
			ulong num4 = num - num2 * 3600 - num3 * 60;
			return $"{num2:00}:{num3:00}:{num4:00}";
		}

		private static void PageBuilder_AddSurvivorPanel(orig_AddSurvivorPanel orig, PageBuilder self, CharacterBody bodyPrefabComponent)
		{
			orig.Invoke(self, bodyPrefabComponent);
			string text = TimeHHMMSSDisplayValueFormatter(self.statSheet.GetStatValueDouble(PerBodyStatDef.totalTimeAlive, ((Object)((Component)bodyPrefabComponent).gameObject).name));
			TextMeshProUGUI component = ((Component)self.managedObjects.Last().GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
			string empty = string.Empty;
			string name = ((Object)((Component)bodyPrefabComponent).gameObject).name;
			empty += StatMethod(PerBodyStatDef.totalWins, name, self.statSheet);
			empty = empty + Language.GetString("PERBODYSTATNAME_TOTALTIMEALIVE") + ": <style=cEvent>" + text + "</style>\n";
			empty += ((TMP_Text)component).text;
			empty += StatMethod(PerBodyStatDef.killsAs, name, self.statSheet);
			empty += StatMethod(PerBodyStatDef.damageDealtAs, name, self.statSheet);
			empty += StatMethod(PerBodyStatDef.damageTakenAs, name, self.statSheet);
			empty += StatMethod(PerBodyStatDef.deathsAs, name, self.statSheet);
			((TMP_Text)component).text = empty;
		}

		public static string StatMethod(PerBodyStatDef statDef, string bodyName, StatSheet self)
		{
			return Language.GetString(statDef.nameToken) + ": <style=cEvent>" + TextSerialization.ToStringNumeric(self.GetStatValueULong(statDef, bodyName)) + "</style>\n";
		}

		private static void ExtraMonsterStats(orig_AddMonsterPanel orig, PageBuilder self, CharacterBody bodyPrefabComponent)
		{
			orig.Invoke(self, bodyPrefabComponent);
			string name = ((Object)((Component)bodyPrefabComponent).gameObject).name;
			TextMeshProUGUI component = ((Component)self.managedObjects.Last().GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
			string empty = string.Empty;
			empty += StatMethod(PerBodyStatDef.damageDealtTo, name, self.statSheet);
			empty += ((TMP_Text)component).text;
			empty += "\n";
			empty += StatMethod(PerBodyStatDef.damageTakenFrom, name, self.statSheet);
			((TMP_Text)component).text = empty;
		}

		private static void PageBuilder_AddBodyStatsPanel(orig_AddBodyStatsPanel orig, PageBuilder self, CharacterBody bodyPrefabComponent)
		{
			if (self.managedObjects.Count == 0 && bodyPrefabComponent.subtitleNameToken.Length != 0)
			{
				self.AddSimpleTextPanel("   <color=#D5EBF2><sprite name=\"CloudLeft\" tint=1> " + Language.GetString(bodyPrefabComponent.subtitleNameToken) + " <sprite name=\"CloudRight\" tint=1></style>");
			}
			orig.Invoke(self, bodyPrefabComponent);
		}
	}
	public class LogbookStuff
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_BuildMonsterEntries <0>__AddMissingMonsters;

			public static hook_BuildMonsterEntries <1>__SortBossMonster;

			public static hook_BuildPickupEntries <2>__AddMissingEquipment;

			public static hook_BuildPickupEntries <3>__SortBossEquip;

			public static hook_BuildSurvivorEntries <4>__SurvivorEntryColor;

			public static hook_GetPickupStatus <5>__EliteEquipmentViewable;

			public static Action <6>__Add;
		}

		public static void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//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_007f: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: 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)
			object obj = <>O.<0>__AddMissingMonsters;
			if (obj == null)
			{
				hook_BuildMonsterEntries val = AddMissingMonsters;
				<>O.<0>__AddMissingMonsters = val;
				obj = (object)val;
			}
			LogBookController.BuildMonsterEntries += (hook_BuildMonsterEntries)obj;
			object obj2 = <>O.<1>__SortBossMonster;
			if (obj2 == null)
			{
				hook_BuildMonsterEntries val2 = SortBossMonster;
				<>O.<1>__SortBossMonster = val2;
				obj2 = (object)val2;
			}
			LogBookController.BuildMonsterEntries += (hook_BuildMonsterEntries)obj2;
			object obj3 = <>O.<2>__AddMissingEquipment;
			if (obj3 == null)
			{
				hook_BuildPickupEntries val3 = AddMissingEquipment;
				<>O.<2>__AddMissingEquipment = val3;
				obj3 = (object)val3;
			}
			LogBookController.BuildPickupEntries += (hook_BuildPickupEntries)obj3;
			object obj4 = <>O.<3>__SortBossEquip;
			if (obj4 == null)
			{
				hook_BuildPickupEntries val4 = SortBossEquip;
				<>O.<3>__SortBossEquip = val4;
				obj4 = (object)val4;
			}
			LogBookController.BuildPickupEntries += (hook_BuildPickupEntries)obj4;
			object obj5 = <>O.<4>__SurvivorEntryColor;
			if (obj5 == null)
			{
				hook_BuildSurvivorEntries val5 = SurvivorEntryColor;
				<>O.<4>__SurvivorEntryColor = val5;
				obj5 = (object)val5;
			}
			LogBookController.BuildSurvivorEntries += (hook_BuildSurvivorEntries)obj5;
			object obj6 = <>O.<5>__EliteEquipmentViewable;
			if (obj6 == null)
			{
				hook_GetPickupStatus val6 = EliteEquipmentViewable;
				<>O.<5>__EliteEquipmentViewable = val6;
				obj6 = (object)val6;
			}
			LogBookController.GetPickupStatus += (hook_GetPickupStatus)obj6;
			Logbook_Allies.MoreStats();
			Logbook_MoreStats.MoreStats();
			((ResourceAvailability)(ref SceneCatalog.availability)).CallWhenAvailable((Action)LogSimuStages.Add);
			Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/meridian/meridian.asset").WaitForCompletion().stageOrder = 80;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/goldshores").stageOrder = 81;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/bazaar").stageOrder = 90;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/arena").stageOrder = 91;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/voidstage").stageOrder = 92;
			Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion().stageOrder = 93;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/mysteryspace").stageOrder = 150;
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/limbo").stageOrder = 151;
			Addressables.LoadAssetAsync<SceneDef>((object)"808fe615086cfa042baf950436b1da20").WaitForCompletion().stageOrder = 95;
			Addressables.LoadAssetAsync<SceneDef>((object)"55dcf3dbd137f99458af33ad467bb574").WaitForCompletion().stageOrder = 96;
			Addressables.LoadAssetAsync<SceneDef>((object)"5272c5e76a99aa046b72ad8fb941974c").WaitForCompletion().stageOrder = 97;
		}

		private static EntryStatus EliteEquipmentViewable(orig_GetPickupStatus orig, ref Entry entry, UserProfile viewerProfile)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Invalid comparison between Unknown and I4
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Invalid comparison between Unknown and I4
			//IL_0167: 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)
			EntryStatus val = orig.Invoke(ref entry, viewerProfile);
			if ((int)val == 4)
			{
				return val;
			}
			PickupIndex val2 = (PickupIndex)entry.extraData;
			PickupDef pickupDef = PickupCatalog.GetPickupDef(val2);
			EquipmentIndex val3 = (EquipmentIndex)((pickupDef == null) ? (-1) : ((int)pickupDef.equipmentIndex));
			if ((int)val3 != -1)
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(val3);
				if (Object.op_Implicit((Object)(object)equipmentDef.passiveBuffDef) && equipmentDef.passiveBuffDef.isElite)
				{
					if (viewerProfile.HasDiscoveredPickup(val2))
					{
						return (EntryStatus)4;
					}
					bool flag = false;
					if ((Object)(object)equipmentDef == (Object)(object)Equipment.AffixLunar)
					{
						flag = viewerProfile.HasUnlockable(Items.LunarBadLuck.unlockableDef);
					}
					else if ((Object)(object)equipmentDef == (Object)(object)Equipment.EliteVoidEquipment)
					{
						flag = viewerProfile.HasAchievement("Characters.VoidSurvivor");
					}
					else if ((Object)(object)equipmentDef == (Object)(object)Equipment.EliteAurelioniteEquipment)
					{
						flag = viewerProfile.HasUnlockable(Equipment.HealAndRevive.unlockableDef);
					}
					else
					{
						EliteDef eliteDef = equipmentDef.passiveBuffDef.eliteDef;
						flag = (((int)eliteDef.devotionLevel != 2) ? viewerProfile.HasUnlockable(Survivors.Captain.unlockableDef) : viewerProfile.HasUnlockable(Items.Clover.unlockableDef));
					}
					if (flag)
					{
						return (EntryStatus)4;
					}
					return (EntryStatus)3;
				}
			}
			return val;
		}

		private static Entry[] SortBossMonster(orig_BuildMonsterEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			if (!WConfig.cfgLogbook_SortBosses.Value)
			{
				return orig.Invoke(expansionAvailability);
			}
			Entry[] array = orig.Invoke(expansionAvailability);
			List<Entry> list = new List<Entry>();
			List<Entry> list2 = new List<Entry>();
			for (int i = 0; i < array.Length; i++)
			{
				object extraData = array[i].extraData;
				if (((CharacterBody)((extraData is CharacterBody) ? extraData : null)).isChampion)
				{
					list2.Add(array[i]);
				}
				else
				{
					list.Add(array[i]);
				}
			}
			list.AddRange(list2);
			return list.ToArray();
		}

		public static Entry[] AddMissingMonsters(orig_BuildMonsterEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			if (!WConfig.cfgLogbook_More.Value)
			{
				return orig.Invoke(expansionAvailability);
			}
			UnlockableDef logUnlockableDef = ((Component)BodyPrefabs.GupBody).GetComponent<DeathRewards>().logUnlockableDef;
			((Component)BodyPrefabs.GeepBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef;
			((Component)BodyPrefabs.GipBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef;
			UnlockableDef logUnlockableDef2 = ((Component)BodyPrefabs.SolusAmalgamatorBody).GetComponent<DeathRewards>().logUnlockableDef;
			((Component)BodyPrefabs.SolusAmalgamatorFlamethrowerCannonBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef2;
			((Component)BodyPrefabs.SolusAmalgamatorMissilePodBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef2;
			((Component)BodyPrefabs.SolusAmalgamatorThrusterBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef2;
			UnlockableDef logUnlockableDef3 = ((Component)BodyPrefabs.MinePodBody).GetComponent<DeathRewards>().logUnlockableDef;
			((Component)BodyPrefabs.SolusMineBody).GetComponent<DeathRewards>().logUnlockableDef = logUnlockableDef3;
			BodyPrefabs.ScavLunar1Body.baseNameToken = "SCAVLUNAR_BODY_SUBTITLE";
			((Component)BodyPrefabs.ScavLunar1Body).GetComponent<DeathRewards>().logUnlockableDef = LegacyResourcesAPI.Load<UnlockableDef>("UnlockableDefs/Logs.Stages.limbo");
			UnlockableDef logUnlockableDef4 = LegacyResourcesAPI.Load<UnlockableDef>("unlockabledefs/Items.Clover");
			UnityObjectExtensions.EnsureComponent<DeathRewards>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/UrchinTurretBody")).logUnlockableDef = logUnlockableDef4;
			GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/ShopkeeperBody");
			Transform child = val.transform.GetChild(0).GetChild(0);
			ModelPanelParameters val2 = UnityObjectExtensions.EnsureComponent<ModelPanelParameters>(((Component)child).gameObject);
			InstantiateModelParams val3 = UnityObjectExtensions.EnsureComponent<InstantiateModelParams>(((Component)child).gameObject);
			val2.minDistance = 5f;
			val2.maxDistance = 15f;
			val3.CameraPosition = new Vector3(-1.5f, 4f, 3f);
			val3.FocusPosition = new Vector3(0f, 3f, 0f);
			LegacyResourcesAPI.Load<SceneDef>("SceneDefs/bazaar").dioramaPrefab = ((Component)child).gameObject;
			Entry[] result = orig.Invoke(expansionAvailability);
			BodyPrefabs.ScavLunar1Body.baseNameToken = "SCAVLUNAR1_BODY_NAME";
			return result;
		}

		public static Entry[] AddMissingEquipment(orig_BuildPickupEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			Equipment.EliteGoldEquipment.dropOnDeathChance = 0f;
			List<EquipmentDef> list = new List<EquipmentDef>();
			if (!Chainloader.PluginInfos.ContainsKey("com.TPDespair.ZetAspects") && WConfig.cfgLogbook_EliteEquip.Value)
			{
				for (int i = 0; i < EliteCatalog.eliteDefs.Length; i++)
				{
					EquipmentDef eliteEquipmentDef = EliteCatalog.eliteDefs[i].eliteEquipmentDef;
					if (Object.op_Implicit((Object)(object)eliteEquipmentDef) && eliteEquipmentDef.dropOnDeathChance != 0f)
					{
						list.Add(eliteEquipmentDef);
					}
				}
			}
			if (WConfig.cfgLogbook_More.Value)
			{
				list.Add(Equipment.QuestVolatileBattery);
				list.Add(Equipment.BossHunterConsumed);
				list.Add(Equipment.HealAndReviveConsumed);
			}
			for (int j = 0; j < list.Count; j++)
			{
				list[j].canDrop = true;
			}
			Equipment.AffixLunar.isLunar = false;
			Entry[] result = orig.Invoke(expansionAvailability);
			for (int k = 0; k < list.Count; k++)
			{
				list[k].canDrop = false;
			}
			Equipment.AffixLunar.isLunar = true;
			return result;
		}

		public static Entry[] SortBossEquip(orig_BuildPickupEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			//IL_0037: 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_004e: 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)
			//IL_0053: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			Entry[] array = orig.Invoke(expansionAvailability);
			int num = -1;
			List<Entry> list = new List<Entry>();
			for (int i = 0; i < array.Length; i++)
			{
				if (list.Contains(array[i]))
				{
					continue;
				}
				PickupIndex val = (PickupIndex)array[i].extraData;
				PickupDef pickupDef = ((PickupIndex)(ref val)).pickupDef;
				EquipmentIndex equipmentIndex = pickupDef.equipmentIndex;
				if ((int)equipmentIndex != -1)
				{
					EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex);
					if (Object.op_Implicit((Object)(object)equipmentDef) && (Object.op_Implicit((Object)(object)equipmentDef.passiveBuffDef) || equipmentDef.isBoss))
					{
						Entry val2 = array[i];
						list.Add(array[i]);
						ArrayUtils.ArrayRemoveAtAndResize<Entry>(ref array, i, 1);
						num = array.Length;
						i--;
						ArrayUtils.ArrayInsert<Entry>(ref array, num, ref val2);
						num++;
					}
				}
			}
			return array;
		}

		public static Entry[] SurvivorEntryColor(orig_BuildSurvivorEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Entry[] array = orig.Invoke(expansionAvailability);
			for (int i = 0; i < array.Length; i++)
			{
				array[i].color = ColorModule.NewSurvivorLogbookNameColor;
			}
			return array;
		}
	}
	public class Logbook_AddRecipes
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_AddSimplePickup <0>__AddRecipe;

			public static hook_PopulateRecipes <1>__RemoveUnneededCycleImages;

			public static hook_PopulateImages <2>__RemoveDuplicateRecipes;

			public static hook_PopulateImages <3>__RecipeStrip_PopulateImages;

			public static hook_SetEntry <4>__LogBookPage_SetEntry;
		}

		public static void Add()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_00f0: 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_00fb: Expected O, but got Unknown
			if (WConfig.cfgLogbook_Recipes.Value)
			{
				object obj = <>O.<0>__AddRecipe;
				if (obj == null)
				{
					hook_AddSimplePickup val = AddRecipe;
					<>O.<0>__AddRecipe = val;
					obj = (object)val;
				}
				PageBuilder.AddSimplePickup += (hook_AddSimplePickup)obj;
				object obj2 = <>O.<1>__RemoveUnneededCycleImages;
				if (obj2 == null)
				{
					hook_PopulateRecipes val2 = RemoveUnneededCycleImages;
					<>O.<1>__RemoveUnneededCycleImages = val2;
					obj2 = (object)val2;
				}
				RecipeInfoContainer.PopulateRecipes += (hook_PopulateRecipes)obj2;
				object obj3 = <>O.<2>__RemoveDuplicateRecipes;
				if (obj3 == null)
				{
					hook_PopulateImages val3 = RemoveDuplicateRecipes;
					<>O.<2>__RemoveDuplicateRecipes = val3;
					obj3 = (object)val3;
				}
				RecipeDisplay.PopulateImages += (hook_PopulateImages)obj3;
				object obj4 = <>O.<3>__RecipeStrip_PopulateImages;
				if (obj4 == null)
				{
					hook_PopulateImages val4 = RecipeStrip_PopulateImages;
					<>O.<3>__RecipeStrip_PopulateImages = val4;
					obj4 = (object)val4;
				}
				RecipeStrip.PopulateImages += (hook_PopulateImages)obj4;
				GameObject val5 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/UI/RecipeDisplayUpdated.prefab").WaitForCompletion();
				((Transform)val5.GetComponentInChildren<RecipeDisplay>().recipeStripPrefab).GetChild(1).GetChild(0).localPosition = new Vector3(-20f, 0f, 0f);
				object obj5 = <>O.<4>__LogBookPage_SetEntry;
				if (obj5 == null)
				{
					hook_SetEntry val6 = LogBookPage_SetEntry;
					<>O.<4>__LogBookPage_SetEntry = val6;
					obj5 = (object)val6;
				}
				LogBookPage.SetEntry += (hook_SetEntry)obj5;
			}
		}

		private static void LogBookPage_SetEntry(orig_SetEntry orig, LogBookPage self, UserProfile userProfile, Entry entry)
		{
			orig.Invoke(self, userProfile, entry);
			((Component)((Transform)self.pageBuilder.container).parent.parent.GetChild(1)).gameObject.SetActive(true);
			((Component)((Transform)self.pageBuilder.container).parent.parent.parent).GetComponent<LayoutGroup>().SetDirty();
		}

		public static void RecipeStrip_PopulateNew(RecipeStrip self, PickupIndex itemRecipesFor, bool usedIn)
		{
			//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_0031: 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_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: 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_01dc: Unknown result type (might be due to invalid IL or missing references)
			PickupIndex value = self.recipe.possibleIngredients[0].pickups[0];
			bool flag = ((ReadOnlySpan<PickupIndex>)self.recipe.possibleIngredients[0].pickups).IndexOf<PickupIndex>(value) != -1;
			bool flag2 = ((ReadOnlySpan<PickupIndex>)self.recipe.possibleIngredients[1].pickups).IndexOf<PickupIndex>(value) != -1;
			bool flag3 = false;
			for (int i = 0; i < self.recipe.possibleIngredients.Length; i++)
			{
				RectTransform val = Object.Instantiate<RectTransform>(self.imagePrefab);
				((Component)val).gameObject.SetActive(true);
				((Transform)val).parent = (Transform)(object)self.ingredientContainer;
				List<PickupIndex> list = new List<PickupIndex>();
				PickupIndex[] pickups = self.recipe.possibleIngredients[i].pickups;
				foreach (PickupIndex val2 in pickups)
				{
					if (PickupAvailable(val2))
					{
						list.Add(val2);
					}
				}
				flag3 = flag3 || list.Count == 0;
				((Component)val).GetComponent<CyclingImage>().SetSpritesFromPickupIndices(list.ToArray());
			}
			if (!((Object)(object)self.resultIcon != (Object)null))
			{
				return;
			}
			PickupDef pickupDef = PickupCatalog.GetPickupDef(self.recipe.result);
			if (pickupDef != null)
			{
				self.resultIcon.sprite = pickupDef.iconSprite;
			}
			if ((Object)(object)self.resultBackground != (Object)null)
			{
				Image[] componentsInChildren = ((Component)self.resultBackground).GetComponentsInChildren<Image>();
				Color darkColor = pickupDef.darkColor;
				Image[] array = componentsInChildren;
				foreach (Image val3 in array)
				{
					float a = ((Graphic)val3).color.a;
					((Graphic)val3).color = new Color(darkColor.r, darkColor.g, darkColor.b, a);
				}
			}
		}

		private static void RecipeStrip_PopulateImages(orig_PopulateImages orig, RecipeStrip self)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (((Component)self).transform.GetChild(0).childCount == 2 && self.recipe != null && self.recipe.possibleIngredients != null)
			{
				orig.Invoke(self);
				if (self.recipe.amountToDrop > 1)
				{
					GameObject val = new GameObject("Quantity");
					((TMP_Text)val.AddComponent<HGTextMeshProUGUI>()).text = self.recipe.amountToDrop + "x";
					((TMP_Text)val.GetComponent<HGTextMeshProUGUI>()).fontSize = 30f;
					val.transform.SetParent(((Component)self.resultIcon).transform, false);
					val.transform.localPosition = new Vector3(24f, -8f, 0f);
				}
			}
		}

		private static void RemoveUnneededCycleImages(orig_PopulateRecipes orig, RecipeInfoContainer self, PickupIndex pickupIndex)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, pickupIndex);
			try
			{
				Fixture((Transform)(object)self.createdFromDisplay.container, pickupIndex, 1);
				Fixture((Transform)(object)self.usedToMakeDisplay.container, pickupIndex, 0);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)ex);
			}
		}

		public static void Fixture(Transform recipeHolder, PickupIndex pickup, int start)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			for (int i = start; i < recipeHolder.childCount; i++)
			{
				RecipeStrip component = ((Component)recipeHolder.GetChild(i)).GetComponent<RecipeStrip>();
				if (!component.recipe.IsUsedInMultipleSlots(pickup))
				{
					if (component.recipe.possibleIngredients[1].pickups.Length != 1 && ((ReadOnlySpan<PickupIndex>)component.recipe.possibleIngredients[1].pickups).IndexOf<PickupIndex>(pickup) != -1)
					{
						((Component)((Component)component).transform.GetChild(0).GetChild(3)).GetComponent<CyclingImage>().SetSprites((Sprite[])(object)new Sprite[1] { PickupCatalog.GetPickupDef(pickup).iconSprite });
					}
					else if (component.recipe.possibleIngredients[0].pickups.Length != 1 && ((ReadOnlySpan<PickupIndex>)component.recipe.possibleIngredients[0].pickups).IndexOf<PickupIndex>(pickup) != -1)
					{
						((Component)((Component)component).transform.GetChild(0).GetChild(2)).GetComponent<CyclingImage>().SetSprites((Sprite[])(object)new Sprite[1] { PickupCatalog.GetPickupDef(pickup).iconSprite });
					}
				}
			}
		}

		internal static bool PickupAvailable(PickupIndex index)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			PickupDef pickupDef = PickupCatalog.GetPickupDef(index);
			if ((int)pickupDef.itemIndex != -1)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
				if ((Object)(object)itemDef != (Object)null)
				{
					ExpansionDef requiredExpansion = itemDef.requiredExpansion;
					if ((Object)(object)requiredExpansion != (Object)null)
					{
						return ((BaseUserEntitlementTracker<LocalUser>)(object)EntitlementManager.localUserEntitlementTracker).AnyUserHasEntitlement(requiredExpansion.requiredEntitlement);
					}
				}
			}
			else if ((int)pickupDef.equipmentIndex != -1)
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
				if ((Object)(object)equipmentDef != (Object)null)
				{
					ExpansionDef requiredExpansion2 = equipmentDef.requiredExpansion;
					if ((Object)(object)requiredExpansion2 != (Object)null)
					{
						return ((BaseUserEntitlementTracker<LocalUser>)(object)EntitlementManager.localUserEntitlementTracker).AnyUserHasEntitlement(requiredExpansion2.requiredEntitlement);
					}
				}
			}
			return true;
		}

		private static void RemoveDuplicateRecipes(orig_PopulateImages orig, RecipeDisplay self, List<RecipeEntry> newRecipeEntries)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
			bool flag = ((Object)self).name.StartsWith("U");
			flag = false;
			List<RecipeEntry> list = newRecipeEntries.Distinct().ToList();
			List<RecipeEntry> list2 = new List<RecipeEntry>();
			foreach (RecipeEntry item in list)
			{
				if (PickupAvailable(item.result) && (!flag || item.Required(item.result) == 0) && (item.possibleIngredients[0].pickups.Length != 1 || PickupAvailable(item.possibleIngredients[0].pickups[0])) && (item.possibleIngredients[1].pickups.Length != 1 || PickupAvailable(item.possibleIngredients[1].pickups[0])))
				{
					list2.Add(item);
				}
			}
			orig.Invoke(self, list2);
			if (Object.op_Implicit((Object)(object)self.container))
			{
				for (int i = 0; i < ((Transform)self.container).childCount; i++)
				{
					((Component)((Transform)self.container).GetChild(i)).GetComponent<RecipeStrip>().PopulateImages();
				}
			}
		}

		private static void AddRecipe(orig_AddSimplePickup orig, PageBuilder self, PickupIndex pickupIndex)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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_0029: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, pickupIndex);
			GameObject val = self.AddPrefabInstance(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/UI/RecipeDisplayUpdated.prefab").WaitForCompletion());
			val.GetComponent<RecipeInfoContainer>().PopulateRecipes(pickupIndex);
			((Graphic)val.GetComponent<Image>()).color = new Color(0.3255f, 0.4039f, 0.4706f, 0.8706f);
			val.GetComponent<Image>().sprite = Addressables.LoadAssetAsync<Sprite>((object)"03f90788916529e459ba4d7f40bb32ee").WaitForCompletion();
			val.SetActive(CraftableCatalog.resultToRecipeSearchTable.ContainsKey(pickupIndex) || CraftableCatalog.pickupToIngredientSearchTable.ContainsKey(pickupIndex));
		}
	}
	public class Logbook_AllyStatsMult : MonoBehaviour
	{
		public float healthMult = 1f;

		public float damageMult = 1f;

		public int healthDecay;
	}
	public class Logbook_Allies
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_AddBodyStatsPanel <0>__PageBuilder_AddBodyStatsPanel1;

			public static hook_BuildDroneEntries <1>__LogBookController_BuildDroneEntries;

			public static hook_AddDronePanel <2>__PageBuilder_AddDronePanel;

			public static Manipulator <3>__FixNegativeRegenStatNotShowingInLog;

			public static Manipulator <4>__AddOperatorCommand;

			public static Action <5>__Make;

			public static Action <6>__SetDroneIcon;
		}

		public static GameObject DroneIcon;

		public static void MoreStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00de: 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_00e9: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_0185: 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_01ed: 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_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_014c: Expected O, but got Unknown
			Logbook_AllyStatsMult logbook_AllyStatsMult = null;
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"5290eaf612d386740ac26f289e06b62f").WaitForCompletion();
			logbook_AllyStatsMult = val.AddComponent<Logbook_AllyStatsMult>();
			logbook_AllyStatsMult.healthDecay = 30;
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"e21e3b9cdc2802148986eda1c923c9a1").WaitForCompletion();
			logbook_AllyStatsMult = val2.AddComponent<Logbook_AllyStatsMult>();
			logbook_AllyStatsMult.healthMult = 2f;
			logbook_AllyStatsMult.damageMult = 4f;
			GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"bf5b53aa9306bce4b910220a43b30062").WaitForCompletion();
			logbook_AllyStatsMult = val3.AddComponent<Logbook_AllyStatsMult>();
			logbook_AllyStatsMult.healthMult = 4f;
			logbook_AllyStatsMult.damageMult = 4f;
			GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"1553966a1aafdb743bf87ff4d6602c22").WaitForCompletion();
			logbook_AllyStatsMult = val4.AddComponent<Logbook_AllyStatsMult>();
			logbook_AllyStatsMult.healthDecay = 30;
			object obj = <>O.<0>__PageBuilder_AddBodyStatsPanel1;
			if (obj == null)
			{
				hook_AddBodyStatsPanel val5 = PageBuilder_AddBodyStatsPanel1;
				<>O.<0>__PageBuilder_AddBodyStatsPanel1 = val5;
				obj = (object)val5;
			}
			PageBuilder.AddBodyStatsPanel += (hook_AddBodyStatsPanel)obj;
			object obj2 = <>O.<1>__LogBookController_BuildDroneEntries;
			if (obj2 == null)
			{
				hook_BuildDroneEntries val6 = LogBookController_BuildDroneEntries;
				<>O.<1>__LogBookController_BuildDroneEntries = val6;
				obj2 = (object)val6;
			}
			LogBookController.BuildDroneEntries += (hook_BuildDroneEntries)obj2;
			object obj3 = <>O.<2>__PageBuilder_AddDronePanel;
			if (obj3 == null)
			{
				hook_AddDronePanel val7 = PageBuilder_AddDronePanel;
				<>O.<2>__PageBuilder_AddDronePanel = val7;
				obj3 = (object)val7;
			}
			PageBuilder.AddDronePanel += (hook_AddDronePanel)obj3;
			object obj4 = <>O.<3>__FixNegativeRegenStatNotShowingInLog;
			if (obj4 == null)
			{
				Manipulator val8 = FixNegativeRegenStatNotShowingInLog;
				<>O.<3>__FixNegativeRegenStatNotShowingInLog = val8;
				obj4 = (object)val8;
			}
			PageBuilder.AddBodyStatsPanel += (Manipulator)obj4;
			object obj5 = <>O.<4>__AddOperatorCommand;
			if (obj5 == null)
			{
				Manipulator val9 = AddOperatorCommand;
				<>O.<4>__AddOperatorCommand = val9;
				obj5 = (object)val9;
			}
			PageBuilder.DroneBody += (Manipulator)obj5;
			DroneIcon = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/UI/Logbook/MonsterEntryIcon"), "DroneIcon", false);
			DroneIcon.transform.localScale = new Vector3(0.95f, 0.95f, 0.95f);
			((Graphic)((Component)DroneIcon.transform.GetChild(0)).GetComponent<RawImage>()).color = new Color(0.667f, 0.74f, 0.8f, 1f);
			((Component)DroneIcon.transform.GetChild(0)).GetComponent<RawImage>().uvRect = new Rect(-0.01f, -0.01f, 1.02f, 1.02f);
			((Component)DroneIcon.transform.GetChild(0)).GetComponent<RawImage>().uvRect = new Rect(-0.01f, -0.015f, 1.025f, 1.0325f);
			((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)AllyCatalog.Make);
			((ResourceAvailability)(ref LogBookController.availability)).CallWhenAvailable((Action)SetDroneIcon);
		}

		public static void SetDroneIcon()
		{
			CommonAssets.droneEntryIcon = DroneIcon;
			LogBookController.categories[4].iconPrefab = DroneIcon;
		}

		private static void FixNegativeRegenStatNotShowingInLog(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "UnityEngine.Mathf", "Epsilon")
			}))
			{
				val.Prev.OpCode = OpCodes.Ldc_R4;
				val.Prev.Operand = 0f;
				val.Next.OpCode = OpCodes.Bne_Un_S;
			}
			else
			{
				WQoLMain.log.LogWarning((object)"IL Failed: FixNegativeRegenStatNotShowingInLog");
			}
		}

		private static void AddOperatorCommand(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "RoR2.UI.LogBook.PageBuilder", "AddSimpleBody")
			}))
			{
				val.Emit(OpCodes.Ldloc_0);
				val.EmitDelegate<Func<PageBuilder, CharacterBody, PageBuilder>>((Func<PageBuilder, CharacterBody, PageBuilder>)delegate(PageBuilder page, CharacterBody body)
				{
					bool flag = false;
					if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance.IsExpansionEnabled(DLCS.DLC3))
					{
						flag = true;
					}
					else if (((BaseUserEntitlementTracker<LocalUser>)(object)EntitlementManager.localUserEntitlementTracker).AnyUserHasEntitlement(DLCS.DLC3.requiredEntitlement))
					{
						flag = true;
					}
					if (flag)
					{
						string text = body.baseNameToken.Replace("DT", "").Replace("BODY_NAME", "TIERINFO");
						if (Language.english.TokenIsRegistered(text))
						{
							TextMeshProUGUI component = ((Component)page.managedObjects.Last().GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
							((TMP_Text)component).text = ((TMP_Text)component).text + "\n" + Language.GetString(text);
						}
						DroneCommandReceiver val2 = default(DroneCommandReceiver);
						if (((Component)body).TryGetComponent<DroneCommandReceiver>(ref val2))
						{
							GenericSkill commandSkill = val2.commandSkill;
							if (Object.op_Implicit((Object)(object)val2.commandSkill) && Object.op_Implicit((Object)(object)val2.commandSkill.skillFamily))
							{
								page.AddSimpleTextPanel(string.Format("<color=#1FEFAD>{0}:</color>\n{1}", new object[2]
								{
									Language.GetString("DRONETECH_SECONDARY_NAME"),
									Language.GetString(val2.commandSkill.skillFamily.defaultSkillDef.skillDescriptionToken)
								}));
							}
						}
					}
					return page;
				});
			}
			else
			{
				WQoLMain.log.LogWarning((object)"IL Failed: AddOperatorCommand");
			}
		}

		private static void PageBuilder_AddDronePanel(orig_AddDronePanel orig, PageBuilder self, CharacterBody bodyPrefabComponent)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, bodyPrefabComponent);
			TextMeshProUGUI component = ((Component)self.managedObjects.Last().GetComponent<ChildLocator>().FindChild("MainLabel")).GetComponent<TextMeshProUGUI>();
			DroneIndex droneIndexFromBodyIndex = DroneCatalog.GetDroneIndexFromBodyIndex(bodyPrefabComponent.bodyIndex);
			if ((int)droneIndexFromBodyIndex != -1)
			{
				DroneDef droneDef = DroneCatalog.GetDroneDef(droneIndexFromBodyIndex);
				if (Object.op_Implicit((Object)(object)droneDef) && Object.op_Implicit((Object)(object)droneDef.droneBrokenSpawnCard))
				{
					PurchaseInteraction component2 = droneDef.droneBrokenSpawnCard.prefab.GetComponent<PurchaseInteraction>();
					CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef(component2.costType);
					Language.GetStringFormatted(costTypeDef.costStringFormatToken, new object[1] { component2.cost });
					((TMP_Text)component).text = ((TMP_Text)component).text + Language.GetStringFormatted("DRONE_COST_STAT", new object[1] { Language.GetStringFormatted(costTypeDef.costStringFormatToken, new object[1] { component2.cost }) });
				}
			}
		}

		private static Entry[] LogBookController_BuildDroneEntries(orig_BuildDroneEntries orig, Dictionary<ExpansionDef, bool> expansionAvailability)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_0082: 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_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Expected O, but got Unknown
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected O, but got Unknown
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Expected O, but got Unknown
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			DroneDefs.DTHaulerDrone.desiredSortPosition = 14f;
			DroneDefs.DTHealDrone.desiredSortPosition = 13f;
			DroneDefs.BomberDrone.desiredSortPosition = 100f;
			DroneDefs.DroneCommander.desiredSortPosition = 100f;
			DroneDefs.MissileDrone.desiredSortPosition = 0f;
			DroneDefs.FlameDrone.desiredSortPosition = 1f;
			DroneDefs.BackupDrone.tier = (ItemTier)3;
			DroneDefs.DTGunnerDrone.tier = (ItemTier)6;
			DroneDefs.DTHealDrone.tier = (ItemTier)6;
			DroneDefs.DTHaulerDrone.tier = (ItemTier)6;
			Entry[] array = orig.Invoke(expansionAvailability);
			Entry[] array2 = array;
			foreach (Entry val in array2)
			{
				if (val.extraData == BodyPrefabs.BackupDroneBody)
				{
					val.bgTexture = LegacyResourcesAPI.Load<Texture>("Textures/ItemIcons/BG/texEquipmentBGIcon");
				}
				else if (val.extraData == BodyPrefabs.DTGunnerDroneBody || val.extraData == BodyPrefabs.DTHaulerDroneBody || val.extraData == BodyPrefabs.DTHealingDroneBody)
				{
					val.bgTexture = (Texture)(object)CommonAssets.survivorBgIcon;
				}
			}
			List<Entry> list = new List<Entry>();
			foreach (KeyValuePair<BodyIndex, AllyDef> allyDef in AllyCatalog.AllyDefs)
			{
				if (AllyCatalog.CanSelectDroneEntry(allyDef.Value, expansionAvailability))
				{
					CharacterBody bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(allyDef.Key);
					ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(allyDef.Value.tier);
					GameObject modelPrefab = null;
					ModelLocator component = ((Component)bodyPrefabBodyComponent).GetComponent<ModelLocator>();
					if ((Object)(object)component != (Object)null && (Object)(object)component.logBookModel != (Object)null)
					{
						modelPrefab = ((Component)component.logBookModel).gameObject;
					}
					else
					{
						Debug.LogError((object)("MISSING MODEL PREFAB REF ON " + bodyPrefabBodyComponent.baseNameToken));
					}
					Entry val2 = new Entry();
					val2.nameToken = bodyPrefabBodyComponent.baseNameToken;
					val2.iconTexture = bodyPrefabBodyComponent.portraitIcon;
					val2.color = Color32.op_Implicit(ColorCatalog.GetColor(((int)allyDef.Value.colorOverride != 0) ? allyDe