Decompiled source of ZetTweaks v1.3.1

plugins/ZetTweaks/ZetTweaks.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Missions.Arena.NullWard;
using EntityStates.NewtMonster;
using IL.EntityStates.Missions.Arena.NullWard;
using IL.RoR2;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Missions.Arena.NullWard;
using On.EntityStates.NewtMonster;
using On.RoR2;
using On.RoR2.UI.LogBook;
using On.RoR2.UI.MainMenu;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.UI.MainMenu;
using UnityEngine;
using UnityEngine.Networking;

[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("ZetTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZetTweaks")]
[assembly: AssemblyTitle("ZetTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TPDespair.ZetTweaks;

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

		public static hook_TakeDamageProcess <>9__252_0;

		public static hook_GetItemCountEffective_ItemIndex <>9__253_0;

		public static hook_PlaceTeleporter <>9__254_0;

		public static Func<Instruction, bool> <>9__255_1;

		public static Func<Instruction, bool> <>9__255_2;

		public static Func<int, int> <>9__255_3;

		public static Manipulator <>9__255_0;

		public static hook_FixedUpdate <>9__256_0;

		public static hook_BeginRound <>9__257_0;

		public static Func<Instruction, bool> <>9__262_1;

		public static Func<float, float> <>9__262_2;

		public static Manipulator <>9__262_0;

		public static Func<Instruction, bool> <>9__263_1;

		public static Func<uint, DamageReport, uint> <>9__263_2;

		public static Manipulator <>9__263_0;

		public static Func<Instruction, bool> <>9__264_1;

		public static Func<uint, ShrineBloodBehavior, uint> <>9__264_2;

		public static Manipulator <>9__264_0;

		public static Func<Instruction, bool> <>9__265_1;

		public static Func<Instruction, bool> <>9__265_2;

		public static Func<float, BossGroup, int, int, float> <>9__265_3;

		public static Manipulator <>9__265_0;

		public static hook_OnEnable <>9__266_0;

		public static hook_OnDisable <>9__266_1;

		public static hook_FixedUpdate <>9__266_2;

		public static hook_OnEnter <>9__270_0;

		public static hook_OnExit <>9__270_1;

		public static Func<Instruction, bool> <>9__271_0;

		public static Func<float> <>9__271_1;

		public static hook_Awake <>9__272_0;

		public static Func<Instruction, bool> <>9__274_2;

		public static Func<Instruction, bool> <>9__274_3;

		public static Func<PickupDef, PickupDef> <>9__274_4;

		public static Manipulator <>9__274_0;

		public static hook_GetOptionsFromPickupState <>9__276_0;

		public static hook_TryZoneStart <>9__279_0;

		public static Action<CharacterBody, CharacterMaster> <>9__284_1;

		public static Manipulator <>9__284_0;

		public static hook_Awake <>9__287_0;

		public static Func<Instruction, bool> <>9__288_1;

		public static Func<float> <>9__288_2;

		public static Manipulator <>9__288_0;

		public static Func<Instruction, bool> <>9__289_1;

		public static Func<Instruction, bool> <>9__289_2;

		public static Func<Instruction, bool> <>9__289_3;

		public static Func<ShrineChanceBehavior, Interactor, UniquePickup> <>9__289_5;

		public static Func<UniquePickup, bool> <>9__289_6;

		public static Func<Instruction, bool> <>9__289_7;

		public static Func<Instruction, bool> <>9__289_8;

		public static Manipulator <>9__289_0;

		public static Func<Instruction, bool> <>9__290_1;

		public static Func<Color, ShrineChanceBehavior, UniquePickup, Color> <>9__290_2;

		public static Func<Instruction, bool> <>9__290_3;

		public static Func<Color, ShrineChanceBehavior, UniquePickup, Color> <>9__290_4;

		public static Manipulator <>9__290_0;

		internal void <SelfDamageFlagHook>b__252_0(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
		{
			isAttackingSelfFlag = false;
			if ((Object)(object)self != (Object)null && damageInfo != null)
			{
				GameObject attacker = damageInfo.attacker;
				if ((Object)(object)attacker != (Object)null)
				{
					CharacterBody component = attacker.GetComponent<CharacterBody>();
					if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)self.body)
					{
						isAttackingSelfFlag = true;
					}
				}
			}
			orig.Invoke(self, damageInfo);
			isAttackingSelfFlag = false;
		}

		internal int <ItemCountOverrideHook>b__253_0(orig_GetItemCountEffective_ItemIndex orig, Inventory self, ItemIndex itemIndex)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			int num = orig.Invoke(self, itemIndex);
			if (num > 0 && isAttackingSelfFlag && (int)itemIndex != -1 && selfDamageItemIndexes.Contains(itemIndex))
			{
				return 0;
			}
			return num;
		}

		internal void <PlaceTeleporterHook>b__254_0(orig_PlaceTeleporter orig, SceneDirector self)
		{
			if ((Object)(object)self.teleporterSpawnCard != (Object)null)
			{
				string text = ((Run.instance.NetworkstageClearCount >= 4) ? "iscLunarTeleporter" : "iscTeleporter");
				SpawnCard val = (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/" + text);
				if (Object.op_Implicit((Object)(object)val))
				{
					self.teleporterSpawnCard = val;
				}
				else
				{
					Debug.LogWarning((object)("ZetTweaks - interactablespawncard/" + text + " could not be found!"));
				}
			}
			orig.Invoke(self);
		}

		internal void <BazaarGestureHook>b__255_0(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(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items).GetField("AutoCastEquipment")),
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
			}))
			{
				val.Index += 2;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int count) => (!(SceneInfo.instance.sceneDef.nameToken == "MAP_BAZAAR_TITLE")) ? count : 0));
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - BazaarGestureHook Failed!");
			}
		}

		internal bool <BazaarGestureHook>b__255_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdsfld(x, typeof(Items).GetField("AutoCastEquipment"));
		}

		internal bool <BazaarGestureHook>b__255_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective");
		}

		internal int <BazaarGestureHook>b__255_3(int count)
		{
			if (SceneInfo.instance.sceneDef.nameToken == "MAP_BAZAAR_TITLE")
			{
				return 0;
			}
			return count;
		}

		internal void <BazaarPreventKickoutHook>b__256_0(orig_FixedUpdate orig, KickFromShop self)
		{
			((EntityState)self).outer.SetNextStateToMain();
		}

		internal void <VoidRecoveryHook>b__257_0(orig_BeginRound orig, ArenaMissionController self)
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				return;
			}
			float value = VoidHealthRecoveryCfg.Value;
			float value2 = VoidShieldRecoveryCfg.Value;
			if (!(value > 0f) && !(value2 > 0f))
			{
				return;
			}
			for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
			{
				CharacterBody body = CharacterMaster.readOnlyInstancesList[i].GetBody();
				if (Object.op_Implicit((Object)(object)body))
				{
					HealthComponent healthComponent = body.healthComponent;
					if (!Compat.DisableVoidHealthHeal && value > 0f)
					{
						healthComponent.Heal(healthComponent.fullHealth * value, default(ProcChainMask), true);
					}
					if (value2 > 0f)
					{
						healthComponent.RechargeShield(healthComponent.fullShield * value2);
					}
				}
			}
		}

		internal void <DirectorMoneyHook>b__262_0(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(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.CombatDirector/DirectorMoneyWave", "multiplier")
			}))
			{
				val.EmitDelegate<Func<float, float>>((Func<float, float>)delegate(float value)
				{
					Run instance = Run.instance;
					if (Object.op_Implicit((Object)(object)instance) && instance.stageClearCount < DirectorStageLimitCfg.Value)
					{
						value *= DirectorMoneyCfg.Value;
					}
					return value;
				});
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - DirectorMoneyHook Failed!");
			}
		}

		internal bool <DirectorMoneyHook>b__262_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, "RoR2.CombatDirector/DirectorMoneyWave", "multiplier");
		}

		internal float <DirectorMoneyHook>b__262_2(float value)
		{
			Run instance = Run.instance;
			if (Object.op_Implicit((Object)(object)instance) && instance.stageClearCount < DirectorStageLimitCfg.Value)
			{
				value *= DirectorMoneyCfg.Value;
			}
			return value;
		}

		internal void <GoldFromKillHook>b__263_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DeathRewards>(x, "get_goldReward")
			}))
			{
				val.Index += 1;
				val.Emit(OpCodes.Ldarg, 1);
				val.EmitDelegate<Func<uint, DamageReport, uint>>((Func<uint, DamageReport, uint>)delegate(uint reward, DamageReport damageReport)
				{
					CharacterBody attackerBody = damageReport.attackerBody;
					if (reward != 0 && Object.op_Implicit((Object)(object)attackerBody))
					{
						int participatingPlayerCount = Run.instance.participatingPlayerCount;
						int count = PlayerCharacterMasterController.instances.Count;
						if (participatingPlayerCount != count)
						{
							int num = participatingPlayerCount / count;
							float num2 = Mathf.Max(1f, (float)num - 1f);
							int num3 = num + 2;
							int stageClearCount = Run.instance.stageClearCount;
							float num4 = 0.5f + 0.5f / num2 * Math.Min(num2, count - 1);
							num4 *= (float)Math.Max(0, num3 - stageClearCount) / (float)num3;
							uint num5 = (uint)((float)reward * (num2 * num4 + 1f));
							if (num5 > reward)
							{
								return num5;
							}
						}
					}
					return reward;
				});
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - GoldFromKillHook Failed!");
			}
		}

		internal bool <GoldFromKillHook>b__263_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchCallOrCallvirt<DeathRewards>(x, "get_goldReward");
		}

		internal uint <GoldFromKillHook>b__263_2(uint reward, DamageReport damageReport)
		{
			CharacterBody attackerBody = damageReport.attackerBody;
			if (reward != 0 && Object.op_Implicit((Object)(object)attackerBody))
			{
				int participatingPlayerCount = Run.instance.participatingPlayerCount;
				int count = PlayerCharacterMasterController.instances.Count;
				if (participatingPlayerCount != count)
				{
					int num = participatingPlayerCount / count;
					float num2 = Mathf.Max(1f, (float)num - 1f);
					int num3 = num + 2;
					int stageClearCount = Run.instance.stageClearCount;
					float num4 = 0.5f + 0.5f / num2 * Math.Min(num2, count - 1);
					num4 *= (float)Math.Max(0, num3 - stageClearCount) / (float)num3;
					uint num5 = (uint)((float)reward * (num2 * num4 + 1f));
					if (num5 > reward)
					{
						return num5;
					}
				}
			}
			return reward;
		}

		internal void <ModifyBloodShrineReward>b__264_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1)
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.EmitDelegate<Func<uint, ShrineBloodBehavior, uint>>((Func<uint, ShrineBloodBehavior, uint>)delegate(uint money, ShrineBloodBehavior shrine)
				{
					if (Object.op_Implicit((Object)(object)Run.instance))
					{
						uint num = (uint)((float)Run.instance.GetDifficultyScaledCost(25) * ((float)shrine.purchaseInteraction.cost / 100f) * BloodShrineScaleCfg.Value);
						if (num > money)
						{
							return num;
						}
					}
					return money;
				});
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - ModifyBloodShrineReward Failed!");
			}
		}

		internal bool <ModifyBloodShrineReward>b__264_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 1);
		}

		internal uint <ModifyBloodShrineReward>b__264_2(uint money, ShrineBloodBehavior shrine)
		{
			if (Object.op_Implicit((Object)(object)Run.instance))
			{
				uint num = (uint)((float)Run.instance.GetDifficultyScaledCost(25) * ((float)shrine.purchaseInteraction.cost / 100f) * BloodShrineScaleCfg.Value);
				if (num > money)
				{
					return num;
				}
			}
			return money;
		}

		internal void <BossRewardChanceHook>b__265_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<BossGroup>(x, "bossDropChance")
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 8);
				val.Emit(OpCodes.Ldloc, 2);
				val.EmitDelegate<Func<float, BossGroup, int, int, float>>((Func<float, BossGroup, int, int, float>)delegate(float rng, BossGroup bossGroup, int i, int count)
				{
					if (bossGroup.forceTier3Reward)
					{
						return rng;
					}
					float num = ((float)i + 1f) / (float)count;
					int num2 = count - i;
					float num3 = 0f;
					if (num > 0.39f)
					{
						num3 = 0.05f;
					}
					if (num > 0.59f)
					{
						num3 = 0.1f;
					}
					if (num > 0.79f)
					{
						num3 = 0.2f;
					}
					if (num2 <= 4)
					{
						num3 = Mathf.Max(0.15f, num3);
					}
					if (num2 <= 2)
					{
						num3 = Mathf.Max(0.25f, num3);
					}
					Debug.LogWarning((object)("Drop Reward - " + i + " (" + (i + 1) + " of " + count + ") progress: " + num + " rng: " + rng + " chance: " + num3 + " - " + (rng <= num3)));
					return (rng <= num3) ? 0f : 1f;
				});
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - BossRewardChanceHook Failed!");
			}
		}

		internal bool <BossRewardChanceHook>b__265_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdarg(x, 0);
		}

		internal bool <BossRewardChanceHook>b__265_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld<BossGroup>(x, "bossDropChance");
		}

		internal float <BossRewardChanceHook>b__265_3(float rng, BossGroup bossGroup, int i, int count)
		{
			if (bossGroup.forceTier3Reward)
			{
				return rng;
			}
			float num = ((float)i + 1f) / (float)count;
			int num2 = count - i;
			float num3 = 0f;
			if (num > 0.39f)
			{
				num3 = 0.05f;
			}
			if (num > 0.59f)
			{
				num3 = 0.1f;
			}
			if (num > 0.79f)
			{
				num3 = 0.2f;
			}
			if (num2 <= 4)
			{
				num3 = Mathf.Max(0.15f, num3);
			}
			if (num2 <= 2)
			{
				num3 = Mathf.Max(0.25f, num3);
			}
			Debug.LogWarning((object)("Drop Reward - " + i + " (" + (i + 1) + " of " + count + ") progress: " + num + " rng: " + rng + " chance: " + num3 + " - " + (rng <= num3)));
			if (rng <= num3)
			{
				return 0f;
			}
			return 1f;
		}

		internal void <UnlockInteractablesHook>b__266_0(orig_OnEnable orig, OutsideInteractableLocker self)
		{
		}

		internal void <UnlockInteractablesHook>b__266_1(orig_OnDisable orig, OutsideInteractableLocker self)
		{
		}

		internal void <UnlockInteractablesHook>b__266_2(orig_FixedUpdate orig, OutsideInteractableLocker self)
		{
		}

		internal void <VoidCellHook>b__270_0(orig_OnEnter orig, NullWardBaseState self)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Invalid comparison between Unknown and I4
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Invalid comparison between Unknown and I4
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			float num = (ModifyHoldoutValueCfg.Value ? VoidRadiusCfg.Value : NullWardBaseState.wardRadiusOn);
			if (Object.op_Implicit((Object)(object)Run.instance) && EclipseHoldoutLimitCfg.Value)
			{
				bool flag = (int)Run.instance.selectedDifficulty >= 4;
				if ((int)ZetTweaksPlugin.EclipseArtifact != -1 && RunArtifactManager.instance.IsArtifactEnabled(ZetTweaksPlugin.EclipseArtifact))
				{
					flag = true;
				}
				if (flag)
				{
					if (num <= 20f)
					{
						num *= 2f;
					}
					else if (num < 40f)
					{
						num = 40f;
					}
				}
			}
			NullWardBaseState.wardRadiusOn = num;
			orig.Invoke(self);
		}

		internal void <VoidCellHook>b__270_1(orig_OnExit orig, Active self)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			HoldoutZoneController holdoutZoneController = self.holdoutZoneController;
			if (Object.op_Implicit((Object)(object)holdoutZoneController))
			{
				VoidCellExitRadius = holdoutZoneController.currentRadius;
				ChildLocator childLocator = ((NullWardBaseState)self).childLocator;
				if (Object.op_Implicit((Object)(object)childLocator))
				{
					Transform val = ((NullWardBaseState)self).childLocator.FindChild("CompleteEffect");
					if (Object.op_Implicit((Object)(object)val))
					{
						float num = VoidCellExitRadius * 0.933f;
						val.localScale = new Vector3(num, num, num);
					}
				}
			}
			orig.Invoke(self);
		}

		internal bool <ReplaceWardRadius>b__271_0(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdsfld(x, typeof(NullWardBaseState).GetField("wardRadiusOn"));
		}

		internal float <ReplaceWardRadius>b__271_1()
		{
			return Mathf.Max(10f, VoidCellExitRadius);
		}

		internal void <HoldoutZoneHook>b__272_0(orig_Awake orig, HoldoutZoneController self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			if (ModifyHoldoutValueCfg.Value)
			{
				ModifyHoldoutValues(self);
			}
			if (EclipseHoldoutLimitCfg.Value)
			{
				bool flag = (int)Run.instance.selectedDifficulty >= 4;
				if ((int)ZetTweaksPlugin.EclipseArtifact != -1 && RunArtifactManager.instance.IsArtifactEnabled(ZetTweaksPlugin.EclipseArtifact))
				{
					flag = true;
				}
				if (flag)
				{
					if (self.baseRadius <= 20f)
					{
						self.baseRadius *= 2f;
					}
					else if (self.baseRadius < 40f)
					{
						self.baseRadius = 40f;
					}
				}
			}
			orig.Invoke(self);
		}

		internal void <CommandDropletFix>b__274_0(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			<>c__DisplayClass274_0 CS$<>8__locals2 = new <>c__DisplayClass274_0();
			ILCursor val = new ILCursor(il);
			CS$<>8__locals2.methodInfo = typeof(PickupCatalog).GetMethod("GetPickupDef");
			int num = default(int);
			if (val.TryGotoNext(new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)CS$<>8__locals2.methodInfo),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
			}))
			{
				val.Index += 3;
				val.EmitDelegate<Func<PickupDef, PickupDef>>((Func<PickupDef, PickupDef>)delegate(PickupDef pickupDef)
				{
					//IL_001e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0024: Invalid comparison between Unknown and I4
					//IL_0071: Unknown result type (might be due to invalid IL or missing references)
					//IL_0077: Invalid comparison between Unknown and I4
					//IL_0053: Unknown result type (might be due to invalid IL or missing references)
					//IL_003a: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a8: 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)
					if (Compat.ZetAspects && !AspectsResolved)
					{
						ResolveAspects();
					}
					if ((int)pickupDef.itemIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupItems || !aspectItemIndexes.Contains(pickupDef.itemIndex)))
					{
						ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
						if (itemDef.ContainsTag((ItemTag)9))
						{
							return (PickupDef)null;
						}
					}
					if ((int)pickupDef.equipmentIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupEquip || !aspectEquipIndexes.Contains(pickupDef.equipmentIndex)))
					{
						EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
						if (!equipmentDef.canDrop)
						{
							return (PickupDef)null;
						}
					}
					return pickupDef;
				});
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - CommandDropletFix Failed!");
			}
		}

		internal bool <CommandDropletFix>b__274_2(Instruction x)
		{
			int num = default(int);
			return ILPatternMatchingExt.MatchStloc(x, ref num);
		}

		internal bool <CommandDropletFix>b__274_3(Instruction x)
		{
			int num = default(int);
			return ILPatternMatchingExt.MatchLdloc(x, ref num);
		}

		internal PickupDef <CommandDropletFix>b__274_4(PickupDef pickupDef)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Invalid comparison between Unknown and I4
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Invalid comparison between Unknown and I4
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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)
			if (Compat.ZetAspects && !AspectsResolved)
			{
				ResolveAspects();
			}
			if ((int)pickupDef.itemIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupItems || !aspectItemIndexes.Contains(pickupDef.itemIndex)))
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
				if (itemDef.ContainsTag((ItemTag)9))
				{
					return null;
				}
			}
			if ((int)pickupDef.equipmentIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupEquip || !aspectEquipIndexes.Contains(pickupDef.equipmentIndex)))
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
				if (!equipmentDef.canDrop)
				{
					return null;
				}
			}
			return pickupDef;
		}

		internal Option[] <CleanPickerOptionsHook>b__276_0(orig_GetOptionsFromPickupState orig, UniquePickup pickupState)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			Option[] options = orig.Invoke(pickupState);
			return CleanupOptions(options);
		}

		internal void <PickupTeleportHook>b__279_0(orig_TryZoneStart orig, MapZone self, Collider collider)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0050: 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_0062: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			if ((int)self.zoneType == 0 && ColliderPickup(collider))
			{
				SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
				val.hullSize = (HullClassification)0;
				val.nodeGraphType = (GraphType)0;
				val.prefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab");
				DirectorPlacementRule val2 = new DirectorPlacementRule
				{
					placementMode = (PlacementMode)3,
					position = ((Component)collider).transform.position
				};
				GameObject val3 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, val2, RoR2Application.rng));
				if (Object.op_Implicit((Object)(object)val3))
				{
					Debug.Log((object)"tp item back");
					TeleportHelper.TeleportGameObject(((Component)collider).gameObject, val3.transform.position);
					Object.Destroy((Object)(object)val3);
				}
				Object.Destroy((Object)(object)val);
			}
			orig.Invoke(self, collider);
		}

		internal void <HandleDroneDeathHook>b__284_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0011: 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)
			ILCursor val = new ILCursor(il);
			val.Index = 0;
			val.Emit(OpCodes.Ldarg, 1);
			val.Emit(OpCodes.Ldarg, 0);
			val.EmitDelegate<Action<CharacterBody, CharacterMaster>>((Action<CharacterBody, CharacterMaster>)delegate(CharacterBody body, CharacterMaster master)
			{
				OnDroneBodyDeath(master, body);
			});
		}

		internal void <HandleDroneDeathHook>b__284_1(CharacterBody body, CharacterMaster master)
		{
			OnDroneBodyDeath(master, body);
		}

		internal void <ChanceShrineAwakeHook>b__287_0(orig_Awake orig, ShrineChanceBehavior self)
		{
			bool flag = self.failureChance >= 0.945f;
			if (!flag)
			{
				self.maxPurchaseCount = ChanceShrineCountCfg.Value;
				self.costMultiplierPerPurchase = ChanceShrineCostMultCfg.Value;
				self.refreshTimer = ChanceShrineTimerCfg.Value;
			}
			orig.Invoke(self);
			if (!flag)
			{
				PurchaseInteraction purchaseInteraction = self.purchaseInteraction;
				if (Object.op_Implicit((Object)(object)purchaseInteraction))
				{
					purchaseInteraction.cost = ChanceShrineCostCfg.Value;
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - ChanceShrineAwakeHook : Could not set base cost!");
				}
			}
		}

		internal void <ChanceShrineTimerHook>b__288_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld<ShrineChanceBehavior>(x, "refreshTimer")
			}))
			{
				val.Emit(OpCodes.Pop);
				val.EmitDelegate<Func<float>>((Func<float>)(() => ChanceShrineTimerCfg.Value));
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - ChanceShrineTimerHook Failed!");
			}
		}

		internal bool <ChanceShrineTimerHook>b__288_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld<ShrineChanceBehavior>(x, "refreshTimer");
		}

		internal float <ChanceShrineTimerHook>b__288_2()
		{
			return ChanceShrineTimerCfg.Value;
		}

		internal void <ChanceShrineDropHook>b__289_0(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass289_0 CS$<>8__locals3 = new <>c__DisplayClass289_0();
			ILCursor val = new ILCursor(il);
			CS$<>8__locals3.PickupInvalidFlag = -1;
			if (val.TryGotoNext(new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)typeof(UniquePickup).GetMethod("get_isValid")),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchCeq(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals3.PickupInvalidFlag)
			}))
			{
				val.Index += 4;
				ILLabel val2 = val.MarkLabel();
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldarg, 1);
				val.EmitDelegate<Func<ShrineChanceBehavior, Interactor, UniquePickup>>((Func<ShrineChanceBehavior, Interactor, UniquePickup>)((ShrineChanceBehavior self, Interactor interactor) => GenerateDrop(self, interactor)));
				val.Emit(OpCodes.Stloc, 0);
				val.Emit(OpCodes.Ldloc, 0);
				val.EmitDelegate<Func<UniquePickup, bool>>((Func<UniquePickup, bool>)((UniquePickup pickup) => !((UniquePickup)(ref pickup)).isValid));
				val.Emit(OpCodes.Stloc, CS$<>8__locals3.PickupInvalidFlag);
				val.Index = 0;
				if (val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "GetComponent"),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1)
				}))
				{
					if (val2 != null)
					{
						val.Index += 2;
						val.Emit(OpCodes.Br, val2.Target);
					}
					else
					{
						Debug.LogWarning((object)"ZetTweaks - ChanceShrineDropHook:Illabel is null!");
					}
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - ChanceShrineDropHook:Bypass Failed!");
				}
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - ChanceShrineDropHook:BypassSetup Failed!");
			}
		}

		internal bool <ChanceShrineDropHook>b__289_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)typeof(UniquePickup).GetMethod("get_isValid"));
		}

		internal bool <ChanceShrineDropHook>b__289_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdcI4(x, 0);
		}

		internal bool <ChanceShrineDropHook>b__289_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchCeq(x);
		}

		internal UniquePickup <ChanceShrineDropHook>b__289_5(ShrineChanceBehavior self, Interactor interactor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			return GenerateDrop(self, interactor);
		}

		internal bool <ChanceShrineDropHook>b__289_6(UniquePickup pickup)
		{
			return !((UniquePickup)(ref pickup)).isValid;
		}

		internal bool <ChanceShrineDropHook>b__289_7(Instruction x)
		{
			return ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "GetComponent");
		}

		internal bool <ChanceShrineDropHook>b__289_8(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 1);
		}

		internal void <ChanceShrineColorHook>b__290_0(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_004d: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<ShrineChanceBehavior>(x, "colorShrineRewardJackpot")
			}))
			{
				val.Index += 1;
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 0);
				val.EmitDelegate<Func<Color, ShrineChanceBehavior, UniquePickup, Color>>((Func<Color, ShrineChanceBehavior, UniquePickup, Color>)((Color color, ShrineChanceBehavior self, UniquePickup pickup) => (self.failureChance >= 0.945f) ? color : GetPickupColor(pickup)));
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - ChanceShrineColorHook:Jackpot Failed!");
			}
			val.Index = 0;
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<ShrineChanceBehavior>(x, "colorShrineRewardNormal")
			}))
			{
				val.Index += 1;
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 0);
				val.EmitDelegate<Func<Color, ShrineChanceBehavior, UniquePickup, Color>>((Func<Color, ShrineChanceBehavior, UniquePickup, Color>)((Color color, ShrineChanceBehavior self, UniquePickup pickup) => (self.failureChance >= 0.945f) ? color : GetPickupColor(pickup)));
			}
			else
			{
				Debug.LogWarning((object)"ZetTweaks - ChanceShrineColorHook:Normal Failed!");
			}
		}

		internal bool <ChanceShrineColorHook>b__290_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld<ShrineChanceBehavior>(x, "colorShrineRewardJackpot");
		}

		internal Color <ChanceShrineColorHook>b__290_2(Color color, ShrineChanceBehavior self, UniquePickup pickup)
		{
			//IL_001b: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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)
			if (self.failureChance >= 0.945f)
			{
				return color;
			}
			return GetPickupColor(pickup);
		}

		internal bool <ChanceShrineColorHook>b__290_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdfld<ShrineChanceBehavior>(x, "colorShrineRewardNormal");
		}

		internal Color <ChanceShrineColorHook>b__290_4(Color color, ShrineChanceBehavior self, UniquePickup pickup)
		{
			//IL_001b: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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)
			if (self.failureChance >= 0.945f)
			{
				return color;
			}
			return GetPickupColor(pickup);
		}

		internal SpawnCard <.cctor>b__295_0()
		{
			return (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenTurret1");
		}

		internal SpawnCard <.cctor>b__295_1()
		{
			return (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenMegaDrone");
		}

		internal SpawnCard <.cctor>b__295_2()
		{
			return (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenEquipmentDrone");
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass274_0
	{
		public MethodInfo methodInfo;

		internal bool <CommandDropletFix>b__1(Instruction x)
		{
			return ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)methodInfo);
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass289_0
	{
		public int PickupInvalidFlag;

		internal bool <ChanceShrineDropHook>b__4(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, ref PickupInvalidFlag);
		}
	}

	private static readonly Lazy<SpawnCard> _turret1SpawnCard = new Lazy<SpawnCard>((Func<SpawnCard>)(() => (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenTurret1")));

	private static readonly Lazy<SpawnCard> _megaDroneSpawnCard = new Lazy<SpawnCard>((Func<SpawnCard>)(() => (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenMegaDrone")));

	private static readonly Lazy<SpawnCard> _equipDroneSpawnCard = new Lazy<SpawnCard>((Func<SpawnCard>)(() => (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/iscBrokenEquipmentDrone")));

	internal static GameObject LunarEquipmentDropletPrefab;

	private static bool AspectsResolved = false;

	internal static bool AspectCommandGroupItems = false;

	internal static bool AspectCommandGroupEquip = false;

	internal static List<ItemIndex> aspectItemIndexes = new List<ItemIndex>();

	internal static List<EquipmentIndex> aspectEquipIndexes = new List<EquipmentIndex>();

	public static bool isAttackingSelfFlag = false;

	public static HashSet<ItemIndex> selfDamageItemIndexes = new HashSet<ItemIndex>();

	private static float VoidCellExitRadius = 15f;

	public static ConfigEntry<bool> EnableModuleCfg { get; set; }

	public static ConfigEntry<bool> FixSelfDamageCfg { get; set; }

	public static ConfigEntry<bool> FixMeanderTeleporterCfg { get; set; }

	public static ConfigEntry<bool> BazaarGestureCfg { get; set; }

	public static ConfigEntry<bool> BazaarPreventKickoutCfg { get; set; }

	public static ConfigEntry<float> VoidHealthRecoveryCfg { get; set; }

	public static ConfigEntry<float> VoidShieldRecoveryCfg { get; set; }

	public static ConfigEntry<int> RecolorLunarEquipmentCfg { get; set; }

	public static ConfigEntry<float> MoneyChestGivenCfg { get; set; }

	public static ConfigEntry<int> MoneyStageLimitCfg { get; set; }

	public static ConfigEntry<float> BloodShrineScaleCfg { get; set; }

	public static ConfigEntry<float> DirectorMoneyCfg { get; set; }

	public static ConfigEntry<int> DirectorStageLimitCfg { get; set; }

	public static ConfigEntry<bool> MultitudeMoneyCfg { get; set; }

	public static ConfigEntry<bool> BossDropTweakCfg { get; set; }

	public static ConfigEntry<bool> UnlockInteractablesCfg { get; set; }

	public static ConfigEntry<bool> EclipseHoldoutLimitCfg { get; set; }

	public static ConfigEntry<bool> ModifyHoldoutValueCfg { get; set; }

	public static ConfigEntry<float> TeleRadiusCfg { get; set; }

	public static ConfigEntry<float> TeleTimeCfg { get; set; }

	public static ConfigEntry<float> VoidRadiusCfg { get; set; }

	public static ConfigEntry<float> VoidTimeCfg { get; set; }

	public static ConfigEntry<float> VoidBossRadiusCfg { get; set; }

	public static ConfigEntry<float> VoidBossTimeCfg { get; set; }

	public static ConfigEntry<float> MassRadiusCfg { get; set; }

	public static ConfigEntry<float> MassTimeCfg { get; set; }

	public static ConfigEntry<float> ShipRadiusCfg { get; set; }

	public static ConfigEntry<float> ShipTimeCfg { get; set; }

	public static ConfigEntry<int> MoonHoldoutZonesCfg { get; set; }

	public static ConfigEntry<int> VoidBossHoldoutZonesCfg { get; set; }

	public static ConfigEntry<bool> CommandDropletFixCfg { get; set; }

	public static ConfigEntry<bool> CleanPickerOptionsCfg { get; set; }

	public static ConfigEntry<bool> TeleportLostDropletCfg { get; set; }

	public static ConfigEntry<bool> DroneFriendlyFireFixCfg { get; set; }

	public static ConfigEntry<float> DroneEquipmentDropCfg { get; set; }

	public static ConfigEntry<bool> DroneTC280AnywhereCfg { get; set; }

	public static ConfigEntry<bool> DroneEquipmentAnywhereCfg { get; set; }

	public static ConfigEntry<bool> DroneTC280RepurchasableCfg { get; set; }

	public static ConfigEntry<bool> DroneTurretRepurchasableCfg { get; set; }

	public static ConfigEntry<bool> ModifyChanceShrineCfg { get; set; }

	public static ConfigEntry<int> ChanceShrineCountCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineTimerCfg { get; set; }

	public static ConfigEntry<int> ChanceShrineCostCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineCostMultCfg { get; set; }

	public static ConfigEntry<int> ChanceShrineMaxFailCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineFailureCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineFailureMultCfg { get; set; }

	public static ConfigEntry<bool> ChanceShrineHackedLockCfg { get; set; }

	public static ConfigEntry<bool> ChanceShrineBypassDropTableCfg { get; set; }

	public static ConfigEntry<bool> ChanceShrineLunarConversionCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineEquipmentCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineEquipmentMultCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineCommonCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineCommonMultCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineUncommonCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineUncommonMultCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineLegendaryCfg { get; set; }

	public static ConfigEntry<float> ChanceShrineLegendaryMultCfg { get; set; }

	internal static SpawnCard Turret1SpawnCard => _turret1SpawnCard.Value;

	internal static SpawnCard MegaDroneSpawnCard => _megaDroneSpawnCard.Value;

	internal static SpawnCard EquipDroneSpawnCard => _equipDroneSpawnCard.Value;

	internal static void SetupConfig()
	{
		ConfigFile configFile = ZetTweaksPlugin.ConfigFile;
		EnableModuleCfg = configFile.Bind<bool>("2a-Gameplay - Enable", "enableGameplayModule", true, "Enable Gameplay Module.");
		FixSelfDamageCfg = configFile.Bind<bool>("2b-Gameplay - Fixes", "fixSelfDamage", true, "Prevent Focus Crystal, Crowbar and DelicateWatch from increasing self damage.");
		FixMeanderTeleporterCfg = configFile.Bind<bool>("2b-Gameplay - Fixes", "endloopTeleporter", true, "Always spawn Primordial Teleporter after it first appears.");
		BazaarGestureCfg = configFile.Bind<bool>("2b-Gameplay - QOL", "disableBazaarGesture", true, "Prevent Gesture from firing equipment in Bazaar.");
		BazaarPreventKickoutCfg = configFile.Bind<bool>("2b-Gameplay - QOL", "disableBazaarKickout", true, "Prevent damaging the Newt from kicking players from the Bazaar.");
		VoidHealthRecoveryCfg = configFile.Bind<float>("2b-Gameplay - QOL", "voidHealthRecovery", 0.5f, "Recover health fraction when a voidcell is activated. 0 to disable.");
		VoidShieldRecoveryCfg = configFile.Bind<float>("2b-Gameplay - QOL", "voidShieldRecovery", 0.5f, "Recover shield fraction when a voidcell is activated. 0 to disable.");
		RecolorLunarEquipmentCfg = configFile.Bind<int>("2b-Gameplay - Tweak", "recolorLunarEquipment", 1, "Change the color of lunar equipment droplets. 0 = Disabled, 1 = AutoCompat, 2 = Force Enabled");
		MoneyChestGivenCfg = configFile.Bind<float>("2c-Gameplay - Economy", "startingMoney", 1.25f, "Money given at stage start (measured in chests).");
		MoneyStageLimitCfg = configFile.Bind<int>("2c-Gameplay - Economy", "stageMoneyLimit", 5, "Last stage to give start money. 0 to disable.");
		BloodShrineScaleCfg = configFile.Bind<float>("2c-Gameplay - Economy", "bloodShrineScale", 2f, "Minimum money given (measured in chests) when blood shrine takes 100% health. 0 to disable.");
		DirectorMoneyCfg = configFile.Bind<float>("2c-Gameplay - Economy", "directorMoney", 1.1f, "Combat director money wave amount multiplier.");
		DirectorStageLimitCfg = configFile.Bind<int>("2c-Gameplay - Economy", "stageDirectorLimit", 5, "Last stage to modify combat director money. 0 to disable.");
		MultitudeMoneyCfg = configFile.Bind<bool>("2c-Gameplay - Economy", "multitudeMoneyBoost", true, "Decaying boost to money from kills when multitudes is enabled.");
		BossDropTweakCfg = configFile.Bind<bool>("2d-Gameplay - TeleporterBoss", "tweakBossDropRewards", true, "Adjust Teleporter boss drop chance when creating ring of drops - reduced at start and increased near end.");
		UnlockInteractablesCfg = configFile.Bind<bool>("2d-Gameplay - TeleporterBoss", "bossUnlockInteractable", true, "Prevent Teleporter from locking outside interactables.");
		EclipseHoldoutLimitCfg = configFile.Bind<bool>("2e-Gameplay - HoldoutZone", "eclipseHoldoutLimiter", true, "Prevent Eclipse from shrinking small holdout zones.");
		ModifyHoldoutValueCfg = configFile.Bind<bool>("2e-Gameplay - HoldoutZone", "modifyHoldoutValues", true, "Enable or disable changing radius and charge times of holdout zones except eclipse limiter.");
		TeleRadiusCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "teleHoldoutRadius", 90f, "Base radius of teleporter holdout zone. Vanilla is 60");
		TeleTimeCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "teleHoldoutTime", 90f, "Base duration of teleporter holdout zone. Vanilla is 90");
		VoidRadiusCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "voidHoldoutRadius", 20f, "Base radius of void field holdout zone. Vanilla is 15");
		VoidTimeCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "voidHoldoutTime", 45f, "Base duration of void field holdout zone. Vanilla is 60");
		VoidBossRadiusCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "voidBossHoldoutRadius", 30f, "Base radius of deep void holdout zone. Vanilla is 20");
		VoidBossTimeCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "voidBossHoldoutTime", 45f, "Base duration of deep void holdout zone. Vanilla is 60");
		MassRadiusCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "massHoldoutRadius", 30f, "Base radius of pillar of mass holdout zone. Vanilla is 20");
		MassTimeCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "massHoldoutTime", 45f, "Base duration of pillar of mass holdout zone. Vanilla is 60");
		ShipRadiusCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "shipHoldoutRadius", 60f, "Base radius of rescue ship holdout zone. Vanilla is 40");
		ShipTimeCfg = configFile.Bind<float>("2e-Gameplay - HoldoutZone", "shipHoldoutTime", 45f, "Base duration of rescue ship holdout zone. Vanilla is 60");
		MoonHoldoutZonesCfg = configFile.Bind<int>("2e-Gameplay - HoldoutZone", "moonHoldoutZones", 2, "Pillars required to fight Mithrix. Range : 1 - 4");
		VoidBossHoldoutZonesCfg = configFile.Bind<int>("2e-Gameplay - HoldoutZone", "voidBossHoldoutZones", 3, "Pillars required to fight Voidling. Range : 1 - 4");
		CommandDropletFixCfg = configFile.Bind<bool>("2f-Gameplay - Droplet", "commandDropletFix", true, "No command droplet for items that don't give choices.");
		CleanPickerOptionsCfg = configFile.Bind<bool>("2f-Gameplay - Droplet", "cleanPickerOptions", true, "Remove disabled-unobtainable items from command options.");
		TeleportLostDropletCfg = configFile.Bind<bool>("2f-Gameplay - Droplet", "teleportLostDroplet", true, "Teleport pickup droplets that go out of bounds.");
		DroneFriendlyFireFixCfg = configFile.Bind<bool>("2H-Gameplay - Drone", "droneFriendlyFireFix", true, "Prevent most drones from targeting allies.");
		DroneEquipmentDropCfg = configFile.Bind<float>("2H-Gameplay - Drone", "droneEquipmentDrop", 0.25f, "Chance for equipment drones to drop their equipment. 1 = 100% chance");
		DroneTC280RepurchasableCfg = configFile.Bind<bool>("2H-Gameplay - Drone", "droneTC280Repurchasable", true, "Make the TC280 repurchasable after it is destroyed.");
		DroneTurretRepurchasableCfg = configFile.Bind<bool>("2H-Gameplay - Drone", "droneTurretRepurchasable", true, "Make the Gunner Turret repurchasable after it is destroyed.");
		DroneTC280AnywhereCfg = configFile.Bind<bool>("2H-Gameplay - Drone", "droneTC280Anywhere", true, "Allow the TC-280 to spawn anywhere regular drones spawn.");
		DroneEquipmentAnywhereCfg = configFile.Bind<bool>("2H-Gameplay - Drone", "droneEquipmentAnywhere", true, "Allow Equipment Drones to spawn anywhere regular drones spawn.");
		ModifyChanceShrineCfg = configFile.Bind<bool>("2i-Gameplay - Shrine", "modifyChanceShrine", true, "Modify chance shrine behavior.");
		ChanceShrineCountCfg = configFile.Bind<int>("2i-Gameplay - Shrine", "chanceShrineCount", 2, "Maximum successful purchases from a chance shrine.");
		ChanceShrineTimerCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineTimer", 1f, "Time between chance shrine uses. Vanilla is 2");
		ChanceShrineCostCfg = configFile.Bind<int>("2i-Gameplay - Shrine", "chanceShrineCost", 17, "Base cost of chance shrine. Vanilla is 17");
		ChanceShrineCostMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineCostMult", 1.4f, "Cost multiplier every time chance shrine is used. Vanilla is 1.4");
		ChanceShrineMaxFailCfg = configFile.Bind<int>("2i-Gameplay - Shrine", "chanceShrineMaxFail", 5, "Consecutive failure effects dont scale past this amount.");
		ChanceShrineFailureCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineFailure", 0.45f, "Base fail chance of chance shrine. Vanilla is 0.45 = 45%");
		ChanceShrineFailureMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineFailureMult", 0.9f, "Fail chance multiplier for each consecutive chance shrine failure.");
		ChanceShrineHackedLockCfg = configFile.Bind<bool>("2i-Gameplay - Shrine", "chanceShrineHackedLock", true, "Lock consecutive failure count if price is zero.");
		ChanceShrineBypassDropTableCfg = configFile.Bind<bool>("2i-Gameplay - Shrine", "chanceShrineBypassDropTable", true, "Use custom item tier weights to roll items instead of the default drop table.");
		ChanceShrineLunarConversionCfg = configFile.Bind<bool>("2i-Gameplay - Shrine", "chanceShrineLunarConversion", true, "Allow Eulogy Zero to convert rewards to lunar when using custom weights.");
		ChanceShrineEquipmentCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineEquipment", 9f, "Base equipment drop weight from shrine reward. vanilla is 9");
		ChanceShrineEquipmentMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineEquipmentMult", 0.75f, "Equipment drop weight multiplier for each consecutive chance shrine failure.");
		ChanceShrineCommonCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineCommon", 36f, "Base common drop weight from shrine reward. vanilla is 36");
		ChanceShrineCommonMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineCommonMult", 0.75f, "Common drop weight multiplier for each consecutive chance shrine failure.");
		ChanceShrineUncommonCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineUncommon", 9f, "Base uncommon drop weight from shrine reward. vanilla is 9");
		ChanceShrineUncommonMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineUncommonMult", 1.5f, "Uncommon drop weight multiplier for each consecutive chance shrine failure.");
		ChanceShrineLegendaryCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineLegendary", 1f, "Base legendary drop weight from shrine reward. vanilla is 1");
		ChanceShrineLegendaryMultCfg = configFile.Bind<float>("2i-Gameplay - Shrine", "chanceShrineLegendaryMult", 2f, "Legendary drop weight multiplier for each consecutive chance shrine failure.");
	}

	internal static void Init()
	{
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Expected O, but got Unknown
		if (EnableModuleCfg.Value)
		{
			if (FixMeanderTeleporterCfg.Value)
			{
				PlaceTeleporterHook();
			}
			VoidRecoveryHook();
			if (DirectorStageLimitCfg.Value > 0)
			{
				DirectorMoneyHook();
			}
			if (MultitudeMoneyCfg.Value)
			{
				GoldFromKillHook();
			}
			MoonBatteryMissionController.onInstanceChangedGlobal += ChangeRequiredBatteries;
			VoidStageMissionController.Start += new hook_Start(ChangeRequiredDeepVoidCells);
			if (DroneTC280AnywhereCfg.Value || DroneEquipmentAnywhereCfg.Value)
			{
				SceneDirector.onGenerateInteractableCardSelection += AddMissingDroneSpawnCards;
			}
		}
	}

	internal static void LateInit()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		if (EnableModuleCfg.Value)
		{
			if (FixSelfDamageCfg.Value)
			{
				SelfDamageFlagHook();
				ItemCountOverrideHook();
				selfDamageItemIndexes.Add(Items.Crowbar.itemIndex);
				selfDamageItemIndexes.Add(Items.NearbyDamageBonus.itemIndex);
				selfDamageItemIndexes.Add(Items.FragileDamageBonus.itemIndex);
			}
			if (BazaarGestureCfg.Value && !Compat.DisableBazaarGesture)
			{
				BazaarGestureHook();
			}
			if (BazaarPreventKickoutCfg.Value && !Compat.DisableBazaarPreventKickout)
			{
				BazaarPreventKickoutHook();
			}
			if (RecolorLunarEquipmentCfg.Value == 2 || (RecolorLunarEquipmentCfg.Value == 1 && !Compat.WolfoQol))
			{
				RecolorLunarEquipment();
			}
			if (MoneyStageLimitCfg.Value > 0 && !Compat.DisableStarterMoney)
			{
				SceneDirector.onPostPopulateSceneServer += GiveMoney;
			}
			if (BloodShrineScaleCfg.Value > 0f && !Compat.DisableBloodShrineScale)
			{
				ModifyBloodShrineReward();
			}
			if (BossDropTweakCfg.Value && !Compat.DisableBossDropTweak)
			{
				BossRewardChanceHook();
			}
			if (UnlockInteractablesCfg.Value || Compat.UnlockInteractables)
			{
				UnlockInteractablesHook();
			}
			if (ModifyHoldoutValueCfg.Value || EclipseHoldoutLimitCfg.Value)
			{
				VoidCellHook();
				HoldoutZoneHook();
			}
			if (CommandDropletFixCfg.Value && !Compat.DisableCommandDropletFix)
			{
				CommandDropletFix();
			}
			if (CleanPickerOptionsCfg.Value)
			{
				CleanPickerOptionsHook();
			}
			if (TeleportLostDropletCfg.Value && !Compat.DisableTeleportLostDroplet)
			{
				PickupBackgroundCollision();
				PickupTeleportHook();
			}
			if (DroneFriendlyFireFixCfg.Value)
			{
				Debug.LogWarning((object)"ZetTweaks - Modifying Drone AI");
				ModifyDroneAI();
			}
			HandleDroneDeathHook();
			if (!Compat.DisableChanceShrine && ModifyChanceShrineCfg.Value)
			{
				ChanceShrineAwakeHook();
				ChanceShrineTimerHook();
				ChanceShrineDropHook();
				ChanceShrineColorHook();
			}
		}
	}

	private static void SelfDamageFlagHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__252_0;
		if (obj == null)
		{
			hook_TakeDamageProcess val = delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
			{
				isAttackingSelfFlag = false;
				if ((Object)(object)self != (Object)null && damageInfo != null)
				{
					GameObject attacker = damageInfo.attacker;
					if ((Object)(object)attacker != (Object)null)
					{
						CharacterBody component = attacker.GetComponent<CharacterBody>();
						if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)self.body)
						{
							isAttackingSelfFlag = true;
						}
					}
				}
				orig.Invoke(self, damageInfo);
				isAttackingSelfFlag = false;
			};
			<>c.<>9__252_0 = val;
			obj = (object)val;
		}
		HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj;
	}

	private static void ItemCountOverrideHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__253_0;
		if (obj == null)
		{
			hook_GetItemCountEffective_ItemIndex val = delegate(orig_GetItemCountEffective_ItemIndex orig, Inventory self, ItemIndex itemIndex)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Invalid comparison between Unknown and I4
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				int num = orig.Invoke(self, itemIndex);
				return (num <= 0 || !isAttackingSelfFlag || (int)itemIndex == -1 || !selfDamageItemIndexes.Contains(itemIndex)) ? num : 0;
			};
			<>c.<>9__253_0 = val;
			obj = (object)val;
		}
		Inventory.GetItemCountEffective_ItemIndex += (hook_GetItemCountEffective_ItemIndex)obj;
	}

	private static void PlaceTeleporterHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__254_0;
		if (obj == null)
		{
			hook_PlaceTeleporter val = delegate(orig_PlaceTeleporter orig, SceneDirector self)
			{
				if ((Object)(object)self.teleporterSpawnCard != (Object)null)
				{
					string text = ((Run.instance.NetworkstageClearCount >= 4) ? "iscLunarTeleporter" : "iscTeleporter");
					SpawnCard val2 = (SpawnCard)(object)LegacyResourcesAPI.Load<InteractableSpawnCard>("spawncards/interactablespawncard/" + text);
					if (Object.op_Implicit((Object)(object)val2))
					{
						self.teleporterSpawnCard = val2;
					}
					else
					{
						Debug.LogWarning((object)("ZetTweaks - interactablespawncard/" + text + " could not be found!"));
					}
				}
				orig.Invoke(self);
			};
			<>c.<>9__254_0 = val;
			obj = (object)val;
		}
		SceneDirector.PlaceTeleporter += (hook_PlaceTeleporter)obj;
	}

	private static void BazaarGestureHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__255_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items).GetField("AutoCastEquipment")),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
				}))
				{
					val2.Index += 2;
					val2.EmitDelegate<Func<int, int>>((Func<int, int>)((int count) => (!(SceneInfo.instance.sceneDef.nameToken == "MAP_BAZAAR_TITLE")) ? count : 0));
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - BazaarGestureHook Failed!");
				}
			};
			<>c.<>9__255_0 = val;
			obj = (object)val;
		}
		EquipmentSlot.MyFixedUpdate += (Manipulator)obj;
	}

	private static void BazaarPreventKickoutHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__256_0;
		if (obj == null)
		{
			hook_FixedUpdate val = delegate(orig_FixedUpdate orig, KickFromShop self)
			{
				((EntityState)self).outer.SetNextStateToMain();
			};
			<>c.<>9__256_0 = val;
			obj = (object)val;
		}
		KickFromShop.FixedUpdate += (hook_FixedUpdate)obj;
	}

	private static void VoidRecoveryHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__257_0;
		if (obj == null)
		{
			hook_BeginRound val = delegate(orig_BeginRound orig, ArenaMissionController self)
			{
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				if (NetworkServer.active)
				{
					float value = VoidHealthRecoveryCfg.Value;
					float value2 = VoidShieldRecoveryCfg.Value;
					if (value > 0f || value2 > 0f)
					{
						for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
						{
							CharacterBody body = CharacterMaster.readOnlyInstancesList[i].GetBody();
							if (Object.op_Implicit((Object)(object)body))
							{
								HealthComponent healthComponent = body.healthComponent;
								if (!Compat.DisableVoidHealthHeal && value > 0f)
								{
									healthComponent.Heal(healthComponent.fullHealth * value, default(ProcChainMask), true);
								}
								if (value2 > 0f)
								{
									healthComponent.RechargeShield(healthComponent.fullShield * value2);
								}
							}
						}
					}
				}
			};
			<>c.<>9__257_0 = val;
			obj = (object)val;
		}
		ArenaMissionController.BeginRound += (hook_BeginRound)obj;
	}

	private static void RecolorLunarEquipment()
	{
		//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_001e: Unknown result type (might be due to invalid IL or missing references)
		CreateLunarEquipmentPrefab();
		foreach (EquipmentIndex equipment in EquipmentCatalog.equipmentList)
		{
			EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipment);
			if (Object.op_Implicit((Object)(object)equipmentDef) && equipmentDef.isLunar && (!Compat.ZetAspects || !((Object)(object)equipmentDef == (Object)(object)Equipment.AffixLunar)))
			{
				ColorEquipmentDroplet(equipmentDef);
			}
		}
	}

	private static void CreateLunarEquipmentPrefab()
	{
		//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)
		LunarEquipmentDropletPrefab = ZetTweaksPlugin.ClonePrefab(LegacyResourcesAPI.Load<GameObject>("Prefabs/itempickups/LunarOrb"), "ZT_LunarEquipmentOrb");
		TrailRenderer componentInChildren = ((Component)LunarEquipmentDropletPrefab.transform).GetComponentInChildren<TrailRenderer>();
		componentInChildren.startColor = new Color(0.3f, 0.45f, 0.9f, 0f);
		componentInChildren.endColor = new Color(0.2f, 0.3f, 0.9f);
	}

	private static void ColorEquipmentDroplet(EquipmentDef equipDef)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: 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_004b: 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)
		if (Object.op_Implicit((Object)(object)equipDef))
		{
			PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(equipDef.equipmentIndex));
			if (Object.op_Implicit((Object)(object)LunarEquipmentDropletPrefab))
			{
				pickupDef.dropletDisplayPrefab = LunarEquipmentDropletPrefab;
			}
			pickupDef.baseColor = new Color(0.45f, 0.6f, 0.9f);
			pickupDef.darkColor = new Color(0.45f, 0.6f, 0.9f);
		}
	}

	private static void GiveMoney(SceneDirector director)
	{
		if (!Object.op_Implicit((Object)(object)Run.instance) || Run.instance.stageClearCount >= MoneyStageLimitCfg.Value)
		{
			return;
		}
		int difficultyScaledCost = Run.instance.GetDifficultyScaledCost(25);
		uint num = 1 + (uint)Mathf.Round((float)difficultyScaledCost * MoneyChestGivenCfg.Value);
		if (ShareSuiteCompat.Enabled && ShareSuiteCompat.moneyMethodFound)
		{
			ShareSuiteCompat.AddMoneyShareSuite((int)num);
			return;
		}
		foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
		{
			instance.master.GiveMoney(num, true);
		}
	}

	private static void DirectorMoneyHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__262_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, "RoR2.CombatDirector/DirectorMoneyWave", "multiplier")
				}))
				{
					val2.EmitDelegate<Func<float, float>>((Func<float, float>)delegate(float value)
					{
						Run instance = Run.instance;
						if (Object.op_Implicit((Object)(object)instance) && instance.stageClearCount < DirectorStageLimitCfg.Value)
						{
							value *= DirectorMoneyCfg.Value;
						}
						return value;
					});
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - DirectorMoneyHook Failed!");
				}
			};
			<>c.<>9__262_0 = val;
			obj = (object)val;
		}
		CombatDirector.Awake += (Manipulator)obj;
	}

	private static void GoldFromKillHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__263_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DeathRewards>(x, "get_goldReward")
				}))
				{
					val2.Index += 1;
					val2.Emit(OpCodes.Ldarg, 1);
					val2.EmitDelegate<Func<uint, DamageReport, uint>>((Func<uint, DamageReport, uint>)delegate(uint reward, DamageReport damageReport)
					{
						CharacterBody attackerBody = damageReport.attackerBody;
						if (reward != 0 && Object.op_Implicit((Object)(object)attackerBody))
						{
							int participatingPlayerCount = Run.instance.participatingPlayerCount;
							int count = PlayerCharacterMasterController.instances.Count;
							if (participatingPlayerCount != count)
							{
								int num = participatingPlayerCount / count;
								float num2 = Mathf.Max(1f, (float)num - 1f);
								int num3 = num + 2;
								int stageClearCount = Run.instance.stageClearCount;
								float num4 = 0.5f + 0.5f / num2 * Math.Min(num2, count - 1);
								num4 *= (float)Math.Max(0, num3 - stageClearCount) / (float)num3;
								uint num5 = (uint)((float)reward * (num2 * num4 + 1f));
								if (num5 > reward)
								{
									return num5;
								}
							}
						}
						return reward;
					});
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - GoldFromKillHook Failed!");
				}
			};
			<>c.<>9__263_0 = val;
			obj = (object)val;
		}
		DeathRewards.OnKilledServer += (Manipulator)obj;
	}

	private static void ModifyBloodShrineReward()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__264_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1)
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.EmitDelegate<Func<uint, ShrineBloodBehavior, uint>>((Func<uint, ShrineBloodBehavior, uint>)delegate(uint money, ShrineBloodBehavior shrine)
					{
						if (Object.op_Implicit((Object)(object)Run.instance))
						{
							uint num = (uint)((float)Run.instance.GetDifficultyScaledCost(25) * ((float)shrine.purchaseInteraction.cost / 100f) * BloodShrineScaleCfg.Value);
							if (num > money)
							{
								return num;
							}
						}
						return money;
					});
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - ModifyBloodShrineReward Failed!");
				}
			};
			<>c.<>9__264_0 = val;
			obj = (object)val;
		}
		ShrineBloodBehavior.AddShrineStack += (Manipulator)obj;
	}

	private static void BossRewardChanceHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__265_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchLdfld<BossGroup>(x, "bossDropChance")
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 8);
					val2.Emit(OpCodes.Ldloc, 2);
					val2.EmitDelegate<Func<float, BossGroup, int, int, float>>((Func<float, BossGroup, int, int, float>)delegate(float rng, BossGroup bossGroup, int i, int count)
					{
						if (bossGroup.forceTier3Reward)
						{
							return rng;
						}
						float num = ((float)i + 1f) / (float)count;
						int num2 = count - i;
						float num3 = 0f;
						if (num > 0.39f)
						{
							num3 = 0.05f;
						}
						if (num > 0.59f)
						{
							num3 = 0.1f;
						}
						if (num > 0.79f)
						{
							num3 = 0.2f;
						}
						if (num2 <= 4)
						{
							num3 = Mathf.Max(0.15f, num3);
						}
						if (num2 <= 2)
						{
							num3 = Mathf.Max(0.25f, num3);
						}
						Debug.LogWarning((object)("Drop Reward - " + i + " (" + (i + 1) + " of " + count + ") progress: " + num + " rng: " + rng + " chance: " + num3 + " - " + (rng <= num3)));
						return (rng <= num3) ? 0f : 1f;
					});
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - BossRewardChanceHook Failed!");
				}
			};
			<>c.<>9__265_0 = val;
			obj = (object)val;
		}
		BossGroup.DropRewards += (Manipulator)obj;
	}

	private static void UnlockInteractablesHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		//IL_003a: 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_0045: Expected O, but got Unknown
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Expected O, but got Unknown
		object obj = <>c.<>9__266_0;
		if (obj == null)
		{
			hook_OnEnable val = delegate
			{
			};
			<>c.<>9__266_0 = val;
			obj = (object)val;
		}
		OutsideInteractableLocker.OnEnable += (hook_OnEnable)obj;
		object obj2 = <>c.<>9__266_1;
		if (obj2 == null)
		{
			hook_OnDisable val2 = delegate
			{
			};
			<>c.<>9__266_1 = val2;
			obj2 = (object)val2;
		}
		OutsideInteractableLocker.OnDisable += (hook_OnDisable)obj2;
		object obj3 = <>c.<>9__266_2;
		if (obj3 == null)
		{
			hook_FixedUpdate val3 = delegate
			{
			};
			<>c.<>9__266_2 = val3;
			obj3 = (object)val3;
		}
		OutsideInteractableLocker.FixedUpdate += (hook_FixedUpdate)obj3;
	}

	private static void ChangeRequiredBatteries()
	{
		if (Object.op_Implicit((Object)(object)MoonBatteryMissionController.instance))
		{
			MoonBatteryMissionController.instance._numRequiredBatteries = Mathf.Clamp(MoonHoldoutZonesCfg.Value, 1, 4);
		}
	}

	private static void ChangeRequiredDeepVoidCells(orig_Start orig, VoidStageMissionController self)
	{
		if (Object.op_Implicit((Object)(object)self) && NetworkServer.active)
		{
			self.batteryCount = Mathf.Clamp(VoidBossHoldoutZonesCfg.Value, 1, 4);
		}
		orig.Invoke(self);
	}

	private static void VoidCellHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		//IL_003a: 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_0045: Expected O, but got Unknown
		object obj = <>c.<>9__270_0;
		if (obj == null)
		{
			hook_OnEnter val = delegate(orig_OnEnter orig, NullWardBaseState self)
			{
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Invalid comparison between Unknown and I4
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Invalid comparison between Unknown and I4
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				float num = (ModifyHoldoutValueCfg.Value ? VoidRadiusCfg.Value : NullWardBaseState.wardRadiusOn);
				if (Object.op_Implicit((Object)(object)Run.instance) && EclipseHoldoutLimitCfg.Value)
				{
					bool flag = (int)Run.instance.selectedDifficulty >= 4;
					if ((int)ZetTweaksPlugin.EclipseArtifact != -1 && RunArtifactManager.instance.IsArtifactEnabled(ZetTweaksPlugin.EclipseArtifact))
					{
						flag = true;
					}
					if (flag)
					{
						if (num <= 20f)
						{
							num *= 2f;
						}
						else if (num < 40f)
						{
							num = 40f;
						}
					}
				}
				NullWardBaseState.wardRadiusOn = num;
				orig.Invoke(self);
			};
			<>c.<>9__270_0 = val;
			obj = (object)val;
		}
		NullWardBaseState.OnEnter += (hook_OnEnter)obj;
		object obj2 = <>c.<>9__270_1;
		if (obj2 == null)
		{
			hook_OnExit val2 = delegate(orig_OnExit orig, Active self)
			{
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				HoldoutZoneController holdoutZoneController = self.holdoutZoneController;
				if (Object.op_Implicit((Object)(object)holdoutZoneController))
				{
					VoidCellExitRadius = holdoutZoneController.currentRadius;
					ChildLocator childLocator = ((NullWardBaseState)self).childLocator;
					if (Object.op_Implicit((Object)(object)childLocator))
					{
						Transform val3 = ((NullWardBaseState)self).childLocator.FindChild("CompleteEffect");
						if (Object.op_Implicit((Object)(object)val3))
						{
							float num = VoidCellExitRadius * 0.933f;
							val3.localScale = new Vector3(num, num, num);
						}
					}
				}
				orig.Invoke(self);
			};
			<>c.<>9__270_1 = val2;
			obj2 = (object)val2;
		}
		Active.OnExit += (hook_OnExit)obj2;
		Complete.OnEnter += new Manipulator(ReplaceWardRadius);
		Complete.FixedUpdate += new Manipulator(ReplaceWardRadius);
	}

	private static void ReplaceWardRadius(ILContext il)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		ILCursor val = new ILCursor(il);
		if (val.TryGotoNext(new Func<Instruction, bool>[1]
		{
			(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(NullWardBaseState).GetField("wardRadiusOn"))
		}))
		{
			val.Index += 1;
			val.Emit(OpCodes.Pop);
			val.EmitDelegate<Func<float>>((Func<float>)(() => Mathf.Max(10f, VoidCellExitRadius)));
		}
	}

	private static void HoldoutZoneHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__272_0;
		if (obj == null)
		{
			hook_Awake val = delegate(orig_Awake orig, HoldoutZoneController self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Invalid comparison between Unknown and I4
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Invalid comparison between Unknown and I4
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				if (ModifyHoldoutValueCfg.Value)
				{
					ModifyHoldoutValues(self);
				}
				if (EclipseHoldoutLimitCfg.Value)
				{
					bool flag = (int)Run.instance.selectedDifficulty >= 4;
					if ((int)ZetTweaksPlugin.EclipseArtifact != -1 && RunArtifactManager.instance.IsArtifactEnabled(ZetTweaksPlugin.EclipseArtifact))
					{
						flag = true;
					}
					if (flag)
					{
						if (self.baseRadius <= 20f)
						{
							self.baseRadius *= 2f;
						}
						else if (self.baseRadius < 40f)
						{
							self.baseRadius = 40f;
						}
					}
				}
				orig.Invoke(self);
			};
			<>c.<>9__272_0 = val;
			obj = (object)val;
		}
		HoldoutZoneController.Awake += (hook_Awake)obj;
	}

	private static void ModifyHoldoutValues(HoldoutZoneController self)
	{
		SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene();
		switch (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) ? sceneDefForCurrentScene.baseSceneName : "")
		{
		case "arena":
			if (self.baseRadius == 15f && self.baseChargeDuration == 60f)
			{
				self.baseRadius = VoidRadiusCfg.Value;
				self.baseChargeDuration = VoidTimeCfg.Value;
			}
			break;
		case "voidstage":
			if (self.baseRadius == 20f && self.baseChargeDuration == 60f)
			{
				self.baseRadius = VoidBossRadiusCfg.Value;
				self.baseChargeDuration = VoidBossTimeCfg.Value;
			}
			break;
		case "moon2":
			if (self.baseRadius == 40f && self.baseChargeDuration == 60f)
			{
				self.baseRadius = ShipRadiusCfg.Value;
				self.baseChargeDuration = ShipTimeCfg.Value;
			}
			else if (self.baseRadius == 20f && self.baseChargeDuration == 60f)
			{
				self.baseRadius = MassRadiusCfg.Value;
				self.baseChargeDuration = MassTimeCfg.Value;
			}
			break;
		default:
			if (self.baseRadius == 60f && self.baseChargeDuration == 90f && !Compat.ReallyBigTeleporter)
			{
				self.baseRadius = TeleRadiusCfg.Value;
				self.baseChargeDuration = TeleTimeCfg.Value;
			}
			break;
		}
	}

	private static void CommandDropletFix()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__274_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				ILCursor val2 = new ILCursor(il);
				MethodInfo methodInfo = typeof(PickupCatalog).GetMethod("GetPickupDef");
				int num = default(int);
				if (val2.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)methodInfo),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num)
				}))
				{
					val2.Index += 3;
					val2.EmitDelegate<Func<PickupDef, PickupDef>>((Func<PickupDef, PickupDef>)delegate(PickupDef pickupDef)
					{
						//IL_001e: Unknown result type (might be due to invalid IL or missing references)
						//IL_0024: Invalid comparison between Unknown and I4
						//IL_0071: Unknown result type (might be due to invalid IL or missing references)
						//IL_0077: Invalid comparison between Unknown and I4
						//IL_0053: Unknown result type (might be due to invalid IL or missing references)
						//IL_003a: Unknown result type (might be due to invalid IL or missing references)
						//IL_00a8: 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)
						if (Compat.ZetAspects && !AspectsResolved)
						{
							ResolveAspects();
						}
						if ((int)pickupDef.itemIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupItems || !aspectItemIndexes.Contains(pickupDef.itemIndex)))
						{
							ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
							if (itemDef.ContainsTag((ItemTag)9))
							{
								return (PickupDef)null;
							}
						}
						if ((int)pickupDef.equipmentIndex != -1 && (!Compat.ZetAspects || !AspectCommandGroupEquip || !aspectEquipIndexes.Contains(pickupDef.equipmentIndex)))
						{
							EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
							if (!equipmentDef.canDrop)
							{
								return (PickupDef)null;
							}
						}
						return pickupDef;
					});
				}
				else
				{
					Debug.LogWarning((object)"ZetTweaks - CommandDropletFix Failed!");
				}
			};
			<>c.<>9__274_0 = val;
			obj = (object)val;
		}
		PickupDropletController.CreatePickup += (Manipulator)obj;
	}

	private static void ResolveAspects()
	{
		BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
		BaseUnityPlugin instance = Chainloader.PluginInfos["com.TPDespair.ZetAspects"].Instance;
		Assembly assembly = Assembly.GetAssembly(((object)instance).GetType());
		Type type = Type.GetType("TPDespair.ZetAspects.Configuration, " + assembly.FullName, throwOnError: false);
		if (type != null)
		{
			MethodInfo method = type.GetMethod("get_AspectCommandGroupItems", bindingAttr);
			if (method != null)
			{
				try
				{
					ConfigEntry<bool> val = (ConfigEntry<bool>)method.Invoke(null, null);
					AspectCommandGroupItems = val.Value;
				}
				catch (Exception ex)
				{
					Debug.LogError((object)ex);
				}
			}
			else
			{
				Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] - Could Not Find Method : Configuration.get_AspectCommandGroupItems");
			}
			method = type.GetMethod("get_AspectCommandGroupEquip", bindingAttr);
			if (method != null)
			{
				try
				{
					ConfigEntry<bool> val2 = (ConfigEntry<bool>)method.Invoke(null, null);
					AspectCommandGroupEquip = val2.Value;
				}
				catch (Exception ex2)
				{
					Debug.LogError((object)ex2);
				}
			}
			else
			{
				Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] - Could Not Find Method : Configuration.get_AspectCommandGroupEquip");
			}
		}
		else
		{
			Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] Could Not Find Type : TPDespair.ZetAspects.Configuration");
		}
		if (AspectCommandGroupItems || AspectCommandGroupEquip)
		{
			type = Type.GetType("TPDespair.ZetAspects.Catalog, " + assembly.FullName, throwOnError: false);
			if (type != null)
			{
				if (AspectCommandGroupItems)
				{
					FieldInfo field = type.GetField("aspectItemIndexes", bindingAttr);
					if (field != null)
					{
						try
						{
							aspectItemIndexes = (List<ItemIndex>)field.GetValue(null);
						}
						catch (Exception ex3)
						{
							Debug.LogError((object)ex3);
						}
					}
					else
					{
						Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] - Could Not Find Field : Catalog.aspectItemIndexes");
					}
				}
				if (AspectCommandGroupEquip)
				{
					FieldInfo field2 = type.GetField("aspectEquipIndexes", bindingAttr);
					if (field2 != null)
					{
						try
						{
							aspectEquipIndexes = (List<EquipmentIndex>)field2.GetValue(null);
						}
						catch (Exception ex4)
						{
							Debug.LogError((object)ex4);
						}
					}
					else
					{
						Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] - Could Not Find Field : Catalog.aspectEquipIndexes");
					}
				}
			}
			else
			{
				Debug.LogWarning((object)"[ZetTweaks - ResolveAspects] Could Not Find Type : TPDespair.ZetAspects.Catalog");
			}
		}
		AspectsResolved = true;
	}

	private static void CleanPickerOptionsHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__276_0;
		if (obj == null)
		{
			hook_GetOptionsFromPickupState val = delegate(orig_GetOptionsFromPickupState orig, UniquePickup pickupState)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				Option[] options = orig.Invoke(pickupState);
				return CleanupOptions(options);
			};
			<>c.<>9__276_0 = val;
			obj = (object)val;
		}
		PickupPickerController.GetOptionsFromPickupState += (hook_GetOptionsFromPickupState)obj;
	}

	private static Option[] CleanupOptions(Option[] options)
	{
		//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_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: 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: Invalid comparison between Unknown and I4
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Invalid comparison between Unknown and I4
		//IL_0041: 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_0055: Invalid comparison between Unknown and I4
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		List<Option> list = new List<Option>();
		for (int i = 0; i < options.Length; i++)
		{
			bool flag = true;
			Option val = options[i];
			PickupDef pickupDef = PickupCatalog.GetPickupDef(val.pickup.pickupIndex);
			if ((int)pickupDef.itemIndex != -1)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex);
				if ((int)itemDef.tier == 5 && itemDef.ContainsTag((ItemTag)9))
				{
					flag = false;
				}
			}
			else if ((int)pickupDef.equipmentIndex != -1)
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex);
				if (!equipmentDef.canDrop && !equipmentDef.appearsInSinglePlayer && !equipmentDef.appearsInMultiPlayer)
				{
					flag = false;
				}
			}
			if (flag)
			{
				list.Add(val);
			}
		}
		return list.ToArray();
	}

	private static void PickupBackgroundCollision()
	{
		Physics.IgnoreLayerCollision(15, 13, false);
	}

	private static void PickupTeleportHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__279_0;
		if (obj == null)
		{
			hook_TryZoneStart val = delegate(orig_TryZoneStart orig, MapZone self, Collider collider)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: 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_0050: 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_0062: Expected O, but got Unknown
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Expected O, but got Unknown
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				if ((int)self.zoneType == 0 && ColliderPickup(collider))
				{
					SpawnCard val2 = ScriptableObject.CreateInstance<SpawnCard>();
					val2.hullSize = (HullClassification)0;
					val2.nodeGraphType = (GraphType)0;
					val2.prefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab");
					DirectorPlacementRule val3 = new DirectorPlacementRule
					{
						placementMode = (PlacementMode)3,
						position = ((Component)collider).transform.position
					};
					GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng));
					if (Object.op_Implicit((Object)(object)val4))
					{
						Debug.Log((object)"tp item back");
						TeleportHelper.TeleportGameObject(((Component)collider).gameObject, val4.transform.position);
						Object.Destroy((Object)(object)val4);
					}
					Object.Destroy((Object)(object)val2);
				}
				orig.Invoke(self, collider);
			};
			<>c.<>9__279_0 = val;
			obj = (object)val;
		}
		MapZone.TryZoneStart += (hook_TryZoneStart)obj;
	}

	private static bool ColliderPickup(Collider collider)
	{
		if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<PickupDropletController>()))
		{
			return true;
		}
		if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<GenericPickupController>()))
		{
			return true;
		}
		if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<PickupPickerController>()))
		{
			return true;
		}
		return false;
	}

	private static void AddMissingDroneSpawnCards(SceneDirector sceneDirector, DirectorCardCategorySelection dccs)
	{
		//IL_001a: 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_0021: 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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: 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_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Expected O, but got Unknown
		//IL_005a: 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)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Expected O, but got Unknown
		int num = -1;
		bool flag = false;
		bool flag2 = false;
		bool flag3 = false;
		for (int i = 0; i < dccs.categories.Length; i++)
		{
			Category val = dccs.categories[i];
			if (val.name != null && val.name == "Drones")
			{
				num = i;
			}
			for (int num2 = val.cards.Length - 1; num2 >= 0; num2--)
			{
				DirectorCard val2 = val.cards[num2];
				string text = "";
				if ((Object)(object)val2.spawnCard != (Object)null)
				{
					string name = ((Object)val2.spawnCard).name;
					if (name != null)
					{
						text = name;
					}
				}
				if (!flag)
				{
					if (text == "iscBrokenDrone1")
					{
						flag = true;
					}
					if (text == "iscBrokenDrone2")
					{
						flag = true;
					}
				}
				if (text == "iscBrokenMegaDrone")
				{
					flag2 = true;
				}
				if (text == "iscBrokenEquipmentDrone")
				{
					flag3 = true;
				}
			}
		}
		if (num != -1 && flag)
		{
			if (DroneTC280AnywhereCfg.Value && !flag2 && (Object)(object)MegaDroneSpawnCard != (Object)null)
			{
				DirectorCard val3 = new DirectorCard
				{
					spawnCard = MegaDroneSpawnCard,
					selectionWeight = 1,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = false,
					minimumStageCompletions = 1
				};
				Debug.LogWarning((object)"Adding iscBrokenMegaDrone DirectorCard into Deck.");
				dccs.AddCard(num, val3);
			}
			if (DroneEquipmentAnywhereCfg.Value && !flag3 && (Object)(object)EquipDroneSpawnCard != (Object)null)
			{
				DirectorCard val4 = new DirectorCard
				{
					spawnCard = EquipDroneSpawnCard,
					selectionWeight = 2,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = false,
					minimumStageCompletions = 0
				};
				Debug.LogWarning((object)"Adding iscBrokenEquipmentDrone DirectorCard into Deck.");
				dccs.AddCard(num, val4);
			}
		}
	}

	private static void ModifyDroneAI()
	{
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		foreach (CharacterMaster allAiMaster in MasterCatalog.allAiMasters)
		{
			BaseAI[] components = ((Component)allAiMaster).GetComponents<BaseAI>();
			if (components != null && components.Length != 0)
			{
				BaseAI[] array = components;
				foreach (BaseAI val in array)
				{
					val.neverRetaliateFriendlies = true;
				}
			}
			AISkillDriver[] components2 = ((Component)allAiMaster).GetComponents<AISkillDriver>();
			if (components2 != null && components2.Length != 0)
			{
				AISkillDriver[] array2 = components2;
				foreach (AISkillDriver val2 in array2)
				{
					val2.aimType = (AimType)2;
				}
			}
		}
	}

	public static void DontRetaliate(BaseAI[] baseAIs)
	{
		foreach (BaseAI val in baseAIs)
		{
			val.neverRetaliateFriendlies = true;
		}
	}

	private static void HandleDroneDeathHook()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__284_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0011: 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)
				ILCursor val2 = new ILCursor(il);
				val2.Index = 0;
				val2.Emit(OpCodes.Ldarg, 1);
				val2.Emit(OpCodes.Ldarg, 0);
				val2.EmitDelegate<Action<CharacterBody, CharacterMaster>>((Action<CharacterBody, CharacterMaster>)delegate(CharacterBody body, CharacterMaster master)
				{
					OnDroneBodyDeath(master, body);
				});
			};
			<>c.<>9__284_0 = val;
			obj = (object)val;
		}
		CharacterMaster.OnBodyDeath += (Manipulator)obj;
	}

	private static void OnDroneBodyDeath(CharacterMaster master, CharacterBody body)
	{
		//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_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: 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_00bd: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Invalid comparison between Unknown and I4
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active || !Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)body) || !master.IsDeadAndOutOfLivesServer())
		{
			return;
		}
		BodyIndex bodyIndex = body.bodyIndex;
		if ((int)bodyIndex == -1)
		{
			return;
		}
		if (bodyIndex == ZetTweaksPlugin.turret1BodyIndex && DroneTurretRepurchasableCfg.Value && (Object)(object)Turret1SpawnCard != (Object)null)
		{
			SpawnDrone(Turret1SpawnCard, body);
		}
		if (bodyIndex == ZetTweaksPlugin.megaDroneBodyIndex && DroneTC280RepurchasableCfg.Value && (Object)(object)MegaDroneSpawnCard != (Object)null)
		{
			SpawnDrone(MegaDroneSpawnCard, body);
		}
		if (bodyIndex == ZetTweaksPlugin.equipDroneBodyIndex && Util.CheckRoll(DroneEquipmentDropCfg.Value * 100f, 0f, (CharacterMaster)null))
		{
			EquipmentIndex currentEquipmentIndex = master.inventory.currentEquipmentIndex;
			if ((int)currentEquipmentIndex != -1)
			{
				PickupIndex val = PickupCatalog.FindPickupIndex(currentEquipmentIndex);
				CreatePickupInfo val2 = new CreatePickupInfo
				{
					position = body.corePosition,
					rotation = Quaternion.identity
				};
				((CreatePickupInfo)(ref val2)).pickup = new UniquePickup(val);
				CreatePickupInfo val3 = val2;
				GenericPickupController.CreatePickup(ref val3);
				master.inventory.SetEquipmentIndex((EquipmentIndex)(-1), true);
			}
		}
	}

	private static void SpawnDrone(SpawnCard spawnCard, CharacterBody body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_000f: Unknown result type (might be due to invalid IL or missing refere