Decompiled source of GoldenCoastPlus v1.4.2

GoldenCoastPlusRevived.dll

Decompiled a week 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.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.GolemMonster;
using EntityStates.Interactables.GoldBeacon;
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 IL.RoR2;
using LookingGlass.ItemStatsNameSpace;
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.AsyncManagement;
using RoR2.Projectile;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("GoldenCoastPlusRevived")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d160d0ab6bd5deeb6ce9ac1274804cd7c3daed53")]
[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]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.TechDebtCollector.GoldenCoastPlus", "GoldenCoastPlus", "1.4.2")]
	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.4.2";

		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();
			GoldElites.LoadAssets();
			new AffixGold();
			GoldElites.Init();
			FightChanges.Init();
			SeedChanges.Init();
			if (LookingGlassCompat.IsLookingGlassInstalled && LookingGlassCompat.EnableLookingGlassCompat.Value)
			{
				LookingGlassCompat.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");
			BindHalcyonSeed(cfg, "6. Halcyon Seed");
			BindGoldElites(cfg, "7. Gold Elites");
			BindModCompatibility(cfg, "8. Mod Compatibility");
			ValidateConfig(cfg);
			cfg.SettingChanged += delegate
			{
				ItemBase.RefreshAllDescriptions();
			};
		}

		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.4.2", (ConfigFlags)0);
			if (AutoConfig.Value && (flag || LatestVersion.Value != "1.4.2"))
			{
				LatestVersion.Value = "1.4.2";
				_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.", 1.5f, 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, 1f, 5f, (ConfigFlags)4);
			FightChanges.UseGildedAffix = Extensions.BindOption<bool>(cfg, section, "Boss Gilded Affix", "Should the boss Aurelionite become Gilded when it enters its final phase?", true, (ConfigFlags)4);
			HiddenGoldItem.EnableBlessing = Extensions.BindOption<bool>(cfg, section, "Enable Aurelionites Blessing", "Should killing Aurelionite grant Aurelionite's Blessing, a permanent gold gain bonus? Disable this if you only want the fight changes.", true, (ConfigFlags)1);
			HiddenGoldItem.ShowBlessingBuff = Extensions.BindOption<bool>(cfg, section, "Show Aurelionites Blessing Buff", "Should Aurelionite's Blessing show up in the buff bar?", true, (ConfigFlags)1);
			HiddenGoldItem.AurelioniteBlessingGoldGain = Extensions.BindOptionSlider<int>(cfg, section, "Aurelionites Blessing gold gain multiplier", "Adjust the percent additional gold gain, in percent.", 40, 1, 100, (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.", 10f, 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);
			BigSword.SwordDropWeight = BindDropWeight(cfg, section, "Titanic Greatsword");
		}

		private static ConfigEntry<float> BindDropWeight(ConfigFile cfg, string section, string itemName)
		{
			return Extensions.BindOptionSlider<float>(cfg, section, itemName + " Drop Weight", "Adjust how likely Aurelionite is to drop " + itemName + ", relative to the other items in its drop table. 0 removes it from the drop table.", 1f, 0f, 10f, (ConfigFlags)1);
		}

		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.", 2f, 0f, 10f, (ConfigFlags)0);
			GoldenKnurl.KnurlDropWeight = BindDropWeight(cfg, section, "Golden Knurl");
		}

		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.", 3, 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, 10f, 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);
			LaserEye.EyeDropWeight = BindDropWeight(cfg, section, "Guardians Eye");
		}

		private static void BindHalcyonSeed(ConfigFile cfg, string section)
		{
			SeedChanges.EnableSeedChanges = Extensions.BindOption<bool>(cfg, section, "Enable Halcyon Seed Changes", "Should allied Aurelionite be stronger, with its damage scaling linearly with Halcyon Seeds like its health does?", true, (ConfigFlags)1);
			SeedChanges.AllyStrengthMultiplier = Extensions.BindOptionSlider<int>(cfg, section, "Allied Aurelionite Strength Multiplier", "Adjust how many times stronger allied Aurelionite is per Halcyon Seed.", 3, 1, 10, (ConfigFlags)1);
			SeedChanges.SeedDropWeight = BindDropWeight(cfg, section, "Halcyon Seed");
		}

		private static void BindGoldElites(ConfigFile cfg, string section)
		{
			GoldElites.EnableGoldElites = Extensions.BindOption<bool>(cfg, section, "Enable Gold Elites", "Should Gold elites (Coven of Gold) spawn in Gilded Coast? They never spawn anywhere else.", true, (ConfigFlags)1);
			GoldElites.EliteCostMultiplier = Extensions.BindOptionSlider<float>(cfg, section, "Gold Elite Cost Multiplier", "Adjust the director cost of Gold elites, relative to tier 1 elites.", 1f, 0.1f, 10f, (ConfigFlags)1);
			GoldElites.HealthBoostCoefficient = Extensions.BindOptionSlider<float>(cfg, section, "Gold Elite Health Multiplier", "Adjust the health multiplier of Gold elites.", 11f, 1f, 30f, (ConfigFlags)1);
			GoldElites.DamageBoostCoefficient = Extensions.BindOptionSlider<float>(cfg, section, "Gold Elite Damage Multiplier", "Adjust the damage multiplier of Gold elites.", 4f, 1f, 10f, (ConfigFlags)1);
			GoldElites.GoldStealAmount = Extensions.BindOptionSlider<float>(cfg, section, "Gold Steal Amount", "Adjust how much gold is stolen or granted per hit, before scaling with difficulty and proc coefficient.", 2f, 0f, 10f, (ConfigFlags)4);
			GoldElites.GoldRewardMultiplier = Extensions.BindOptionSlider<float>(cfg, section, "Gold Reward Multiplier", "Adjust the multiplier on the gold Gold elites drop when killed.", 5f, 1f, 20f, (ConfigFlags)4);
		}

		private static void BindModCompatibility(ConfigFile cfg, string section)
		{
			LookingGlassCompat.EnableLookingGlassCompat = Extensions.BindOption<bool>(cfg, section, "Enable LookingGlass Item Stats", "Should item stats be added to LookingGlass (if installed)?", true, (ConfigFlags)1);
		}

		private static void ValidateConfig(ConfigFile cfg)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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.DeleteOrphanedEntries(cfg);
			Extensions.DeleteOrphanedEntries(_backupConfig);
		}

		private static ConfigEntryBase BindBackup(ConfigFile cfg, ConfigEntryBase entry)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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)
				{
					ResourceManager resourceManager = new ResourceManager("GoldenCoastPlusRevived.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				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 int currentPhase = 1;

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

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

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

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

		internal static void Init()
		{
			//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: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//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_00bc: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//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_00fe: 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_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody component = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldBody_prefab).WaitForCompletion().GetComponent<CharacterBody>();
			component.levelMaxHealth *= BossHealthMult.Value;
			Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_goldshores.GoldshoresBeacon_prefab).WaitForCompletion().GetComponent<PurchaseInteraction>()
				.cost = 0;
		}

		private static void GoldshoresBossfight_SpawnBoss(orig_SpawnBoss orig, GoldshoresBossfight self)
		{
			orig.Invoke(self);
			currentPhase = 1;
			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)
		{
			currentPhase = 1;
			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 = 3f;
			GoldshoresBossfight.shieldRemovalDuration = 2.1474836E+09f;
			orig.Invoke(self);
		}

		private static void GoldshoresBossfight_SetBossImmunity(orig_SetBossImmunity orig, GoldshoresBossfight self, bool newBossImmunity)
		{
			//IL_0092: 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 == bossImmunity)
			{
				return;
			}
			foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
			{
				CharacterBody body = readOnlyMembers.GetBody();
				if (!Object.op_Implicit((Object)(object)body))
				{
					continue;
				}
				if (newBossImmunity)
				{
					SkillLocator skillLocator = body.skillLocator;
					if (skillLocator != null)
					{
						GenericSkill special = skillLocator.special;
						if (special != null)
						{
							special.SetBlockedCooldownSkillState(true);
						}
					}
					continue;
				}
				body.AddTimedBuff(BuffBase<TitanGoldArmorBroken>.BuffIndex, 10f);
				SkillLocator skillLocator2 = body.skillLocator;
				if (skillLocator2 != null)
				{
					GenericSkill special2 = skillLocator2.special;
					if (special2 != null)
					{
						special2.SetBlockedCooldownSkillState(false);
					}
				}
			}
		}

		private static void GoldshoresBossfight_ServerFixedUpdate(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if ((int)ItemBase<HiddenGoldItem>.ItemIndex == -1)
			{
				return;
			}
			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_0108: 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;
			int num = ((combinedHealthFraction <= 1f / 3f) ? 3 : ((!(combinedHealthFraction <= 2f / 3f)) ? 1 : 2));
			if (num <= currentPhase)
			{
				return false;
			}
			currentPhase = num;
			if (currentPhase == 3)
			{
				foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList)
				{
					if (Object.op_Implicit((Object)(object)readOnlyMembers.inventory))
					{
						readOnlyMembers.inventory.GiveItemPermanent(Items.AlienHead.itemIndex, 1);
						CharacterBody body = readOnlyMembers.GetBody();
						if (Object.op_Implicit((Object)(object)body) && UseGildedAffix.Value)
						{
							GiveAffix(body, readOnlyMembers.inventory, Elites.Aurelionite);
						}
					}
				}
			}
			return true;
		}

		internal static void GiveAffix(CharacterBody body, Inventory inventory, EliteDef elite)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Invalid comparison between Unknown and I4
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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, 0u).equipmentIndex == -1 || inventory.GetEquipment(num, 0u).equipmentIndex == elite.eliteEquipmentDef.equipmentIndex)
					{
						inventory.SetEquipmentIndexForSlot(elite.eliteEquipmentDef.equipmentIndex, num, 0u);
						inventory.SetActiveEquipmentSlot((byte)num);
						inventory.SetActiveEquipmentSet((byte)0);
						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_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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			if (currentPhase <= 1)
			{
				orig.Invoke(self);
				return;
			}
			float num = Random.Range(0f, 360f);
			int num2 = ((currentPhase >= 3) ? 6 : 4);
			float num3 = 360f / (float)num2;
			int num4 = FireGoldFist.fistCount + currentPhase - 1;
			RaycastHit val3 = default(RaycastHit);
			for (int i = 0; i < num2; i++)
			{
				for (int j = ((i != 0) ? 1 : 0); j < num4; 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 Sprite AffixGoldIcon;

		public static GameObject LaserEyeBeam;

		public static GameObject LaserEyeExplosion;

		public static GameObject LaserEyeReady;

		public static void RegisterAssets()
		{
			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);
					}
					if (text.Contains("Golden_Knurl"))
					{
						GoldenKnurlIcon = RegisterIcon(text, buffer);
					}
					if (text.Contains("Guardian_s_Eye"))
					{
						LaserEyeIcon = RegisterIcon(text, buffer);
					}
					if (text.Contains("Aurelionite_s_Blessing"))
					{
						HiddenGoldBuffIcon = RegisterIcon(text, buffer);
					}
					if (text.Contains("Gold_Elite_Icon"))
					{
						AffixGoldIcon = RegisterIcon(text, buffer);
					}
				}
			}
			catch (Exception data)
			{
				Log.Error(data);
			}
		}

		private static Sprite RegisterIcon(string name, byte[] buffer)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			Sprite val = null;
			try
			{
				Texture2D val2 = new Texture2D(2, 2, (TextureFormat)4, true);
				ImageConversion.LoadImage(val2, buffer);
				((Texture)val2).filterMode = (FilterMode)2;
				((Texture)val2).wrapMode = (TextureWrapMode)1;
				val2.Apply(true);
				float num = (float)((Texture)val2).width / 1.28f;
				val = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f), num);
				((Object)val).name = name;
			}
			catch (Exception data)
			{
				Log.Error("Unable to load " + name);
				Log.Error(data);
			}
			return val;
		}
	}
	public class GCPBossfight : EntityState
	{
		public GoldshoresMissionController missionController;

		public static float shieldRemovalDuration;

		public bool hasSpawnedBoss;

		public int serverCycleCount;

		public FixedTimeStamp bossInvulnerabilityStartTime;

		public ScriptedCombatEncounter scriptedCombatEncounter;

		public bool bossImmunity;

		public bool bossShouldBeInvulnerable => missionController.beaconsActive < missionController.beaconsToSpawnOnMap;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnEnter();
			missionController = ((EntityState)this).GetComponent<GoldshoresMissionController>();
			bossInvulnerabilityStartTime = FixedTimeStamp.negativeInfinity;
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active)
			{
				ServerFixedUpdate();
			}
		}

		public void SetBossImmunity(bool newBossImmunity)
		{
			//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_00a2: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)scriptedCombatEncounter) || newBossImmunity == bossImmunity)
			{
				return;
			}
			bossImmunity = newBossImmunity;
			foreach (CharacterMaster readOnlyMembers in scriptedCombatEncounter.combatSquad.readOnlyMembersList)
			{
				CharacterBody body = readOnlyMembers.GetBody();
				if (Object.op_Implicit((Object)(object)body))
				{
					if (bossImmunity)
					{
						body.AddBuff(Buffs.Immune);
						continue;
					}
					EffectManager.SpawnEffect(EntityStateGameObject.op_Implicit(GoldshoresBossfight.shieldRemovalEffectPrefab), new EffectData
					{
						origin = body.coreTransform.position
					}, true);
					body.RemoveBuff(Buffs.Immune);
				}
			}
		}

		public void ExtinguishBeacons()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			foreach (GameObject beaconInstance in missionController.beaconInstanceList)
			{
				beaconInstance.GetComponent<EntityStateMachine>().SetNextState((EntityState)new NotReady());
			}
		}

		public void ServerFixedUpdate()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).fixedAge >= GoldshoresBossfight.transitionDuration)
			{
				missionController.ExitTransitionIntoBossfight();
				if (!hasSpawnedBoss)
				{
					SpawnBoss();
				}
				else if (scriptedCombatEncounter.combatSquad.readOnlyMembersList.Count == 0)
				{
					base.outer.SetNextState((EntityState)new Exit());
					if (serverCycleCount >= 1)
					{
					}
					return;
				}
			}
			if (!Object.op_Implicit((Object)(object)scriptedCombatEncounter))
			{
				return;
			}
			if (!bossImmunity)
			{
				if (((FixedTimeStamp)(ref bossInvulnerabilityStartTime)).hasPassed)
				{
					ExtinguishBeacons();
					SetBossImmunity(newBossImmunity: true);
					serverCycleCount++;
				}
			}
			else if (missionController.beaconsActive >= missionController.beaconsToSpawnOnMap)
			{
				SetBossImmunity(newBossImmunity: false);
				bossInvulnerabilityStartTime = FixedTimeStamp.now + shieldRemovalDuration;
			}
		}

		public void SpawnBoss()
		{
			if (!hasSpawnedBoss)
			{
				if (!Object.op_Implicit((Object)(object)scriptedCombatEncounter))
				{
					scriptedCombatEncounter = Object.Instantiate<GameObject>(GoldshoresBossfight.combatEncounterPrefab.gameObject).GetComponent<ScriptedCombatEncounter>();
					((Component)scriptedCombatEncounter).GetComponent<BossGroup>().dropPosition = missionController.bossSpawnPosition;
					NetworkServer.Spawn(((Component)scriptedCombatEncounter).gameObject);
				}
				scriptedCombatEncounter.BeginEncounter();
				hasSpawnedBoss = scriptedCombatEncounter.hasSpawnedServer;
				if (hasSpawnedBoss)
				{
					SetBossImmunity(newBossImmunity: true);
				}
			}
		}
	}
	internal static class GoldElites
	{
		private class StolenGold : MonoBehaviour
		{
			public uint amount;
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static Action<DamageReport> <0>__GlobalEventManager_onServerDamageDealt;

			public static hook_OnKilledServer <1>__DeathRewards_OnKilledServer;
		}

		public static EliteDef GoldEliteDef;

		public static EquipmentDef GoldEliteEquipment;

		private static GameObject coinImpactEffect;

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

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

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

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

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

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

		internal static void LoadAssets()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			if (EnableGoldElites.Value)
			{
				GoldEliteDef = Addressables.LoadAssetAsync<EliteDef>((object)RoR2_Junk_EliteGold.edGold_asset).WaitForCompletion();
				GoldEliteEquipment = Addressables.LoadAssetAsync<EquipmentDef>((object)RoR2_Junk_EliteGold.EliteGoldEquipment_asset).WaitForCompletion();
				coinImpactEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.CoinImpact_prefab).WaitForCompletion();
				EliteDef val = Addressables.LoadAssetAsync<EliteDef>((object)RoR2_DLC2_Elites_EliteAurelionite.edAurelionite_asset).WaitForCompletion();
				LanguageAPI.Add("GCP_ELITE_MODIFIER_GOLD", "Gold {0}");
				LanguageAPI.Add("GCP_EQUIPMENT_AFFIXGOLD_NAME", "Coven of Gold");
				LanguageAPI.Add("GCP_EQUIPMENT_AFFIXGOLD_PICKUP", "Become an aspect of wealth.");
				LanguageAPI.Add("GCP_EQUIPMENT_AFFIXGOLD_DESC", "Become an aspect of wealth. Your attacks <style=cShrine>grant gold on hit</style>, scaling with time.");
				GoldEliteDef.modifierToken = "GCP_ELITE_MODIFIER_GOLD";
				GoldEliteDef.eliteEquipmentDef = GoldEliteEquipment;
				GoldEliteDef.color = new Color32(byte.MaxValue, (byte)214, (byte)89, byte.MaxValue);
				GoldEliteDef.healthBoostCoefficient = HealthBoostCoefficient.Value;
				GoldEliteDef.damageBoostCoefficient = DamageBoostCoefficient.Value;
				if (Object.op_Implicit((Object)(object)val))
				{
					GoldEliteDef.shaderEliteRampIndex = val.shaderEliteRampIndex;
				}
				GoldEliteEquipment.nameToken = "GCP_EQUIPMENT_AFFIXGOLD_NAME";
				GoldEliteEquipment.pickupToken = "GCP_EQUIPMENT_AFFIXGOLD_PICKUP";
				GoldEliteEquipment.descriptionToken = "GCP_EQUIPMENT_AFFIXGOLD_DESC";
				GoldEliteEquipment.pickupIconSprite = GCPAssets.AffixGoldIcon;
				if (!Object.op_Implicit((Object)(object)GoldEliteEquipment.pickupModelPrefab))
				{
					GoldEliteEquipment.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Elites_EliteAurelionite.PickupAffixAurelionite_prefab).WaitForCompletion();
				}
			}
		}

		internal static void Init()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			if (EnableGoldElites.Value && Object.op_Implicit((Object)(object)GoldEliteDef) && Object.op_Implicit((Object)(object)BuffBase<AffixGold>.instance?.buffDef))
			{
				GoldEliteEquipment.passiveBuffDef = BuffBase<AffixGold>.instance.buffDef;
				EliteTierDef val = new EliteTierDef();
				val.costMultiplier = CombatDirector.baseEliteCostMultiplier * EliteCostMultiplier.Value;
				val.eliteTypes = (EliteDef[])(object)new EliteDef[1] { GoldEliteDef };
				val.isAvailable = (EliteRules rules) => (int)rules == 0 && IsGoldenCoast();
				val.canSelectWithoutAvailableEliteDef = false;
				EliteAPI.AddCustomEliteTier(val);
				GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
				object obj = <>O.<1>__DeathRewards_OnKilledServer;
				if (obj == null)
				{
					hook_OnKilledServer val2 = DeathRewards_OnKilledServer;
					<>O.<1>__DeathRewards_OnKilledServer = val2;
					obj = (object)val2;
				}
				DeathRewards.OnKilledServer += (hook_OnKilledServer)obj;
			}
		}

		private static bool IsGoldenCoast()
		{
			SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef;
			return Object.op_Implicit((Object)(object)mostRecentSceneDef) && mostRecentSceneDef.cachedName == "goldshores";
		}

		private static void GlobalEventManager_onServerDamageDealt(DamageReport report)
		{
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody attackerBody = report.attackerBody;
			if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)attackerBody.master) || report.damageInfo.procCoefficient <= 0f || !attackerBody.HasBuff(BuffBase<AffixGold>.instance.buffDef))
			{
				return;
			}
			uint num = (uint)Mathf.Max(1f, GoldStealAmount.Value * Run.instance.difficultyCoefficient * report.damageInfo.procCoefficient);
			if (attackerBody.isPlayerControlled)
			{
				attackerBody.master.GiveMoney(num);
			}
			else
			{
				CharacterMaster victimMaster = report.victimMaster;
				if (!Object.op_Implicit((Object)(object)victimMaster) || victimMaster.money == 0)
				{
					return;
				}
				num = Math.Min(num, victimMaster.money);
				victimMaster.money -= num;
				StolenGold stolenGold = ((Component)attackerBody).gameObject.GetComponent<StolenGold>() ?? ((Component)attackerBody).gameObject.AddComponent<StolenGold>();
				stolenGold.amount += num;
			}
			EffectManager.SimpleImpactEffect(coinImpactEffect, report.damageInfo.position, Vector3.up, true);
		}

		private static void DeathRewards_OnKilledServer(orig_OnKilledServer orig, DeathRewards self, DamageReport damageReport)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self.characterBody) && self.characterBody.HasBuff(BuffBase<AffixGold>.instance.buffDef))
			{
				self.goldReward = (uint)((float)self.goldReward * GoldRewardMultiplier.Value);
				StolenGold stolenGold = default(StolenGold);
				if (((Component)self).TryGetComponent<StolenGold>(ref stolenGold))
				{
					self.goldReward += stolenGold.amount;
				}
			}
			orig.Invoke(self, damageReport);
		}
	}
	internal static class LookingGlassCompat
	{
		private struct Line
		{
			public string description;

			public ValueType valueType;

			public MeasurementUnits units;

			public Line(string description, ValueType valueType, MeasurementUnits units)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				this.description = description;
				this.valueType = valueType;
				this.units = units;
			}
		}

		public const string GUID = "droppod.lookingglass";

		public static bool IsLookingGlassInstalled => Chainloader.PluginInfos.ContainsKey("droppod.lookingglass");

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static void Init()
		{
			((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)RegisterItemStats);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static ItemStatsDef Create(Line[] lines)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			ItemStatsDef val = new ItemStatsDef();
			for (int i = 0; i < lines.Length; i++)
			{
				Line line = lines[i];
				val.descriptions.Add(line.description);
				val.valueTypes.Add(line.valueType);
				val.measurementUnits.Add(line.units);
			}
			return val;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void AddItem(ItemDef item, Func<int, List<float>> values, params Line[] lines)
		{
			ItemStatsDef val = Create(lines);
			val.calculateValuesFlat = values;
			Register(item, val);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void AddChanceItem(ItemDef item, Func<float, int, List<float>> values, params Line[] lines)
		{
			ItemStatsDef val = Create(lines);
			val.hasChance = true;
			val.calculateValuesNew = (float luck, int stackCount, float procChance) => values(luck, stackCount);
			Register(item, val);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void Register(ItemDef item, ItemStatsDef def)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected I4, but got Unknown
			if (Object.op_Implicit((Object)(object)item) && (int)item.itemIndex != -1)
			{
				ItemDefinitions.allItemDefinitions[(int)item.itemIndex] = def;
			}
		}

		private static float ChanceWithLuck(float chance, float luck)
		{
			chance = Math.Min(chance, 1f);
			int num = (int)Math.Ceiling(luck);
			if (num > 0)
			{
				return 1f - (float)Math.Pow(1f - chance, num + 1);
			}
			if (num < 0)
			{
				return (float)Math.Pow(chance, -num + 1);
			}
			return chance;
		}

		private static float LaserEyeGoldTarget()
		{
			return (float)(int)(Object.op_Implicit((Object)(object)Run.instance) ? CharacterMaster.costOfSmallChest : 25) * LaserEye.EyeStacksMultiplier.Value;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void RegisterItemStats()
		{
			try
			{
				AddChanceItem(ItemBase<BigSword>.instance?.itemDef, (float luck, int count) => new List<float>(2)
				{
					ChanceWithLuck(BigSword.SwordChance.Value * 0.01f, luck),
					BigSword.SwordDamage.Value * (float)count
				}, new Line("Proc Chance: ", (ValueType)1, (MeasurementUnits)1), new Line("TOTAL Damage: ", (ValueType)1, (MeasurementUnits)1));
				AddItem(ItemBase<GoldenKnurl>.instance?.itemDef, (int count) => new List<float>(3)
				{
					GoldenKnurl.KnurlLevelHealth.Value * (float)count,
					GoldenKnurl.KnurlLevelRegen.Value * (float)count,
					GoldenKnurl.KnurlLevelArmor.Value * (float)count
				}, new Line("Health per Level: ", (ValueType)0, (MeasurementUnits)2), new Line("Regen per Level: ", (ValueType)0, (MeasurementUnits)3), new Line("Armor per Level: ", (ValueType)2, (MeasurementUnits)4));
				AddItem(ItemBase<LaserEye>.instance?.itemDef, (int count) => new List<float>(4)
				{
					LaserEye.EyeTargetsPerStack.Value * count,
					LaserEye.EyeDamage.Value,
					LaserEye.EyeMaxRange.Value,
					LaserEyeGoldTarget()
				}, new Line("Max Targets: ", (ValueType)2, (MeasurementUnits)4), new Line("BASE Damage per Target: ", (ValueType)1, (MeasurementUnits)1), new Line("Range: ", (ValueType)2, (MeasurementUnits)0), new Line("Gold to Charge: ", (ValueType)16, (MeasurementUnits)4));
				AddItem(ItemBase<HiddenGoldItem>.instance?.itemDef, (int count) => new List<float>(1) { (float)HiddenGoldItem.AurelioniteBlessingGoldGain.Value * 0.01f * (float)count }, new Line("Bonus Gold: ", (ValueType)16, (MeasurementUnits)1));
			}
			catch (Exception ex)
			{
				Log.Error("Failed to register LookingGlass item stats: " + ex);
			}
		}
	}
	internal static class SeedChanges
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_CalcTitanPowerAndBestTeam <0>__GoldTitanManager_CalcTitanPowerAndBestTeam;

			public static Manipulator <1>__GoldTitanManager_TryStartChannelingTitansServer;
		}

		private static bool spawningHostileTitan;

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

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

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

		internal static void Init()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//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_0056: Expected O, but got Unknown
			SetSeedDropWeight();
			if (EnableSeedChanges.Value)
			{
				object obj = <>O.<0>__GoldTitanManager_CalcTitanPowerAndBestTeam;
				if (obj == null)
				{
					hook_CalcTitanPowerAndBestTeam val = GoldTitanManager_CalcTitanPowerAndBestTeam;
					<>O.<0>__GoldTitanManager_CalcTitanPowerAndBestTeam = val;
					obj = (object)val;
				}
				GoldTitanManager.CalcTitanPowerAndBestTeam += (hook_CalcTitanPowerAndBestTeam)obj;
				object obj2 = <>O.<1>__GoldTitanManager_TryStartChannelingTitansServer;
				if (obj2 == null)
				{
					Manipulator val2 = GoldTitanManager_TryStartChannelingTitansServer;
					<>O.<1>__GoldTitanManager_TryStartChannelingTitansServer = val2;
					obj2 = (object)val2;
				}
				GoldTitanManager.TryStartChannelingTitansServer += (Manipulator)obj2;
				AddSeedDescription();
			}
		}

		private static void SetSeedDropWeight()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			ExplicitPickupDropTable val = Addressables.LoadAssetAsync<ExplicitPickupDropTable>((object)RoR2_Base_Titan.dtBossTitanGold_asset).WaitForCompletion();
			ItemDef val2 = Addressables.LoadAssetAsync<ItemDef>((object)RoR2_Base_TitanGoldDuringTP.TitanGoldDuringTP_asset).WaitForCompletion();
			for (int i = 0; i < val.pickupEntries.Length; i++)
			{
				if (val.pickupEntries[i].pickupDef == (Object)(object)val2)
				{
					val.pickupEntries[i].pickupWeight = SeedDropWeight.Value;
				}
			}
		}

		private static void AddSeedDescription()
		{
			int num = AllyStrengthMultiplier.Value * 100;
			LanguageAPI.Add("ITEM_TITANGOLDDURINGTP_DESC", "Summon <style=cIsDamage>Aurelionite</style> during the teleporter event. " + $"It has <style=cIsDamage>{num}%</style> <style=cStack>(+{num}% per stack)</style> <style=cIsDamage>damage</style> " + $"and <style=cIsHealing>{num}%</style> <style=cStack>(+{num}% per stack)</style> <style=cIsHealing>health</style>.");
		}

		private static void GoldTitanManager_CalcTitanPowerAndBestTeam(orig_CalcTitanPowerAndBestTeam orig, out int totalItemCount, out TeamIndex teamIndex)
		{
			orig.Invoke(ref totalItemCount, ref teamIndex);
			spawningHostileTitan = GoldTitanManager.isFalseSonBossLunarShardBrokenMaster;
			if (!spawningHostileTitan)
			{
				totalItemCount *= AllyStrengthMultiplier.Value;
			}
		}

		private static void GoldTitanManager_TryStartChannelingTitansServer(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f),
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Mathf>(x, "Pow")
			}))
			{
				int index = val.Index;
				val.Index = index - 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float exponent) => spawningHostileTitan ? exponent : 1f));
			}
			else
			{
				Log.Error("Patch failed for GoldTitanManager_TryStartChannelingTitansServer");
			}
		}
	}
}
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>{SwordChance.Value}%</style> chance on hit to summon <style=cIsDamage>Aurelionite's sword</style> to strike an enemy from underneath " + $"for <style=cIsDamage>{SwordDamage.Value * 100f}%</style> <style=cStack>(+{SwordDamage.Value * 100f}% 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 static ConfigEntry<float> SwordDropWeight { get; set; }

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

		internal override void AddItem()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_0123: 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)
			GameObject val = (GCPAssets.SwordProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldPreFistProjectile_prefab).WaitForCompletion(), "GCPSwordProjectile", true));
			ContentAddition.AddProjectile(val);
			((ProjectileExplosion)val.GetComponent<ProjectileImpactExplosion>()).blastDamageCoefficient = 1f;
			UpdateProcCoefficient();
			SwordProcCoeff.SettingChanged += delegate
			{
				UpdateProcCoefficient();
			};
			Transform modelTransform = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Titan.TitanGoldBody_prefab).WaitForCompletion().GetComponent<ModelLocator>()
				.modelTransform;
			GCPAssets.BigSwordPrefab = PrefabAPI.InstantiateClone(((Component)modelTransform.Find("TitanArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r/RightFist")).gameObject, "GCPPickupBigSword", false);
			Transform val2 = GCPAssets.BigSwordPrefab.transform.Find("Sword");
			((Component)val2).transform.localPosition = new Vector3(4f, -5.5f, 0f);
			((Component)val2).transform.localEulerAngles = new Vector3(135f, 270f, 0f);
			List<RendererInfo> list = new List<RendererInfo>();
			Renderer[] componentsInChildren = GCPAssets.BigSwordPrefab.GetComponentsInChildren<Renderer>();
			foreach (Renderer val3 in componentsInChildren)
			{
				list.Add(new RendererInfo
				{
					renderer = val3,
					defaultMaterial = val3.material
				});
			}
			GCPAssets.BigSwordPrefab.AddComponent<ItemDisplay>().rendererInfos = list.ToArray();
			ModelPanelParameters val4 = GCPAssets.BigSwordPrefab.AddComponent<ModelPanelParameters>();
			val4.focusPointTransform = GCPAssets.BigSwordPrefab.transform;
			val4.cameraPositionTransform = GCPAssets.BigSwordPrefab.transform;
			val4.maxDistance += 10f;
			val4.minDistance += 5f;
			base.AddItem();
			AddToAurelioniteDropTable(SwordDropWeight);
		}

		private static void UpdateProcCoefficient()
		{
			GCPAssets.SwordProjectile.GetComponent<ProjectileController>().procCoefficient = SwordProcCoeff.Value;
			((ProjectileExplosion)GCPAssets.SwordProjectile.GetComponent<ProjectileImpactExplosion>()).blastProcCoefficient = SwordProcCoeff.Value;
		}

		internal override void AddHooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			GameObject obj = UnityObjectExtensions.AsValidOrNull<GameObject>(damageInfo.attacker);
			CharacterBody val = ((obj != null) ? obj.GetComponent<CharacterBody>() : null);
			if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.inventory))
			{
				return;
			}
			int itemCountEffective = val.inventory.GetItemCountEffective(ItemBase<BigSword>.ItemIndex);
			if (itemCountEffective > 0 && !ProcTypeAPI.HasModdedProc(damageInfo.procChainMask, swordProcType) && Util.CheckRoll(SwordChance.Value * damageInfo.procCoefficient, val.master))
			{
				ProcChainMask procChainMask = damageInfo.procChainMask;
				ProcTypeAPI.AddModdedProc(ref procChainMask, swordProcType);
				Vector3 position = damageInfo.position;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(damageInfo.position, Vector3.down, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					position = ((RaycastHit)(ref val2)).point;
				}
				ProjectileManager obj2 = ProjectileManager.instance;
				FireProjectileInfo val3 = new FireProjectileInfo
				{
					projectilePrefab = GCPAssets.SwordProjectile,
					position = position,
					rotation = Quaternion.identity,
					procChainMask = procChainMask,
					target = victim,
					owner = damageInfo.attacker,
					damage = Util.OnHitProcDamage(damageInfo.damage, val.damage, SwordDamage.Value * (float)itemCountEffective),
					crit = damageInfo.crit,
					force = 1000f,
					damageColorIndex = (DamageColorIndex)3
				};
				((FireProjectileInfo)(ref val3)).fuseOverride = 0.5f;
				obj2.FireProjectile(val3);
			}
		}

		internal override ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_000c: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_044f: 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_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: 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_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: 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_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_0605: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: 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_0636: Unknown result type (might be due to invalid IL or missing references)
			//IL_063b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: 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_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0748: Unknown result type (might be due to invalid IL or missing references)
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0763: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_078c: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			ItemDisplayRule[] array = (ItemDisplayRule[])(object)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(array);
			ItemDisplayRuleDict val2 = val;
			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)
			};
			val2.Add(text, array2);
			ItemDisplayRuleDict val3 = val;
			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)
			};
			val3.Add(text2, array3);
			ItemDisplayRuleDict val4 = val;
			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)
			};
			val4.Add(text3, array4);
			ItemDisplayRuleDict val5 = val;
			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)
			};
			val5.Add(text4, array5);
			ItemDisplayRuleDict val6 = val;
			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)
			};
			val6.Add(text5, array6);
			ItemDisplayRuleDict val7 = val;
			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)
			};
			val7.Add(text6, array7);
			ItemDisplayRuleDict val8 = val;
			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)
			};
			val8.Add(text7, array8);
			ItemDisplayRuleDict val9 = val;
			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)
			};
			val9.Add(text8, array9);
			ItemDisplayRuleDict val10 = val;
			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)
			};
			val10.Add(text9, array10);
			ItemDisplayRuleDict val11 = val;
			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)
			};
			val11.Add(text10, array11);
			ItemDisplayRuleDict val12 = val;
			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)
			};
			val12.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 static ConfigEntry<float> KnurlDropWeight { get; set; }

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

		internal override void AddItem()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//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_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: 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>();
			foreach (Renderer val in componentsInChildren)
			{
				val.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 val2 = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.DisplayKnurl_prefab).WaitForCompletion().transform.Find("mdlKnurl")).gameObject, "GCPGoldenKnurlFollowerModel", false);
			val2.GetComponent<Renderer>().material = material;
			val2.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 val3 = PrefabAPI.InstantiateClone(((Component)Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Knurl.DisplayKnurl_prefab).WaitForCompletion().transform.Find("KnurlPebbleParticles")).gameObject, "GCPGoldenKnurlFollowerPebbles", false);
			val3.GetComponent<Renderer>().material = material;
			val3.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();
			AddToAurelioniteDropTable(KnurlDropWeight);
		}

		internal override void AddHooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			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_0026: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
			{
				int itemCountEffective = sender.inventory.GetItemCountEffective(ItemBase<GoldenKnurl>.ItemIndex);
				if (itemCountEffective > 0)
				{
					args.levelArmorAdd += KnurlLevelArmor.Value * (float)itemCountEffective;
					args.levelRegenAdd += KnurlLevelRegen.Value * (float)itemCountEffective;
					args.levelHealthAdd += KnurlLevelHealth.Value * (float)itemCountEffective;
				}
			}
		}

		internal override ItemDisplayRuleDict AddItemDisplays()
		{
			//IL_000c: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_044f: 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_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: 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_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: 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_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_0605: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: 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_0636: Unknown result type (might be d