Decompiled source of GoldenCoastPlus v1.3.0

GoldenCoastPlusRevived.dll

Decompiled a day ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates.GolemMonster;
using EntityStates.Missions.Goldshores;
using EntityStates.TitanMonster;
using GoldenCoastPlusRevived.Buffs;
using GoldenCoastPlusRevived.Items;
using GoldenCoastPlusRevived.Modules;
using HG;
using HarmonyLib;
using IL.EntityStates.Missions.Goldshores;
using Microsoft.CodeAnalysis;
using MiscFixes.Modules;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Missions.Goldshores;
using On.EntityStates.TitanMonster;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Projectile;
using RoR2BepInExPack.GameAssetPaths;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace GoldenCoastPlusRevived
{
	[BepInPlugin("com.TechDebtCollector.GoldenCoastPlus", "GoldenCoastPlus", "1.3.0")]
	public class GoldenCoastPlusPlugin : BaseUnityPlugin
	{
		public const string MOD_AUTHOR = "TechDebtCollector";

		public const string MOD_NAME = "GoldenCoastPlus";

		public const string MOD_GUID = "com.TechDebtCollector.GoldenCoastPlus";

		public const string MOD_VERSON = "1.3.0";

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			PluginConfig.Init(((BaseUnityPlugin)this).Config);
			GCPAssets.RegisterAssets();
			new BigSword();
			new GoldenKnurl();
			new LaserEye();
			new LaserEyeCharge();
			new LaserEyeReady();
			new TitanGoldArmorBroken();
			new HiddenGoldItem();
			new HiddenGoldBuff();
			FightChanges.Init();
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

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

		internal static void PatchFail(string method)
		{
			_logSource.LogWarning((object)("Failed to patch " + method));
		}

		internal static void PatchFail(ILContext il)
		{
			PatchFail(((MemberReference)il.Method).Name);
		}
	}
	public static class PluginConfig
	{
		private static ConfigFile _backupConfig;

		private static bool _versionChanged;

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

		public static ConfigEntry<string> LatestVersion { get; set; }

		internal static void Init(ConfigFile cfg)
		{
			BindConfig(cfg, "1. Main");
			BindFightChanges(cfg, "2. Aurelionite Fight Changes");
			BindTitanicGreatsword(cfg, "3. Titanic Greatsword");
			BindGoldenKnurl(cfg, "4. Golden Knurl");
			BindGuardiansEye(cfg, "5. Guardians Eye");
			ValidateConfig(cfg);
		}

		private static void BindConfig(ConfigFile cfg, string section)
		{
			AutoConfig = Extensions.BindOption<bool>(cfg, section, "Enable Auto Config Sync", "Disabling this would stop GCP from syncing config whenever a new version is found.", true, (ConfigFlags)1);
			bool flag = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(cfg, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version");
			LatestVersion = Extensions.BindOption<string>(cfg, section, "Latest Version", "DO NOT CHANGE THIS", "1.3.0", (ConfigFlags)0);
			if (AutoConfig.Value && (flag || LatestVersion.Value != "1.3.0"))
			{
				LatestVersion.Value = "1.3.0";
				_versionChanged = true;
				Log.Info("Config Autosync Enabled.");
			}
		}

		private static void BindFightChanges(ConfigFile cfg, string section)
		{
			FightChanges.EnableFightChanges = Extensions.BindOption<bool>(cfg, section, "Enable Fight Changes", "Should the changes to Aurelionite's fight be enabled?", true, (ConfigFlags)1);
			FightChanges.BossHealthMult = Extensions.BindOptionSlider<float>(cfg, section, "Boss Aurelionites health per level multiplier", "Adjust the multiplier on the bosses health per level.", 1f, 0.1f, 5f, (ConfigFlags)1);
			FightChanges.UseAdaptiveArmor = Extensions.BindOption<bool>(cfg, section, "Boss Adaptive Armor", "Should the boss Aurelionite have adaptive armor?", true, (ConfigFlags)1);
			TitanGoldArmorBroken.BossArmorBrokenMult = Extensions.BindOptionSlider<float>(cfg, section, "Initial Damage taken multiplier debuff", "Adjust the boss's damage taken multiplier, for a short window after each invulnerability phase ends", 1.5f, 0.1f, 3f, (ConfigFlags)4);
			HiddenGoldItem.AurelioniteBlessingGoldGain = Extensions.BindOptionSlider<float>(cfg, section, "Aurelionites Blessing gold gain multiplier", "Adjust the percent additional gold gain.", 25f, 0f, 100f, (ConfigFlags)4);
		}

		private static void BindTitanicGreatsword(ConfigFile cfg, string section)
		{
			BigSword.EnableSword = Extensions.BindOption<bool>(cfg, section, "Enable Titanic Greatsword", "Should Titanic Greatsword be enabled?", true, (ConfigFlags)1);
			BigSword.SwordDamage = Extensions.BindOptionSlider<float>(cfg, section, "Titanic Greatsword Damage", "Adjust the TOTAL damage coefficient of Titanic Greatsword", 8f, 1f, 25f, (ConfigFlags)4);
			BigSword.SwordChance = Extensions.BindOptionSlider<float>(cfg, section, "Titanic Greatsword Chance", "Adjust Titanic Greatsword's chance to proc, as a percentage.", 5f, 1f, 100f, (ConfigFlags)4);
			BigSword.SwordProcCoeff = Extensions.BindOptionSlider<float>(cfg, section, "Titanic Greatsword Proc Coeff", "Adjust Titanic Greatsword's proc coefficient.", 1f, 0f, 3f, (ConfigFlags)4);
		}

		private static void BindGoldenKnurl(ConfigFile cfg, string section)
		{
			GoldenKnurl.EnableKnurl = Extensions.BindOption<bool>(cfg, section, "Enable Golden Knurl", "Should Golden Knurl be enabled?", true, (ConfigFlags)1);
			GoldenKnurl.KnurlLevelHealth = Extensions.BindOptionSlider<float>(cfg, section, "Golden Knurl Health", "Adjust how much health per level Golden Knurl grants.", 33f, 0f, 100f, (ConfigFlags)0);
			GoldenKnurl.KnurlLevelRegen = Extensions.BindOptionSlider<float>(cfg, section, "Golden Knurl Regen", "Adjust how much regen per level Golden Knurl grants.", 3f, 0f, 10f, (ConfigFlags)0);
			GoldenKnurl.KnurlLevelArmor = Extensions.BindOptionSlider<float>(cfg, section, "Golden Knurl Armor", "Adjust how much armor per level Golden Knurl grants.", 3f, 0f, 10f, (ConfigFlags)0);
		}

		private static void BindGuardiansEye(ConfigFile cfg, string section)
		{
			LaserEye.EnableEye = Extensions.BindOption<bool>(cfg, section, "Enable Guardians Eye", "Should Guardian's Eye be enabled?", true, (ConfigFlags)1);
			LaserEye.EyeDamage = Extensions.BindOptionSlider<float>(cfg, section, "Guardians Eye Damage", "Adjust the BASE damage coefficient of Guardian's Eye blast, per target.", 6f, 1f, 20f, (ConfigFlags)4);
			LaserEye.EyeTargetsPerStack = Extensions.BindOptionSlider<int>(cfg, section, "Guardians Eye Max Targets", "Adjust the max targets per stack the Guardian's Eye will hit.", 2, 1, 10, (ConfigFlags)4);
			LaserEye.EyeBlastProcCoeff = Extensions.BindOptionSlider<float>(cfg, section, "Guardians Eye Blast Proc Coeff", "Adjust the proc coefficient of Guardian's Eye blast.", 1f, 0f, 3f, (ConfigFlags)4);
			LaserEye.EyeMaxRange = Extensions.BindOptionSlider<float>(cfg, section, "Guardians Eye Range", "Adjust the targeting range of Guardian's Eye.", 30f, 1f, 100f, (ConfigFlags)4);
			LaserEye.EyeStacksMultiplier = Extensions.BindOptionSlider<float>(cfg, section, "Guardians Eye Stacks Required", "Adjust how much gold income is required for Guardian's Eye to trigger, as a multiple of the cost of a small chest.", 1f, 0.1f, 5f, (ConfigFlags)4);
		}

		private static void ValidateConfig(ConfigFile cfg)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			_backupConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.TechDebtCollector.GoldenCoastPlus.Backup.cfg"), true);
			_backupConfig.Bind<string>(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :");
			foreach (ConfigDefinition key in cfg.Keys)
			{
				ConfigEntryBase val = cfg[key];
				ConfigEntryBase val2 = BindBackup(cfg, val);
				if (!ConfigEqual(val2.DefaultValue, val2.BoxedValue))
				{
					Log.Debug("Config Updated: " + val.Definition.Section + " : " + val.Definition.Key + " from " + val.BoxedValue?.ToString() + " to " + val.DefaultValue);
					if (_versionChanged)
					{
						Log.Debug("Autosyncing...");
						val.BoxedValue = val.DefaultValue;
						val2.BoxedValue = val2.DefaultValue;
					}
				}
			}
			Extensions.WipeConfig(cfg);
			Extensions.WipeConfig(_backupConfig);
		}

		private static ConfigEntryBase BindBackup(ConfigFile cfg, ConfigEntryBase entry)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			ConfigDefinition val = new ConfigDefinition(Regex.Replace(cfg.ConfigFilePath, "\\W", "") + " : " + entry.Definition.Section, entry.Definition.Key);
			ConfigDescription val2 = new ConfigDescription(entry.Description.Description, entry.Description.AcceptableValues, Array.Empty<object>());
			if (entry.SettingType == typeof(string))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<string>(val, (string)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(bool))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<bool>(val, (bool)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(sbyte))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<sbyte>(val, (sbyte)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(byte))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<byte>(val, (byte)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(short))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<short>(val, (short)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(ushort))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<ushort>(val, (ushort)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(int))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<int>(val, (int)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(uint))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<uint>(val, (uint)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(long))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<long>(val, (long)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(ulong))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<ulong>(val, (ulong)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(float))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<float>(val, (float)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(double))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<double>(val, (double)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(decimal))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<decimal>(val, (decimal)entry.DefaultValue, val2);
			}
			if (entry.SettingType == typeof(Enum))
			{
				return (ConfigEntryBase)(object)_backupConfig.Bind<Enum>(val, entry.DefaultValue as Enum, val2);
			}
			throw new InvalidOperationException("Cannot convert to type " + entry.SettingType.Name);
		}

		private static bool ConfigEqual(object a, object b)
		{
			if (a != null && a.Equals(b))
			{
				return true;
			}
			if (float.TryParse(a?.ToString(), out var result) && float.TryParse(b?.ToString(), out var result2))
			{
				return (double)Mathf.Abs(result - result2) < 0.0001;
			}
			return false;
		}
	}
}
namespace GoldenCoastPlusRevived.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("GoldenCoastPlusRevived.Properties.Resources", typeof(Resources).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal Resources()
		{
		}
	}
}
namespace GoldenCoastPlusRevived.Modules
{
	internal static class FightChanges
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_SpawnBeacons <0>__GoldshoresMissionController_SpawnBeacons;

			public static hook_OnEnter <1>__GoldshoresBossfight_OnEnter;

			public static hook_OnExit <2>__GoldshoresBossfight_OnExit;

			public static hook_SetBossImmunity <3>__GoldshoresBossfight_SetBossImmunity;

			public static hook_SpawnBoss <4>__GoldshoresBossfight_SpawnBoss;

			public static Manipulator <5>__GoldshoresBossfight_ServerFixedUpdate;

			public static hook_PlacePredictedAttack <6>__FireGoldFist_PlacePredictedAttack;

			public static Action<GoldshoresBossfight> <7>__GoldshoresBossfight_GiveBuff;

			public static Func<bool, GoldshoresBossfight, bool> <8>__GoldshoresBossfight_ControlVulnerability;
		}

		private static float origMinDuration;

		private static float origMaxDuration;

		private static int origFistCount;

		private static float origProjectileFrequency;

		private static bool hasBuffed1;

		private static bool hasBuffed2;

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

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

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

		internal static void Init()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			if (EnableFightChanges.Value)
			{
				ModifyAssets();
				object obj = <>O.<0>__GoldshoresMissionController_SpawnBeacons;
				if (obj == null)
				{
					hook_SpawnBeacons val = GoldshoresMissionController_SpawnBeacons;
					<>O.<0>__GoldshoresMissionController_SpawnBeacons = val;
					obj = (object)val;
				}
				GoldshoresMissionController.SpawnBeacons += (hook_SpawnBeacons)obj;
				object obj2 = <>O.<1>__GoldshoresBossfight_OnEnter;
				if (obj2 == null)
				{
					hook_OnEnter val2 = GoldshoresBossfight_OnEnter;
					<>O.<1>__GoldshoresBossfight_OnEnter = val2;
					obj2 = (object)val2;
				}
				GoldshoresBossfight.OnEnter += (hook_OnEnter)obj2;
				object obj3 = <>O.<2>__GoldshoresBossfight_OnExit;
				if (obj3 == null)
				{
					hook_OnExit val3 = GoldshoresBossfight_OnExit;
					<>O.<2>__GoldshoresBossfight_OnExit = val3;
					obj3 = (object)val3;
				}
				GoldshoresBossfight.OnExit += (hook_OnExit)obj3;
				object obj4 = <>O.<3>__GoldshoresBossfight_SetBossImmunity;
				if (obj4 == null)
				{
					hook_SetBossImmunity val4 = GoldshoresBossfight_SetBossImmunity;
					<>O.<3>__GoldshoresBossfight_SetBossImmunity = val4;
					obj4 = (object)val4;
				}
				GoldshoresBossfight.SetBossImmunity += (hook_SetBossImmunity)obj4;
				object obj5 = <>O.<4>__GoldshoresBossfight_SpawnBoss;
				if (obj5 == null)
				{
					hook_SpawnBoss val5 = GoldshoresBossfight_SpawnBoss;
					<>O.<4>__GoldshoresBossfight_SpawnBoss = val5;
					obj5 = (object)val5;
				}
				GoldshoresBossfight.SpawnBoss += (hook_SpawnBoss)obj5;
				object obj6 = <>O.<5>__GoldshoresBossfight_ServerFixedUpdate;
				if (obj6 == null)
				{
					Manipulator val6 = GoldshoresBossfight_ServerFixedUpdate;
					<>O.<5>__GoldshoresBossfight_ServerFixedUpdate = val6;
					obj6 = (object)val6;
				}
				GoldshoresBossfight.ServerFixedUpdate += (Manipulator)obj6;
				object obj7 = <>O.<6>__FireGoldFist_PlacePredictedAttack;
				if (obj7 == null)
				{
					hook_PlacePredictedAttack val7 = FireGoldFist_PlacePredictedAttack;
					<>O.<6>__FireGoldFist_PlacePredictedAttack = val7;
					obj7 = (object)val7;
				}
				FireGoldFist.PlacePredictedAttack += (hook_PlacePredictedAttack)obj7;
			}
		}

		private static void GoldshoresMissionController_SpawnBeacons(orig_SpawnBeacons orig, GoldshoresMissionController self)
		{
			self.beaconsToSpawnOnMap = 4;
			orig.Invoke(self);
		}

		private static void ModifyAssets()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldBody_prefab);
			val.Completed += delegate(AsyncOperationHandle<GameObject> task)
			{
				CharacterBody component = task.Result.GetComponent<CharacterBody>();
				component.levelMaxHealth *= BossHealthMult.Value;
			};
		}

		private static void GoldshoresBossfight_SpawnBoss(orig_SpawnBoss orig, GoldshoresBossfight self)
		{
			orig.Invoke(self);
			hasBuffed1 = false;
			hasBuffed2 = false;
			if (!Object.op_Implicit((Object)(object)self.scriptedCombatEncounter))
			{
				return;
			}
			foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
			{
				CharacterBody body = readOnlyMembers.GetBody();
				if (Object.op_Implicit((Object)(object)body))
				{
					body.AddTimedBuff(Buffs.HiddenInvincibility, 2f);
				}
			}
		}

		private static void GoldshoresBossfight_OnExit(orig_OnExit orig, GoldshoresBossfight self)
		{
			FireGoldFist.fistCount = origFistCount;
			FireGoldMegaLaser.projectileFireFrequency = origProjectileFrequency;
			FireMegaLaser.minimumDuration = origMinDuration;
			FireMegaLaser.maximumDuration = origMaxDuration;
			orig.Invoke(self);
		}

		private static void GoldshoresBossfight_OnEnter(orig_OnEnter orig, GoldshoresBossfight self)
		{
			origFistCount = FireGoldFist.fistCount;
			FireGoldFist.fistCount = 6;
			origProjectileFrequency = FireGoldMegaLaser.projectileFireFrequency;
			FireGoldMegaLaser.projectileFireFrequency = 8f;
			origMinDuration = FireMegaLaser.minimumDuration;
			FireMegaLaser.minimumDuration = 1.5f;
			origMaxDuration = FireMegaLaser.maximumDuration;
			FireMegaLaser.maximumDuration = 2f;
			GoldshoresBossfight.shieldRemovalDuration = 2.1474836E+09f;
			orig.Invoke(self);
		}

		private static void GoldshoresBossfight_SetBossImmunity(orig_SetBossImmunity orig, GoldshoresBossfight self, bool newBossImmunity)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			bool bossImmunity = self.bossImmunity;
			orig.Invoke(self, newBossImmunity);
			if (!Object.op_Implicit((Object)(object)self.scriptedCombatEncounter) || newBossImmunity || newBossImmunity == bossImmunity)
			{
				return;
			}
			foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
			{
				CharacterBody body = readOnlyMembers.GetBody();
				if (Object.op_Implicit((Object)(object)body))
				{
					body.AddTimedBuff(BuffBase<TitanGoldArmorBroken>.BuffIndex, 10f);
				}
			}
		}

		private static void GoldshoresBossfight_ServerFixedUpdate(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityStateMachine>(x, "SetNextState")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<GoldshoresBossfight>>((Action<GoldshoresBossfight>)GoldshoresBossfight_GiveBuff);
			}
			else
			{
				Log.Error("Patch failed for GoldshoresBossfight_ServerFixedUpdate #1");
			}
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(FixedTimeStamp), "hasPassed"))
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<bool, GoldshoresBossfight, bool>>((Func<bool, GoldshoresBossfight, bool>)GoldshoresBossfight_ControlVulnerability);
			}
			else
			{
				Log.Error("Patch failed for GoldshoresBossfight_ServerFixedUpdate #2");
			}
		}

		private static void GoldshoresBossfight_GiveBuff(GoldshoresBossfight self)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory))
				{
					instance.master.inventory.GiveItem(ItemBase<HiddenGoldItem>.ItemIndex, 1);
				}
			}
			Chat.AddMessage("<style=cShrine>The Guardian blesses you...</style>");
		}

		private static bool GoldshoresBossfight_ControlVulnerability(bool hasPassed, GoldshoresBossfight self)
		{
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)self.scriptedCombatEncounter))
			{
				return true;
			}
			CharacterMaster val = self.scriptedCombatEncounter.combatSquad.readOnlyMembersList.FirstOrDefault();
			CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetBody() : null);
			if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.healthComponent))
			{
				return true;
			}
			float combinedHealthFraction = val2.healthComponent.combinedHealthFraction;
			if (combinedHealthFraction <= 1f / 3f)
			{
				if (!hasBuffed2)
				{
					hasBuffed2 = true;
					foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
					{
						CharacterBody body = readOnlyMembers.GetBody();
						if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)readOnlyMembers.inventory))
						{
							GiveAffix(body, readOnlyMembers.inventory, Elites.Aurelionite);
						}
					}
					FireGoldFist.fistCount = 998;
					return true;
				}
			}
			else if (combinedHealthFraction <= 2f / 3f && !hasBuffed1)
			{
				hasBuffed1 = true;
				foreach (CharacterMaster readOnlyMembers2 in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
				{
					if (Object.op_Implicit((Object)(object)readOnlyMembers2.inventory))
					{
						readOnlyMembers2.inventory.GiveItem(Items.AlienHead.itemIndex, 1);
					}
				}
				FireGoldFist.fistCount = 999;
				return true;
			}
			return false;
		}

		internal static void GiveAffix(CharacterBody body, Inventory inventory, EliteDef elite)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Invalid comparison between Unknown and I4
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Invalid comparison between Unknown and I4
			//IL_0095: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)elite) || !Object.op_Implicit((Object)(object)elite.eliteEquipmentDef))
			{
				return;
			}
			if ((int)elite.eliteEquipmentDef.equipmentIndex != -1)
			{
				for (uint num = 0u; num <= inventory.GetEquipmentSlotCount(); num++)
				{
					if ((int)inventory.GetEquipment(num).equipmentIndex == -1 || inventory.GetEquipment(num).equipmentIndex == elite.eliteEquipmentDef.equipmentIndex)
					{
						inventory.SetEquipmentIndexForSlot(elite.eliteEquipmentDef.equipmentIndex, num);
						break;
					}
				}
			}
			if ((int)elite.eliteEquipmentDef.passiveBuffDef.buffIndex != -1)
			{
				body.SetBuffCount(elite.eliteEquipmentDef.passiveBuffDef.buffIndex, 1);
			}
		}

		private static void FireGoldFist_PlacePredictedAttack(orig_PlacePredictedAttack orig, FireGoldFist self)
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			bool flag = FireGoldFist.fistCount == 999;
			bool flag2 = FireGoldFist.fistCount == 998;
			if (!flag && !flag2)
			{
				orig.Invoke(self);
				return;
			}
			float num = Random.Range(0f, 360f);
			int num2 = (flag ? 4 : 8);
			float num3 = (flag ? 90f : 45f);
			RaycastHit val3 = default(RaycastHit);
			for (int i = 0; i < num2; i++)
			{
				for (int j = 0; j < 6; j++)
				{
					Vector3 val = Quaternion.Euler(0f, num + num3 * (float)i, 0f) * Vector3.forward;
					Vector3 val2 = ((FireFist)self).predictedTargetPosition + val * FireGoldFist.distanceBetweenFists * (float)j;
					if (Physics.Raycast(new Ray(val2 + Vector3.up * 30f, Vector3.down), ref val3, 60f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
					{
						val2 = ((RaycastHit)(ref val3)).point;
					}
					((FireFist)self).PlaceSingleDelayBlast(val2, FireGoldFist.delayBetweenFists * (float)j);
				}
			}
		}
	}
	public static class GCPAssets
	{
		public static GameObject GoldenKnurlPrefab;

		public static GameObject GoldenKnurlFollowerPrefab;

		public static GameObject LaserEyePrefab;

		public static GameObject SwordProjectile;

		public static GameObject BigSwordPrefab;

		public static Sprite BigSwordIcon;

		public static Sprite GoldenKnurlIcon;

		public static Sprite LaserEyeIcon;

		public static Sprite HiddenGoldBuffIcon;

		public static GameObject LaserEyeBeam;

		public static GameObject LaserEyeExplosion;

		public static GameObject LaserEyeReady;

		public static void RegisterAssets()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GoldenCoastPlusRevived.Properties.Resources.resources");
				using ResourceReader resourceReader = new ResourceReader(stream);
				IDictionaryEnumerator enumerator = resourceReader.GetEnumerator();
				while (enumerator.MoveNext())
				{
					string text = enumerator.Key as string;
					byte[] buffer = enumerator.Value as byte[];
					if (text.Contains("Titanic_Greatsword"))
					{
						BigSwordIcon = RegisterIcon(text, buffer, new Vector2(512f, 512f));
					}
					if (text.Contains("Golden_Knurl"))
					{
						GoldenKnurlIcon = RegisterIcon(text, buffer, new Vector2(256f, 256f));
					}
					if (text.Contains("Guardian_s_Eye"))
					{
						LaserEyeIcon = RegisterIcon(text, buffer, new Vector2(512f, 512f));
					}
					if (text.Contains("Aurelionite_s_Blessing"))
					{
						HiddenGoldBuffIcon = RegisterIcon(text, buffer, new Vector2(128f, 128f));
					}
				}
			}
			catch (Exception data)
			{
				Log.Error(data);
			}
		}

		private static Sprite RegisterIcon(string name, byte[] buffer, Vector2 size)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			Sprite result = null;
			try
			{
				Texture2D val = new Texture2D(2, 2);
				ImageConversion.LoadImage(val, buffer);
				result = Sprite.Create(val, new Rect(Vector2.zero, size), new Vector2(0.5f, 0.5f), 1f);
			}
			catch (Exception data)
			{
				Log.Error("Unable to load " + name);
				Log.Error(data);
			}
			return result;
		}
	}
}
namespace GoldenCoastPlusRevived.Items
{
	internal class BigSword : ItemBase<BigSword>
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnHitEnemy <0>__GlobalEventManager_OnHitEnemy;
		}

		internal static ModdedProcType swordProcType = ProcTypeAPI.ReserveProcType();

		internal override string name => "Titanic Greatsword";

		internal override string token => "BigSword";

		internal override string pickup => "Chance on hit to summon the sword of a long-imprisoned guardian.";

		internal override string description => "<style=cIsDamage>5%</style> chance on hit to summon <style=cIsDamage>Aurelionite's sword</style> to strike an enemy from underneath " + $"for <style=cIsDamage>{SwordDamage.Value}%</style> <style=cStack>(+{SwordDamage.Value}% per stack)</style> TOTAL damage.";

		internal override string lore => "The sword. The mark of a champion, fighting to protect. Perhaps, some day, the only thing between it and annihilation. A tool to defend.\n\nBut, also, the tool of a conqueror. One that is designed with the sole purpose to draw blood. Nothing more. In which way it is used is up to the wielder.";

		internal override GameObject modelPrefab => GCPAssets.BigSwordPrefab;

		internal override Sprite iconSprite => GCPAssets.BigSwordIcon;

		internal override ItemTier Tier => (ItemTier)4;

		internal override ItemTag[] ItemTags
		{
			get
			{
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				return (ItemTag[])(object)array;
			}
		}

		internal override bool hidden => false;

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

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

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

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

		public BigSword()
			: base(EnableSword.Value)
		{
		}

		internal override void AddItem()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			GCPAssets.SwordProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldPreFistProjectile_prefab).WaitForCompletion(), "GCPSwordProjectile", true);
			GCPAssets.SwordProjectile.GetComponent<ProjectileController>().procCoefficient = SwordProcCoeff.Value;
			((ProjectileExplosion)GCPAssets.SwordProjectile.GetComponent<ProjectileImpactExplosion>()).blastProcCoefficient = SwordProcCoeff.Value;
			GCPAssets.SwordProjectile.GetComponent<ProjectileDamage>().damage = SwordDamage.Value;
			((ProjectileExplosion)GCPAssets.SwordProjectile.GetComponent<ProjectileImpactExplosion>()).blastDamageCoefficient = SwordDamage.Value;
			ContentAddition.AddProjectile(GCPAssets.SwordProjectile);
			GCPAssets.BigSwordPrefab = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldBody_prefab).WaitForCompletion().GetComponent<ModelLocator>()
				.modelTransform.Find("TitanArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r/RightFist")).gameObject, "GCPPickupBigSword", false);
			Transform obj = GCPAssets.BigSwordPrefab.transform.Find("Sword");
			((Component)obj).transform.localPosition = new Vector3(4f, -5.5f, 0f);
			((Component)obj).transform.localEulerAngles = new Vector3(135f, 270f, 0f);
			List<RendererInfo> list = new List<RendererInfo>();
			Renderer[] componentsInChildren = GCPAssets.BigSwordPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				list.Add(new RendererInfo
				{
					renderer = val,
					defaultMaterial = val.material
				});
			}
			GCPAssets.BigSwordPrefab.AddComponent<ItemDisplay>().rendererInfos = list.ToArray();
			GCPAssets.BigSwordPrefab.AddComponent<ModelPanelParameters>().focusPointTransform = new GameObject("FocusPoint").transform;
			GCPAssets.BigSwordPrefab.GetComponent<ModelPanelParameters>().cameraPositionTransform = new GameObject("CameraPosition").transform;
			base.AddItem();
			ref PickupDefEntry[] pickupEntries = ref Addressables.LoadAssetAsync<ExplicitPickupDropTable>((object)RoR2_Base_Titan.dtBossTitanGold_asset).WaitForCompletion().pickupEntries;
			PickupDefEntry val2 = new PickupDefEntry
			{
				pickupWeight = 1f,
				pickupDef = (Object)(object)itemDef
			};
			ArrayUtils.ArrayAppend<PickupDefEntry>(ref pickupEntries, ref val2);
		}

		internal override void AddHooks()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__GlobalEventManager_OnHitEnemy;
			if (obj == null)
			{
				hook_OnHitEnemy val = GlobalEventManager_OnHitEnemy;
				<>O.<0>__GlobalEventManager_OnHitEnemy = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
		}

		private static void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0134: 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_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody val = (Object.op_Implicit((Object)(object)damageInfo?.attacker) ? damageInfo.attacker.GetComponent<CharacterBody>() : null);
			CharacterBody val2 = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent<CharacterBody>() : null);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2))
			{
				Inventory inventory = val.inventory;
				int num = ((inventory != null) ? inventory.GetItemCount(ItemBase<BigSword>.ItemIndex) : 0);
				if (num > 0 && !ProcTypeAPI.HasModdedProc(damageInfo.procChainMask, swordProcType) && Util.CheckRoll(SwordChance.Value * damageInfo.procCoefficient, val.master))
				{
					float damage = Util.OnHitProcDamage(damageInfo.damage, val.damage, SwordDamage.Value * (float)num);
					ProcChainMask procChainMask = damageInfo.procChainMask;
					ProcTypeAPI.AddModdedProc(ref procChainMask, swordProcType);
					RaycastHit val3 = default(RaycastHit);
					Physics.Raycast(damageInfo.position, Vector3.down, ref val3, float.PositiveInfinity, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
					ProjectileManager obj = ProjectileManager.instance;
					FireProjectileInfo val4 = new FireProjectileInfo
					{
						projectilePrefab = GCPAssets.SwordProjectile,
						position = ((RaycastHit)(ref val3)).point,
						rotation = Quaternion.identity,
						procChainMask = procChainMask,
						target = victim,
						owner = damageInfo.attacker,
						damage = damage,
						crit = damageInfo.crit,
						force = 1000f,
						damageColorIndex = (DamageColorIndex)3
					};
					((FireProjectileInfo)(ref val4)).fuseOverride = 0.5f;
					obj.FireProjectile(val4);
				}
			}
		}

		internal override ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_070b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_0746: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Expected O, but got Unknown
			ItemDisplayRule[] array = new ItemDisplayRule[1];
			int num = 0;
			array[num] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.0329f, 0.2482f, -0.1994f),
				localAngles = new Vector3(351.7756f, 182.8893f, 176.6553f),
				localScale = new Vector3(0.075f, 0.075f, 0.075f)
			};
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)array);
			string text = "mdlHuntress";
			ItemDisplayRule[] array2 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num2 = 0;
			array2[num2] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Chest",
				localPos = new Vector3(0.0638f, 0.0313f, -0.1337f),
				localAngles = new Vector3(10.1805f, 136.4797f, 157.9499f),
				localScale = new Vector3(0.075f, 0.075f, 0.075f)
			};
			val.Add(text, array2);
			string text2 = "mdlToolbot";
			ItemDisplayRule[] array3 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num3 = 0;
			array3[num3] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "HandR",
				localPos = new Vector3(0.4984f, -0.1438f, 6.4378f),
				localAngles = new Vector3(7.4983f, 274.1188f, 226.3156f),
				localScale = new Vector3(1.125f, 1.125f, 1.125f)
			};
			val.Add(text2, array3);
			string text3 = "mdlEngi";
			ItemDisplayRule[] array4 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num4 = 0;
			array4[num4] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Chest",
				localPos = new Vector3(0.079f, 0.2449f, -0.3275f),
				localAngles = new Vector3(341.1019f, 177.318f, 142.7579f),
				localScale = new Vector3(0.1125f, 0.1125f, 0.1125f)
			};
			val.Add(text3, array4);
			string text4 = "mdlEngiTurret";
			ItemDisplayRule[] array5 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num5 = 0;
			array5[num5] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Head",
				localPos = new Vector3(0.035f, 0.7881f, 1.4463f),
				localAngles = new Vector3(90f, 34.5601f, 0f),
				localScale = new Vector3(0.2022f, 0.2022f, 0.2022f)
			};
			val.Add(text4, array5);
			string text5 = "mdlMage";
			ItemDisplayRule[] array6 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num6 = 0;
			array6[num6] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Chest",
				localPos = new Vector3(-0.0209f, -0.0058f, -0.358f),
				localAngles = new Vector3(353.1851f, 177.0113f, 165.1478f),
				localScale = new Vector3(0.0938f, 0.0938f, 0.0938f)
			};
			val.Add(text5, array6);
			string text6 = "mdlMerc";
			ItemDisplayRule[] array7 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num7 = 0;
			array7[num7] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "HandR",
				localPos = new Vector3(-0.5364f, 0.2649f, -0.1585f),
				localAngles = new Vector3(2.8962f, 342.4381f, 46.5564f),
				localScale = new Vector3(0.0966f, 0.0966f, 0.1345f)
			};
			val.Add(text6, array7);
			string text7 = "mdlTreebot";
			ItemDisplayRule[] array8 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num8 = 0;
			array8[num8] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "FootFrontR",
				localPos = new Vector3(0.0274f, -0.5904f, 0.0166f),
				localAngles = new Vector3(1.1992f, 143.2164f, 139.9014f),
				localScale = new Vector3(0.095f, 0.095f, 0.095f)
			};
			val.Add(text7, array8);
			string text8 = "mdlLoader";
			ItemDisplayRule[] array9 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num9 = 0;
			array9[num9] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Chest",
				localPos = new Vector3(0.0869f, 0.0385f, -0.3257f),
				localAngles = new Vector3(358.9687f, 156.1434f, 135.99f),
				localScale = new Vector3(0.1125f, 0.1125f, 0.1125f)
			};
			val.Add(text8, array9);
			string text9 = "mdlCroco";
			ItemDisplayRule[] array10 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num10 = 0;
			array10[num10] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "Head",
				localPos = new Vector3(-5.2534f, 3.3026f, -0.8387f),
				localAngles = new Vector3(356.6106f, 355.6419f, 44.4464f),
				localScale = new Vector3(0.75f, 0.75f, 0.75f)
			};
			val.Add(text9, array10);
			string text10 = "mdlCaptain";
			ItemDisplayRule[] array11 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num11 = 0;
			array11[num11] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "HandR",
				localPos = new Vector3(0.1117f, 0.0118f, -0.6402f),
				localAngles = new Vector3(353.923f, 81.0515f, 224.7833f),
				localScale = new Vector3(0.1169f, 0.1169f, 0.1169f)
			};
			val.Add(text10, array11);
			string text11 = "mdlBandit2";
			ItemDisplayRule[] array12 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num12 = 0;
			array12[num12] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.BigSwordPrefab,
				childName = "MuzzleShotgun",
				localPos = new Vector3(-0.0305f, -0.0199f, 0.2406f),
				localAngles = new Vector3(8.2793f, 270.418f, 229.606f),
				localScale = new Vector3(0.0397f, 0.0397f, 0.0397f)
			};
			val.Add(text11, array12);
			return val;
		}
	}
	internal class GoldenKnurl : ItemBase<GoldenKnurl>
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static StatHookEventHandler <0>__GoldenKnurlStatChanges;
		}

		internal override string name => "Golden Knurl";

		internal override string token => "GoldenKnurl";

		internal override string pickup => "Boosts health, regeneration, and armor.";

		internal override string description => $"<style=cIsHealing>Increase maximum health per level</style> by <style=cIsHealing>+{KnurlLevelHealth.Value}%</style> <style=cStack>(+{KnurlLevelHealth.Value}% per stack)</style>, " + $"<style=cIsHealing>health regen per level</style> by <style=cIsHealing>+{KnurlLevelRegen.Value} hp/s</style> <style=cStack>(+{KnurlLevelRegen.Value} hp/s per stack)</style>," + $" and <style=cIsUtility>armor per level</style> by <style=cIsUtility>+{KnurlLevelArmor.Value}</style> <style=cStack>(+{KnurlLevelArmor.Value} per stack)</style>.";

		internal override string lore => "A well-tested design. One that's proven powerful, yet gentle. That which can coexist with this planet's creatures, but defend them when need be.\n\nA construction of gold. Something unique. Something distinct. Something iconic. One to stand out, and be remembered both by friend and foe.\n\nA guardian. A creature who can defend this Heaven. One day, we will no longer be here for these creatures. But this one will. One to ensure their survival, when we can not.";

		internal override GameObject modelPrefab => GCPAssets.GoldenKnurlPrefab;

		internal override Sprite iconSprite => GCPAssets.GoldenKnurlIcon;

		internal override ItemTier Tier => (ItemTier)4;

		internal override ItemTag[] ItemTags
		{
			get
			{
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				return (ItemTag[])(object)array;
			}
		}

		internal override bool hidden => false;

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

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

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

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

		public GoldenKnurl()
			: base(EnableKnurl.Value)
		{
		}

		internal override void AddItem()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			Material material = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Titan.matTitanGold_mat).WaitForCompletion());
			GCPAssets.GoldenKnurlPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.PickupKnurl_prefab).WaitForCompletion(), "GCPPickupGoldenKnurl", false);
			Renderer[] componentsInChildren = GCPAssets.GoldenKnurlPrefab.GetComponentsInChildren<Renderer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].material = material;
			}
			GCPAssets.GoldenKnurlFollowerPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.DisplayKnurl_prefab).WaitForCompletion(), "GCPGoldenKnurlFollowerPrefab", false);
			((Component)GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("mdlKnurl")).gameObject.SetActive(false);
			((Component)GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("KnurlPebbleParticles")).gameObject.SetActive(false);
			GameObject obj = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.DisplayKnurl_prefab).WaitForCompletion().transform.Find("mdlKnurl")).gameObject, "GCPGoldenKnurlFollowerModel", false);
			obj.GetComponent<Renderer>().material = material;
			obj.transform.parent = GCPAssets.GoldenKnurlFollowerPrefab.transform;
			GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("GCPGoldenKnurlFollowerModel").localPosition = GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("mdlKnurl").localPosition;
			GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("GCPGoldenKnurlFollowerModel").localEulerAngles = GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("mdlKnurl").localEulerAngles;
			GameObject obj2 = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.DisplayKnurl_prefab).WaitForCompletion().transform.Find("KnurlPebbleParticles")).gameObject, "GCPGoldenKnurlFollowerPebbles", false);
			obj2.GetComponent<Renderer>().material = material;
			obj2.transform.parent = GCPAssets.GoldenKnurlFollowerPrefab.transform;
			GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("GCPGoldenKnurlFollowerPebbles").localPosition = GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("KnurlPebbleParticles").localPosition;
			GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("GCPGoldenKnurlFollowerPebbles").localEulerAngles = GCPAssets.GoldenKnurlFollowerPrefab.transform.Find("KnurlPebbleParticles").localEulerAngles;
			base.AddItem();
			ref PickupDefEntry[] pickupEntries = ref Addressables.LoadAssetAsync<ExplicitPickupDropTable>((object)RoR2_Base_Titan.dtBossTitanGold_asset).WaitForCompletion().pickupEntries;
			PickupDefEntry val = new PickupDefEntry
			{
				pickupWeight = 1f,
				pickupDef = (Object)(object)itemDef
			};
			ArrayUtils.ArrayAppend<PickupDefEntry>(ref pickupEntries, ref val);
		}

		internal override void AddHooks()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__GoldenKnurlStatChanges;
			if (obj == null)
			{
				StatHookEventHandler val = GoldenKnurlStatChanges;
				<>O.<0>__GoldenKnurlStatChanges = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
		}

		private static void GoldenKnurlStatChanges(CharacterBody sender, StatHookEventArgs args)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			Inventory inventory = sender.inventory;
			int num = ((inventory != null) ? inventory.GetItemCount(ItemBase<GoldenKnurl>.ItemIndex) : 0);
			if (num > 0)
			{
				args.levelArmorAdd += KnurlLevelArmor.Value * (float)num;
				args.levelRegenAdd += KnurlLevelRegen.Value * (float)num;
				args.levelHealthAdd += KnurlLevelHealth.Value * (float)num * 0.01f;
			}
		}

		internal override ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_052e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c0: Expected O, but got Unknown
			ItemDisplayRule[] array = new ItemDisplayRule[1];
			int num = 0;
			array[num] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.344f, 0.425f, -0.053f),
				localAngles = new Vector3(276.5326f, 108.8338f, 239.9354f),
				localScale = new Vector3(0.16f, 0.16f, 0.16f)
			};
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])(object)array);
			string text = "mdlHuntress";
			ItemDisplayRule[] array2 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num2 = 0;
			array2[num2] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.17f, 0.316f, 0.138f),
				localAngles = new Vector3(280.0211f, 150.599f, 218.2666f),
				localScale = new Vector3(0.11f, 0.11f, 0.11f)
			};
			val.Add(text, array2);
			string text2 = "mdlToolbot";
			ItemDisplayRule[] array3 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num3 = 0;
			array3[num3] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "UpperArmR",
				localPos = new Vector3(0.32f, 0.09f, -0.03f),
				localAngles = new Vector3(85.4049f, -0.0001f, -0.0001f),
				localScale = new Vector3(1.01f, 1.01f, 1.01f)
			};
			val.Add(text2, array3);
			string text3 = "mdlEngi";
			ItemDisplayRule[] array4 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num4 = 0;
			array4[num4] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.386f, 0.425f, -0.053f),
				localAngles = new Vector3(276.5326f, 108.8338f, 239.9354f),
				localScale = new Vector3(0.16f, 0.16f, 0.16f)
			};
			val.Add(text3, array4);
			string text4 = "mdlMage";
			ItemDisplayRule[] array5 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num5 = 0;
			array5[num5] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.225f, 0.307f, 0.004f),
				localAngles = new Vector3(279.6995f, 13.3832f, 338.7414f),
				localScale = new Vector3(0.086f, 0.086f, 0.086f)
			};
			val.Add(text4, array5);
			string text5 = "mdlMerc";
			ItemDisplayRule[] array6 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num6 = 0;
			array6[num6] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.343f, 0.253f, -0.054f),
				localAngles = new Vector3(276.8653f, 259.4112f, 89.62f),
				localScale = new Vector3(0.11f, 0.11f, 0.11f)
			};
			val.Add(text5, array6);
			string text6 = "mdlTreebot";
			ItemDisplayRule[] array7 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num7 = 0;
			array7[num7] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "FlowerBase",
				localPos = new Vector3(-0.5f, 0f, -0.023f),
				localAngles = new Vector3(0f, 0f, 0f),
				localScale = new Vector3(0.11f, 0.11f, 0.11f)
			};
			val.Add(text6, array7);
			string text7 = "mdlLoader";
			ItemDisplayRule[] array8 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num8 = 0;
			array8[num8] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "MechUpperArmR",
				localPos = new Vector3(-0.095f, 0.066f, -0.071f),
				localAngles = new Vector3(48.8601f, 224.1132f, 52.647f),
				localScale = new Vector3(0.11f, 0.11f, 0.11f)
			};
			val.Add(text7, array8);
			string text8 = "mdlCroco";
			ItemDisplayRule[] array9 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num9 = 0;
			array9[num9] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "UpperArmR",
				localPos = new Vector3(1.82f, 1.78f, 0.11f),
				localAngles = new Vector3(284.9999f, 90.0006f, 284.9994f),
				localScale = new Vector3(1.01f, 1.01f, 1.01f)
			};
			val.Add(text8, array9);
			string text9 = "mdlCaptain";
			ItemDisplayRule[] array10 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num10 = 0;
			array10[num10] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.405f, 0.404f, -0.042f),
				localAngles = new Vector3(276.8653f, 259.4112f, 89.62f),
				localScale = new Vector3(0.11f, 0.11f, 0.11f)
			};
			val.Add(text9, array10);
			string text10 = "mdlBandit2";
			ItemDisplayRule[] array11 = (ItemDisplayRule[])(object)new ItemDisplayRule[1];
			int num11 = 0;
			array11[num11] = new ItemDisplayRule
			{
				ruleType = (ItemDisplayRuleType)0,
				followerPrefab = GCPAssets.GoldenKnurlFollowerPrefab,
				childName = "Chest",
				localPos = new Vector3(0.228f, 0.383f, -0.109f),
				localAngles = new Vector3(276.5326f, 108.8338f, 239.9354f),
				localScale = new Vector3(0.086f, 0.086f, 0.086f)
			};
			val.Add(text10, array11);
			return val;
		}
	}
	internal class HiddenGoldItem : ItemBase<HiddenGoldItem>
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_GiveMoney <0>__CharacterMaster_GiveMoney;
		}

		internal override string name => "Aurelionite's Blessing";

		internal override string token => "HiddenGoldBuffItem";

		internal override string pickup => "The Guardian of the Golden Coast has blessed you.";

		internal override string description => $"Gain <style=cShrine>{AurelioniteBlessingGoldGain.Value}%</style> <style=cStack>(+{AurelioniteBlessingGoldGain.Value}% per stack)</style> <style=cShrine>more gold</style>.";

		internal override string lore => "";

		internal override GameObject modelPrefab => null;

		internal override Sprite iconSprite => GCPAssets.HiddenGoldBuffIcon;

		internal override ItemTier Tier => (ItemTier)5;

		internal override ItemTag[] ItemTags
		{
			get
			{
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				return (ItemTag[])(object)array;
			}
		}

		internal override bool hidden => true;

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

		public HiddenGoldItem()
			: base(FightChanges.EnableFightChanges.Value)
		{
		}

		internal override void AddHooks()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__CharacterMaster_GiveMoney;
			if (obj == null)
			{
				hook_GiveMoney val = CharacterMaster_GiveMoney;
				<>O.<0>__CharacterMaster_GiveMoney = val;
				obj = (object)val;
			}
			CharacterMaster.GiveMoney += (hook_GiveMoney)obj;
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				body.SetBuffCount(BuffBase<HiddenGoldBuff>.BuffIndex, body.inventory.GetItemCount(ItemBase<HiddenGoldItem>.ItemIndex));
			}
		}

		private static void CharacterMaster_GiveMoney(orig_GiveMoney orig, CharacterMaster self, uint amount)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (amount != 0)
			{
				Inventory inventory = self.inventory;
				int num = ((inventory != null) ? inventory.GetItemCount(ItemBase<HiddenGoldItem>.ItemIndex) : 0);
				if (num > 0)
				{
					float num2 = (float)num * AurelioniteBlessingGoldGain.Value;
					amount += (uint)Mathf.CeilToInt((float)amount * num2);
				}
			}
			orig.Invoke(self, amount);
		}
	}
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public static ItemIndex ItemIndex
		{
			get
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				T val = instance;
				ItemIndex? obj;
				if (val == null)
				{
					obj = null;
				}
				else
				{
					ItemDef obj2 = val.itemDef;
					obj = ((obj2 != null) ? new ItemIndex?(obj2.itemIndex) : null);
				}
				ItemIndex? val2 = obj;
				return val2.GetValueOrDefault((ItemIndex)(-1));
			}
		}

		public ItemBase(bool enabled)
			: base(enabled)
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef itemDef;

		internal abstract string name { get; }

		internal abstract string pickup { get; }

		internal abstract string description { get; }

		internal abstract string lore { get; }

		internal abstract string token { get; }

		internal abstract GameObject modelPrefab { get; }

		internal abstract Sprite iconSprite { get; }

		internal abstract ItemTier Tier { get; }

		internal virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];


		internal abstract bool hidden { get; }

		public ItemBase(bool enabled)
		{
			if (enabled)
			{
				AddTokens();
				AddItem();
				AddHooks();
			}
		}

		internal virtual void AddTokens()
		{
			LanguageAPI.Add(token.ToUpper() + "_NAME", name);
			LanguageAPI.Add(token.ToUpper() + "_PICKUP", pickup);
			LanguageAPI.Add(token.ToUpper() + "_DESC", description);
			LanguageAPI.Add(token.ToUpper() + "_LORE", lore);
		}

		internal virtual void AddItem()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = token;
			itemDef.nameToken = token.ToUpper() + "_NAME";
			itemDef.pickupToken = token.ToUpper() + "_PICKUP";
			itemDef.descriptionToken = token.ToUpper() + "_DESC";
			itemDef.loreToken = token.ToUpper() + "_LORE";
			itemDef.pickupModelPrefab = modelPrefab;
			itemDef.pickupIconSprite = iconSprite;
			itemDef.deprecatedTier = Tier;
			itemDef.tags = ItemTags;
			itemDef.hidden = hidden;
			ItemAPI.Add(new CustomItem(itemDef, AddItemDisplays()));
		}

		internal virtual void AddHooks()
		{
		}

		internal virtual ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}
	}
	internal class LaserEye : ItemBase<LaserEye>
	{
		internal override string name => "Guardian's Eye";

		internal override string token => "LaserEye";

		internal override string pickup => "Collecting gold will charge up a powerful laser.";

		internal override string description => "<style=cShrine>Collecting gold</style> will charge up a <style=cDeath>powerful laser</style>. When armed, " + $"the <style=cDeath>laser</style> will fire at <style=cIsUtility>{EyeTargetsPerStack.Value}</style> <style=cStack>(+{EyeTargetsPerStack.Value} per stack)</style> " + $"enemies within {EyeMaxRange.Value} meters, dealing <style=cIsDamage>{EyeDamage.Value}%</style> BASE damage.";

		internal override string lore => "The ability to see. Designs such as this have no need to taste. They do not feel, nor smell, nor hear that which surrounds them. They have no need.\n\n...\n\nA sad existence. Forced to follow orders. Nothing more than a servant. No feelings.\n\nPerhaps one exception. One day, this guardian will have no one to take orders from. Will have new challenges to overcome, and new decisions to make. A proper protector for this planet.";

		internal override GameObject modelPrefab => GCPAssets.LaserEyePrefab;

		internal override Sprite iconSprite => GCPAssets.LaserEyeIcon;

		internal override ItemTier Tier => (ItemTier)4;

		internal override ItemTag[] ItemTags
		{
			get
			{
				ItemTag[] array = new ItemTag[3];
				RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
				return (ItemTag[])(object)array;
			}
		}

		internal override bool hidden => false;

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

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

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

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

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

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

		public LaserEye()
			: base(EnableEye.Value)
		{
		}

		internal override void AddItem()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			GCPAssets.LaserEyeBeam = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Golem.TracerGolem_prefab).WaitForCompletion(), "GCPLaserEyeBeam", true);
			GCPAssets.LaserEyeExplosion = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Golem.ExplosionGolem_prefab).WaitForCompletion(), "GCPLaserEyeExplosion", true);
			GCPAssets.LaserEyeReady = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.ShieldBreakEffect_prefab).WaitForCompletion(), "GCPLaserEyeReady", true);
			MainModule main = ((Component)GCPAssets.LaserEyeReady.transform.GetChild(0)).GetComponent<ParticleSystem>().main;
			MinMaxGradient startColor = ((MainModule)(ref main)).startColor;
			((MinMaxGradient)(ref startColor)).colorMin = new Color(1f, 47f / 51f, 0.015686275f, 0.1f);
			((MinMaxGradient)(ref startColor)).colorMax = Color.yellow;
			((MainModule)(ref main)).startColor = startColor;
			main = ((Component)GCPAssets.LaserEyeReady.transform.GetChild(1)).GetComponent<ParticleSystem>().main;
			startColor = ((MainModule)(ref main)).startColor;
			((MinMaxGradient)(ref startColor)).colorMin = Color.yellow;
			((MinMaxGradient)(ref startColor)).colorMax = Color.red;
			((MainModule)(ref main)).startColor = startColor;
			MinMaxCurve startSize = ((MainModule)(ref main)).startSize;
			((MinMaxCurve)(ref startSize)).constantMin = 1f;
			((MinMaxCurve)(ref startSize)).constantMax = 3f;
			((MainModule)(ref main)).startSize = startSize;
			((MainModule)(ref main)).simulationSpeed = 0.5f;
			ContentAddition.AddEffect(GCPAssets.LaserEyeBeam);
			ContentAddition.AddEffect(GCPAssets.LaserEyeExplosion);
			ContentAddition.AddEffect(GCPAssets.LaserEyeReady);
			GCPAssets.LaserEyePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Meteor.PickupMeteor_prefab).WaitForCompletion(), "GCPPickupLaserEye", false);
			GCPAssets.LaserEyePrefab.GetComponentInChildren<Renderer>().materials = (Material[])(object)new Material[2]
			{
				new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_NearbyDamageBonus.matDiamond_mat).WaitForCompletion())
				{
					color = Color.red
				},
				new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Titan.matTitanGold_mat).WaitForCompletion())
			};
			List<RendererInfo> list = new List<RendererInfo>();
			Renderer[] componentsInChildren = GCPAssets.LaserEyePrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				list.Add(new RendererInfo
				{
					renderer = val,
					defaultMaterial = val.material
				});
			}
			GCPAssets.LaserEyePrefab.AddComponent<ItemDisplay>().rendererInfos = list.ToArray();
			base.AddItem();
			ref PickupDefEntry[] pickupEntries = ref Addressables.LoadAssetAsync<ExplicitPickupDropTable>((object)RoR2_Base_Titan.dtBossTitanGold_asset).WaitForCompletion().pickupEntries;
			PickupDefEntry val2 = new PickupDefEntry
			{
				pickupWeight = 1f,
				pickupDef = (Object)(object)itemDef
			};
			ArrayUtils.ArrayAppend<PickupDefEntry>(ref pickupEntries, ref val2);
		}

		internal override void AddHooks()
		{
			base.AddHooks();
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			if (NetworkServer.active)
			{
				body.AddItemBehavior<LaserEyeBehavior>(body.inventory.GetItemCount(itemDef));
			}
		}

		internal override ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0