Decompiled source of CollapseDisplay v1.3.0

plugins/CollapseDisplay/CollapseDisplay.dll

Decompiled a day ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CollapseDisplay;
using CollapseDisplay.Config;
using CollapseDisplay.Networking;
using CollapseDisplay.Properties;
using IL.RoR2.UI;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.UI;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.UI;
using Unity;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.UI;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CollapseDisplay
{
	public class AcceptableValueMin<T> : AcceptableValueBase where T : IComparable
	{
		public T MinValue { get; }

		public AcceptableValueMin(T minValue)
			: base(typeof(T))
		{
			if (minValue == null)
			{
				throw new ArgumentNullException("minValue");
			}
			MinValue = minValue;
		}

		public override object Clamp(object value)
		{
			if (MinValue.CompareTo(value) > 0)
			{
				return MinValue;
			}
			return value;
		}

		public override bool IsValid(object value)
		{
			return MinValue.CompareTo(value) <= 0;
		}

		public override string ToDescriptionString()
		{
			return $"# Acceptable value range: Greater than or equal to {MinValue}";
		}
	}
	[BepInPlugin("Gorakh.CollapseDisplay", "CollapseDisplay", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class CollapseDisplayPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "Gorakh.CollapseDisplay";

		public const string PluginAuthor = "Gorakh";

		public const string PluginName = "CollapseDisplay";

		public const string PluginVersion = "1.3.0";

		private static Sprite _healthBarHighlight;

		internal static CollapseDisplayPlugin Instance { get; private set; }

		public static DelayedDamageDisplayOptions CollapseDisplayOptions { get; private set; }

		public static DelayedDamageDisplayOptions WarpedEchoDisplayOptions { get; private set; }

		private void Awake()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_004f: 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_007e: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			Stopwatch stopwatch = Stopwatch.StartNew();
			Log.Init(((BaseUnityPlugin)this).Logger);
			Instance = SingletonHelper.Assign<CollapseDisplayPlugin>(Instance, this);
			Texture2D val = new Texture2D(1, 1);
			if (ImageConversion.LoadImage(val, Resources.HealthBarHighlight_Opaque))
			{
				_healthBarHighlight = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)1, new Vector4(4f, 3f, 3f, 4f));
				((Object)_healthBarHighlight).name = "HealthBarHighlightOpaque";
			}
			else
			{
				Log.Error("Failed to load health bar overlay texture", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\CollapseDisplayPlugin.cs", "Awake", 42);
				_healthBarHighlight = null;
			}
			Sprite highlightSprite = (Object.op_Implicit((Object)(object)_healthBarHighlight) ? _healthBarHighlight : Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texUIHighlightExecute.png").WaitForCompletion());
			CollapseDisplayOptions = new DelayedDamageDisplayOptions(highlightSprite, ((BaseUnityPlugin)this).Config, "Collapse", new Color(84f / 85f, 0.14509805f, 22f / 85f, 1f), 1f);
			WarpedEchoDisplayOptions = new DelayedDamageDisplayOptions(highlightSprite, ((BaseUnityPlugin)this).Config, "Warped Echo", new Color(54f / 85f, 0.5921569f, 47f / 85f, 1f), 1f);
			if (RiskOfOptionsCompat.Enabled)
			{
				RiskOfOptionsCompat.Initialize();
			}
			HealthBarTypeRegistration.Initialize();
			HealthBarHooks.Initialize();
			DelayedDamageProviderHooks.Initialize();
			stopwatch.Stop();
			Log.Info_NoCallerPrefix($"Initialized in {stopwatch.Elapsed.TotalSeconds:F2} seconds");
		}

		private void OnDestroy()
		{
			HealthBarTypeRegistration.Cleanup();
			HealthBarHooks.Cleanup();
			DelayedDamageProviderHooks.Cleanup();
			Instance = SingletonHelper.Unassign<CollapseDisplayPlugin>(Instance, this);
		}
	}
	public struct DelayedDamageInfo : IEquatable<DelayedDamageInfo>
	{
		public static readonly DelayedDamageInfo None = new DelayedDamageInfo(-1f, FixedTimeStamp.negativeInfinity);

		public float Damage;

		public Net_RunFixedTimeStampWrapper Wrap_DamageTimestamp;

		public FixedTimeStamp DamageTimestamp
		{
			readonly get
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return Wrap_DamageTimestamp;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Wrap_DamageTimestamp = value;
			}
		}

		public DelayedDamageInfo()
		{
			Damage = 0f;
			Wrap_DamageTimestamp = default(Net_RunFixedTimeStampWrapper);
		}

		public DelayedDamageInfo(float damage, FixedTimeStamp damageTimestamp)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			Damage = damage;
			Wrap_DamageTimestamp = damageTimestamp;
		}

		public readonly bool Equals(DelayedDamageInfo other)
		{
			if (Damage == other.Damage)
			{
				return Wrap_DamageTimestamp.Equals(other.Wrap_DamageTimestamp);
			}
			return false;
		}
	}
	[DisallowMultipleComponent]
	public class DelayedDamageProvider : NetworkBehaviour
	{
		[SyncVar]
		private DelayedDamageInfo _collapseDamage;

		[SyncVar]
		private DelayedDamageInfo _warpedEchoDamage;

		private CharacterBody _body;

		private HealthComponent _healthComponent;

		public DelayedDamageInfo CollapseDamage => _collapseDamage;

		public DelayedDamageInfo WarpedEchoDamage => _warpedEchoDamage;

		public DelayedDamageInfo Network_collapseDamage
		{
			get
			{
				return _collapseDamage;
			}
			[param: In]
			set
			{
				((NetworkBehaviour)this).SetSyncVar<DelayedDamageInfo>(value, ref _collapseDamage, 1u);
			}
		}

		public DelayedDamageInfo Network_warpedEchoDamage
		{
			get
			{
				return _warpedEchoDamage;
			}
			[param: In]
			set
			{
				((NetworkBehaviour)this).SetSyncVar<DelayedDamageInfo>(value, ref _warpedEchoDamage, 2u);
			}
		}

		private void Awake()
		{
			_body = ((Component)this).GetComponent<CharacterBody>();
			_healthComponent = ((Component)this).GetComponent<HealthComponent>();
		}

		private void FixedUpdate()
		{
			if (NetworkServer.active)
			{
				fixedUpdateServer();
			}
		}

		[Server]
		private void fixedUpdateServer()
		{
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Invalid comparison between Unknown and I4
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				Debug.LogWarning((object)"[Server] function 'System.Void CollapseDisplay.DelayedDamageProvider::fixedUpdateServer()' called on client");
				return;
			}
			DelayedDamageInfo none = DelayedDamageInfo.None;
			DelayedDamageInfo none2 = DelayedDamageInfo.None;
			if (Object.op_Implicit((Object)(object)_body))
			{
				if (Object.op_Implicit((Object)(object)_healthComponent) && _healthComponent.alive)
				{
					DotController val = DotController.FindDotController(((Component)this).gameObject);
					if (Object.op_Implicit((Object)(object)val) && val.HasDotActive((DotIndex)8))
					{
						float num = float.PositiveInfinity;
						none.Damage = 0f;
						foreach (DotStack dotStack in val.dotStackList)
						{
							if ((int)dotStack.dotIndex == 8)
							{
								num = Mathf.Min(num, dotStack.timer);
								float damage = dotStack.damage;
								DamageInfo damageInfo = new DamageInfo
								{
									attacker = dotStack.attackerObject,
									damage = damage
								};
								modifyIncomingDamage(ref damage, damageInfo);
								if (damage > 0f)
								{
									none.Damage += damage;
								}
							}
						}
						if (float.IsInfinity(num))
						{
							num = 0f;
						}
						none.DamageTimestamp = FixedTimeStamp.now + num;
					}
				}
				if (_body.incomingDamageList.Count > 0)
				{
					float num2 = float.PositiveInfinity;
					none2.Damage = 0f;
					foreach (DelayedDamageInfo incomingDamage in _body.incomingDamageList)
					{
						num2 = Mathf.Min(num2, incomingDamage.timeUntilDamage);
						DamageInfo halfDamage = incomingDamage.halfDamage;
						float damage2 = halfDamage.damage;
						modifyIncomingDamage(ref damage2, halfDamage);
						if (damage2 > 0f)
						{
							none2.Damage += damage2;
						}
					}
					if (float.IsInfinity(num2))
					{
						num2 = 0f;
					}
					none2.DamageTimestamp = FixedTimeStamp.now + num2;
				}
			}
			Network_collapseDamage = none;
			Network_warpedEchoDamage = none2;
		}

		private void modifyIncomingDamage(ref float damage, DamageInfo damageInfo)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			TeamIndex objectTeam = TeamComponent.GetObjectTeam(damageInfo.attacker);
			if (objectTeam == _body.teamComponent.teamIndex)
			{
				TeamDef teamDef = TeamCatalog.GetTeamDef(objectTeam);
				if (teamDef != null)
				{
					damage *= teamDef.friendlyFireScaling;
				}
			}
			CharacterBody val = default(CharacterBody);
			if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<CharacterBody>(ref val) && Object.op_Implicit((Object)(object)val.inventory))
			{
				if (_healthComponent.combinedHealth > _healthComponent.fullCombinedHealth * 0.9f)
				{
					int itemCount = val.inventory.GetItemCount(Items.Crowbar);
					if (itemCount > 0)
					{
						damage *= 1f + 0.75f * (float)itemCount;
					}
				}
				int itemCount2 = val.inventory.GetItemCount(Items.NearbyDamageBonus);
				if (itemCount2 > 0)
				{
					Vector3 val2 = val.corePosition - _body.corePosition;
					if (((Vector3)(ref val2)).sqrMagnitude <= 169f)
					{
						damage *= 1f + (float)itemCount2 * 0.2f;
					}
				}
				int itemCount3 = val.inventory.GetItemCount(Items.FragileDamageBonus);
				if (itemCount3 > 0)
				{
					damage *= 1f + (float)itemCount3 * 0.2f;
				}
				if (val.HasBuff(Buffs.LowerHealthHigherDamageBuff))
				{
					int itemCount4 = val.inventory.GetItemCount(Items.LowerHealthHigherDamage);
					damage *= 1f + (float)itemCount4 * 0.2f;
				}
				if (_body.isBoss)
				{
					int itemCount5 = val.inventory.GetItemCount(Items.BossDamageBonus);
					if (itemCount5 > 0)
					{
						damage *= 1f + 0.2f * (float)itemCount5;
					}
				}
			}
			if (_body.HasBuff(Buffs.DeathMark))
			{
				damage *= 1.5f;
			}
			float num = _body.armor + _healthComponent.adaptiveArmorValue;
			float num2 = ((num >= 0f) ? (1f - num / (num + 100f)) : (2f - 100f / (100f - num)));
			damage = Mathf.Max(1f, damage * num2);
			if (Object.op_Implicit((Object)(object)_body.inventory))
			{
				int itemCount6 = _body.inventory.GetItemCount(Items.ArmorPlate);
				if (itemCount6 > 0)
				{
					damage = Mathf.Max(1f, damage - 5f * (float)itemCount6);
				}
			}
			if (_body.hasOneShotProtection)
			{
				float num3 = (_healthComponent.fullCombinedHealth + _healthComponent.barrier) * (1f - _body.oneShotProtectionFraction);
				float num4 = Mathf.Max(0f, num3 - _healthComponent.serverDamageTakenThisUpdate);
				damage = Mathf.Min(damage, num4);
			}
			if (_body.HasBuff(Buffs.LunarShell) && damage > _healthComponent.fullHealth * 0.1f)
			{
				damage = _healthComponent.fullHealth * 0.1f;
			}
			if (Object.op_Implicit((Object)(object)_body.inventory))
			{
				int itemCount7 = _body.inventory.GetItemCount(Items.MinHealthPercentage);
				if (itemCount7 > 0)
				{
					float num5 = _healthComponent.fullCombinedHealth * ((float)itemCount7 / 100f);
					damage = Mathf.Max(0f, Mathf.Min(damage, _healthComponent.combinedHealth - num5));
				}
			}
			if (!damageInfo.delayedDamageSecondHalf && _body.HasBuff(Buffs.DelayedDamageBuff))
			{
				damage *= 0.5f;
			}
		}

		private void UNetVersion()
		{
		}

		public override bool OnSerialize(NetworkWriter writer, bool forceAll)
		{
			if (forceAll)
			{
				GeneratedNetworkCode._WriteDelayedDamageInfo_None(writer, _collapseDamage);
				GeneratedNetworkCode._WriteDelayedDamageInfo_None(writer, _warpedEchoDamage);
				return true;
			}
			bool flag = false;
			if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0)
			{
				if (!flag)
				{
					writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
					flag = true;
				}
				GeneratedNetworkCode._WriteDelayedDamageInfo_None(writer, _collapseDamage);
			}
			if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0)
			{
				if (!flag)
				{
					writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
					flag = true;
				}
				GeneratedNetworkCode._WriteDelayedDamageInfo_None(writer, _warpedEchoDamage);
			}
			if (!flag)
			{
				writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
			}
			return flag;
		}

		public override void OnDeserialize(NetworkReader reader, bool initialState)
		{
			if (initialState)
			{
				_collapseDamage = GeneratedNetworkCode._ReadDelayedDamageInfo_None(reader);
				_warpedEchoDamage = GeneratedNetworkCode._ReadDelayedDamageInfo_None(reader);
				return;
			}
			int num = (int)reader.ReadPackedUInt32();
			if (((uint)num & (true ? 1u : 0u)) != 0)
			{
				_collapseDamage = GeneratedNetworkCode._ReadDelayedDamageInfo_None(reader);
			}
			if (((uint)num & 2u) != 0)
			{
				_warpedEchoDamage = GeneratedNetworkCode._ReadDelayedDamageInfo_None(reader);
			}
		}
	}
	internal static class DelayedDamageProviderHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__HealthComponent_Awake;
		}

		public static void Initialize()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthComponent_Awake;
			if (obj == null)
			{
				hook_Awake val = HealthComponent_Awake;
				<>O.<0>__HealthComponent_Awake = val;
				obj = (object)val;
			}
			HealthComponent.Awake += (hook_Awake)obj;
		}

		public static void Cleanup()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthComponent_Awake;
			if (obj == null)
			{
				hook_Awake val = HealthComponent_Awake;
				<>O.<0>__HealthComponent_Awake = val;
				obj = (object)val;
			}
			HealthComponent.Awake -= (hook_Awake)obj;
		}

		private static void HealthComponent_Awake(orig_Awake orig, HealthComponent self)
		{
			orig.Invoke(self);
			((Component)self).gameObject.AddComponent<DelayedDamageProvider>();
		}
	}
	internal static class HealthBarHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__HealthBar_ApplyBars;

			public static Func<HealthBar, BarInfo[]> <1>__getDelayDamageBarInfos;

			public static Func<int, BarInfo[], int> <2>__addDamageDisplayBarsToCount;
		}

		public static void Initialize()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthBar_ApplyBars;
			if (obj == null)
			{
				Manipulator val = HealthBar_ApplyBars;
				<>O.<0>__HealthBar_ApplyBars = val;
				obj = (object)val;
			}
			HealthBar.ApplyBars += (Manipulator)obj;
		}

		public static void Cleanup()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthBar_ApplyBars;
			if (obj == null)
			{
				Manipulator val = HealthBar_ApplyBars;
				<>O.<0>__HealthBar_ApplyBars = val;
				obj = (object)val;
			}
			HealthBar.ApplyBars -= (Manipulator)obj;
		}

		private static void HealthBar_ApplyBars(ILContext il)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MethodReference handleBarMethod = null;
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref handleBarMethod) && ((MemberReference)handleBarMethod).Name.StartsWith("<ApplyBars>g__HandleBar|")
			}))
			{
				int localsVarIndex = -1;
				if (val.TryGotoPrev(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref localsVarIndex)
				}))
				{
					VariableDefinition val2 = il.Method.Body.Variables[localsVarIndex];
					val.Index = 0;
					VariableDefinition val3 = new VariableDefinition(il.Import(typeof(BarInfo[])));
					il.Method.Body.Variables.Add(val3);
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Func<HealthBar, BarInfo[]>>((Func<HealthBar, BarInfo[]>)getDelayDamageBarInfos);
					val.Emit(OpCodes.Stloc, val3);
					if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BarInfoCollection>(x, "GetActiveCount")
					}))
					{
						val.Emit(OpCodes.Ldloc, val3);
						val.EmitDelegate<Func<int, BarInfo[], int>>((Func<int, BarInfo[], int>)addDamageDisplayBarsToCount);
						if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
						{
							(Instruction x) => ILPatternMatchingExt.MatchRet(x)
						}))
						{
							Log.Error("Failed to find patch location", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarHooks.cs", "HealthBar_ApplyBars", 196);
							return;
						}
						for (int i = 0; i < 2; i++)
						{
							val.Emit(OpCodes.Ldarg_0);
							val.Emit(OpCodes.Ldloc, val3);
							val.Emit(OpCodes.Ldc_I4, i);
							val.Emit(OpCodes.Ldelema, il.Import(typeof(BarInfo)));
							val.Emit(OpCodes.Ldloca, val2);
							val.Emit(OpCodes.Call, handleBarMethod);
						}
					}
					else
					{
						Log.Error("Failed to find bar count patch location", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarHooks.cs", "HealthBar_ApplyBars", 189);
					}
				}
				else
				{
					Log.Error("Failed to find locals variable", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarHooks.cs", "HealthBar_ApplyBars", 40);
				}
			}
			else
			{
				Log.Error("Failed to find HandleBar method", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarHooks.cs", "HealthBar_ApplyBars", 46);
			}
			static int addDamageDisplayBarsToCount(int activeCount, BarInfo[] damageDisplayBarInfos)
			{
				for (int j = 0; j < damageDisplayBarInfos.Length; j++)
				{
					if (damageDisplayBarInfos[j].enabled)
					{
						activeCount++;
					}
				}
				return activeCount;
			}
			static BarInfo[] getDelayDamageBarInfos(HealthBar healthBar)
			{
				//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)
				//IL_0049: 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_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_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_018f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_023d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0242: Unknown result type (might be due to invalid IL or missing references)
				HealthBarType barType = HealthBarType.Unknown;
				HealthBarTypeProvider healthBarTypeProvider = default(HealthBarTypeProvider);
				if (((Component)healthBar).TryGetComponent<HealthBarTypeProvider>(ref healthBarTypeProvider))
				{
					barType = healthBarTypeProvider.Type;
				}
				int barInfoIndex = 0;
				BarInfo[] barInfos = (BarInfo[])(object)new BarInfo[2];
				DelayedDamageBarStyle damageBarStyle = CollapseDisplayPlugin.CollapseDisplayOptions.GetDamageBarStyle(barType);
				BarStyle barStyle = damageBarStyle.BarStyle;
				ref BarInfo reference = ref requestBarInfo();
				reference = new BarInfo
				{
					enabled = false,
					color = barStyle.baseColor,
					sprite = barStyle.sprite,
					imageType = barStyle.imageType,
					sizeDelta = barStyle.sizeDelta,
					normalizedXMin = 0f,
					normalizedXMax = 0f
				};
				DelayedDamageBarStyle damageBarStyle2 = CollapseDisplayPlugin.WarpedEchoDisplayOptions.GetDamageBarStyle(barType);
				BarStyle barStyle2 = damageBarStyle2.BarStyle;
				ref BarInfo reference2 = ref requestBarInfo();
				reference2 = new BarInfo
				{
					enabled = false,
					color = barStyle2.baseColor,
					sprite = barStyle2.sprite,
					imageType = barStyle2.imageType,
					sizeDelta = barStyle2.sizeDelta,
					normalizedXMin = 0f,
					normalizedXMax = 0f
				};
				if (barInfoIndex != 2)
				{
					Log.Error($"Missing registered bars, expected {2}, registered {barInfoIndex}", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarHooks.cs", "HealthBar_ApplyBars", 109);
				}
				HealthComponent source = healthBar.source;
				DelayedDamageProvider delayedDamageProvider = default(DelayedDamageProvider);
				float currentHealth;
				float fullCombinedHealth;
				float nonCurseFraction;
				float totalBarDamageAmount;
				if (Object.op_Implicit((Object)(object)source) && ((Component)source).TryGetComponent<DelayedDamageProvider>(ref delayedDamageProvider))
				{
					HealthBarValues healthBarValues = source.GetHealthBarValues();
					currentHealth = source.combinedHealth;
					fullCombinedHealth = source.fullCombinedHealth;
					nonCurseFraction = 1f - healthBarValues.curseFraction;
					totalBarDamageAmount = 0f;
					FixedTimeStamp damageTimestamp;
					if (damageBarStyle2.EnabledConfig.Value)
					{
						DelayedDamageInfo warpedEchoDamage = delayedDamageProvider.WarpedEchoDamage;
						damageTimestamp = warpedEchoDamage.DamageTimestamp;
						if (((FixedTimeStamp)(ref damageTimestamp)).timeUntil > 0f)
						{
							float num = warpedEchoDamage.Damage - source.barrier;
							if (num > 0f)
							{
								addBar(ref reference2, num);
							}
						}
					}
					if (damageBarStyle.EnabledConfig.Value)
					{
						DelayedDamageInfo collapseDamage = delayedDamageProvider.CollapseDamage;
						damageTimestamp = collapseDamage.DamageTimestamp;
						if (((FixedTimeStamp)(ref damageTimestamp)).timeUntil > 0f)
						{
							float num2 = collapseDamage.Damage - source.barrier;
							if (num2 > 0f)
							{
								addBar(ref reference, num2);
							}
						}
					}
				}
				return barInfos;
				void addBar(ref BarInfo barInfo, float damageAmount)
				{
					barInfo.enabled = true;
					float num3 = (currentHealth - totalBarDamageAmount - damageAmount) / fullCombinedHealth * nonCurseFraction;
					barInfo.normalizedXMin = Mathf.Clamp01(num3);
					float num4 = (currentHealth - totalBarDamageAmount) / fullCombinedHealth * nonCurseFraction;
					barInfo.normalizedXMax = Mathf.Clamp01(num4);
					totalBarDamageAmount += damageAmount;
				}
				ref BarInfo requestBarInfo()
				{
					return ref barInfos[barInfoIndex++];
				}
			}
		}
	}
	public enum HealthBarType
	{
		Unknown,
		Hud,
		Combat,
		AllyList,
		Count
	}
	public class HealthBarTypeProvider : MonoBehaviour
	{
		public HealthBarType Type;
	}
	internal static class HealthBarTypeRegistration
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__HealthBar_Awake;
		}

		private static readonly HealthBarStyle _combatHealthBarStyle = Addressables.LoadAssetAsync<HealthBarStyle>((object)"RoR2/Base/Common/CombatHealthBar.asset").WaitForCompletion();

		private static readonly List<HealthBarTypeProvider> _addedPrefabProviders = new List<HealthBarTypeProvider>();

		public static void Initialize()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthBar_Awake;
			if (obj == null)
			{
				hook_Awake val = HealthBar_Awake;
				<>O.<0>__HealthBar_Awake = val;
				obj = (object)val;
			}
			HealthBar.Awake += (hook_Awake)obj;
			registerHealthBarPrefab("RoR2/Base/UI/HUDSimple.prefab", HealthBarType.Hud);
			registerHealthBarPrefab("RoR2/Base/UI/CombatHealthbar.prefab", HealthBarType.Combat);
			registerHealthBarPrefab("RoR2/Base/UI/AllyCard.prefab", HealthBarType.AllyList);
			static void registerHealthBarPrefab(string assetPath, HealthBarType type)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)assetPath).WaitForCompletion();
				if (!Object.op_Implicit((Object)(object)val2))
				{
					Log.Error("Invalid asset path '" + assetPath + "'", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarTypeRegistration.cs", "Initialize", 23);
				}
				else
				{
					int num = 0;
					HealthBar[] componentsInChildren = val2.GetComponentsInChildren<HealthBar>(true);
					foreach (HealthBar val3 in componentsInChildren)
					{
						if (!Object.op_Implicit((Object)(object)((Component)val3).GetComponent<HealthBarTypeProvider>()))
						{
							HealthBarTypeProvider healthBarTypeProvider = ((Component)val3).gameObject.AddComponent<HealthBarTypeProvider>();
							healthBarTypeProvider.Type = type;
							_addedPrefabProviders.Add(healthBarTypeProvider);
							num++;
						}
					}
					if (num == 0)
					{
						Log.Warning("No health bars found on asset '" + assetPath + "'", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarTypeRegistration.cs", "Initialize", 43);
					}
				}
			}
		}

		public static void Cleanup()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__HealthBar_Awake;
			if (obj == null)
			{
				hook_Awake val = HealthBar_Awake;
				<>O.<0>__HealthBar_Awake = val;
				obj = (object)val;
			}
			HealthBar.Awake -= (hook_Awake)obj;
			foreach (HealthBarTypeProvider addedPrefabProvider in _addedPrefabProviders)
			{
				Object.Destroy((Object)(object)addedPrefabProvider);
			}
			_addedPrefabProviders.Clear();
		}

		private static void HealthBar_Awake(orig_Awake orig, HealthBar self)
		{
			if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<HealthBarTypeProvider>()))
			{
				HealthBarType healthBarType = HealthBarType.Unknown;
				if ((Object)(object)self.style == (Object)(object)_combatHealthBarStyle)
				{
					healthBarType = HealthBarType.Combat;
				}
				Log.Info($"Health bar {self} is not registered, assuming bar type of {healthBarType}", "X:\\Git\\RoR2\\CollapseDisplay\\CollapseDisplay\\HealthBarTypeRegistration.cs", "HealthBar_Awake", 80);
				((Component)self).gameObject.AddComponent<HealthBarTypeProvider>().Type = healthBarType;
			}
			orig.Invoke(self);
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

		private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber)
		{
			int num = callerPath.LastIndexOf("CollapseDisplay\\");
			if (num >= 0)
			{
				callerPath = callerPath.Substring(num + "CollapseDisplay\\".Length);
			}
			return $"{callerPath}:{callerLineNumber} ({callerMemberName}) ";
		}

		internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Warning_NoCallerPrefix(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	internal static class RiskOfOptionsCompat
	{
		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void Initialize()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			addDisplayOptions(CollapseDisplayPlugin.CollapseDisplayOptions);
			addDisplayOptions(CollapseDisplayPlugin.WarpedEchoDisplayOptions);
			ModSettingsManager.SetModDescription("Options for Collapse Display", "Gorakh.CollapseDisplay", "Collapse Display");
			FileInfo fileInfo = null;
			DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(((BaseUnityPlugin)CollapseDisplayPlugin.Instance).Info.Location));
			do
			{
				FileInfo[] files = directoryInfo.GetFiles("icon.png", SearchOption.TopDirectoryOnly);
				if (files != null && files.Length != 0)
				{
					fileInfo = files[0];
					break;
				}
				directoryInfo = directoryInfo.Parent;
			}
			while (directoryInfo != null && !string.Equals(directoryInfo.Name, "plugins", StringComparison.OrdinalIgnoreCase));
			if (fileInfo != null)
			{
				Texture2D val = new Texture2D(256, 256);
				if (ImageConversion.LoadImage(val, File.ReadAllBytes(fileInfo.FullName)))
				{
					Sprite obj = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
					((Object)obj).name = "CollapseDisplayIcon";
					ModSettingsManager.SetModIcon(obj, "Gorakh.CollapseDisplay", "Collapse Display");
				}
			}
			static void addDamageBarStyle(DelayedDamageBarStyle damageBarStyle)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(damageBarStyle.EnabledConfig), "Gorakh.CollapseDisplay", "Collapse Display");
			}
			static void addDisplayOptions(DelayedDamageDisplayOptions displayOptions)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				//IL_0035: Expected O, but got Unknown
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				ModSettingsManager.AddOption((BaseOption)new ColorOption(displayOptions.IndicatorColor), "Gorakh.CollapseDisplay", "Collapse Display");
				ConfigEntry<float> indicatorScale = displayOptions.IndicatorScale;
				FloatFieldConfig val2 = new FloatFieldConfig();
				((NumericFieldConfig<float>)val2).Min = 0f;
				ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(indicatorScale, val2), "Gorakh.CollapseDisplay", "Collapse Display");
				addDamageBarStyle(displayOptions.HUDHealthBarStyle);
				addDamageBarStyle(displayOptions.AllyListHealthBarStyle);
				addDamageBarStyle(displayOptions.CombatHealthBarStyle);
			}
		}
	}
}
namespace CollapseDisplay.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

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

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

		internal static byte[] HealthBarHighlight_Opaque => (byte[])ResourceManager.GetObject("HealthBarHighlight_Opaque", resourceCulture);

		internal Resources()
		{
		}
	}
}
namespace CollapseDisplay.Networking
{
	public struct Net_RunFixedTimeStampWrapper : IEquatable<Net_RunFixedTimeStampWrapper>
	{
		public float t;

		public Net_RunFixedTimeStampWrapper()
		{
			t = 0f;
		}

		public readonly bool Equals(Net_RunFixedTimeStampWrapper other)
		{
			return t == other.t;
		}

		public static implicit operator FixedTimeStamp(Net_RunFixedTimeStampWrapper wrapper)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return new FixedTimeStamp(wrapper.t);
		}

		public static implicit operator Net_RunFixedTimeStampWrapper(FixedTimeStamp timeStamp)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Net_RunFixedTimeStampWrapper result = new Net_RunFixedTimeStampWrapper();
			result.t = timeStamp.t;
			return result;
		}
	}
}
namespace CollapseDisplay.Config
{
	public class DelayedDamageBarStyle
	{
		public readonly ConfigEntry<bool> EnabledConfig;

		public readonly HealthBarType BarType;

		private readonly DelayedDamageDisplayOptions _displayOptions;

		private readonly float _baseSizeDelta;

		private BarStyle _barStyle;

		public BarStyle BarStyle => _barStyle;

		public DelayedDamageBarStyle(ConfigFile file, string sectionName, HealthBarType type, BarStyle baseStyle, DelayedDamageDisplayOptions displayOptions)
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_0088: 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)
			BarType = type;
			string text = type switch
			{
				HealthBarType.Hud => "Player HUD", 
				HealthBarType.AllyList => "Ally List", 
				HealthBarType.Combat => "Enemy", 
				_ => throw new NotImplementedException($"Bar type {type} is not implemented"), 
			};
			EnabledConfig = file.Bind<bool>(sectionName, "Show on " + text, true, new ConfigDescription("If this damage indicator should display on " + text + " healthbars", (AcceptableValueBase)null, Array.Empty<object>()));
			_barStyle = baseStyle;
			_baseSizeDelta = _barStyle.sizeDelta;
			_displayOptions = displayOptions;
			_displayOptions.IndicatorColor.SettingChanged += IndicatorColor_SettingChanged;
			updateBarColor();
			_displayOptions.IndicatorScale.SettingChanged += IndicatorScale_SettingChanged;
			updateBarSizeDelta();
		}

		private void IndicatorColor_SettingChanged(object sender, EventArgs e)
		{
			updateBarColor();
		}

		private void updateBarColor()
		{
			//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)
			_barStyle.baseColor = _displayOptions.IndicatorColor.Value;
		}

		private void IndicatorScale_SettingChanged(object sender, EventArgs e)
		{
			updateBarSizeDelta();
		}

		private void updateBarSizeDelta()
		{
			_barStyle.sizeDelta = Mathf.Max(0f, _baseSizeDelta * _displayOptions.IndicatorScale.Value);
		}
	}
	public class DelayedDamageDisplayOptions
	{
		public readonly ConfigEntry<Color> IndicatorColor;

		public readonly ConfigEntry<float> IndicatorScale;

		public readonly DelayedDamageBarStyle HUDHealthBarStyle;

		public readonly DelayedDamageBarStyle AllyListHealthBarStyle;

		public readonly DelayedDamageBarStyle CombatHealthBarStyle;

		public DelayedDamageBarStyle FallbackHealthBarStyle => CombatHealthBarStyle ?? AllyListHealthBarStyle ?? HUDHealthBarStyle;

		public DelayedDamageDisplayOptions(Sprite highlightSprite, ConfigFile file, string sectionName, Color defaultColor, float defaultIndicatorScale)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			IndicatorColor = file.Bind<Color>(sectionName, "Indicator Color", defaultColor, new ConfigDescription("The color of this damage indicator", (AcceptableValueBase)null, Array.Empty<object>()));
			IndicatorScale = file.Bind<float>(sectionName, "Indicator Scale", defaultIndicatorScale, new ConfigDescription("The scale of this damage indicator", (AcceptableValueBase)null, Array.Empty<object>()));
			HUDHealthBarStyle = new DelayedDamageBarStyle(file, sectionName, HealthBarType.Hud, new BarStyle
			{
				enabled = true,
				imageType = (Type)1,
				sizeDelta = 5f,
				sprite = highlightSprite
			}, this);
			AllyListHealthBarStyle = new DelayedDamageBarStyle(file, sectionName, HealthBarType.AllyList, new BarStyle
			{
				enabled = true,
				imageType = (Type)1,
				sizeDelta = 1f,
				sprite = highlightSprite
			}, this);
			CombatHealthBarStyle = new DelayedDamageBarStyle(file, sectionName, HealthBarType.Combat, new BarStyle
			{
				enabled = true,
				imageType = (Type)1,
				sizeDelta = 1f,
				sprite = highlightSprite
			}, this);
		}

		public DelayedDamageBarStyle GetDamageBarStyle(HealthBarType barType)
		{
			return barType switch
			{
				HealthBarType.Hud => HUDHealthBarStyle, 
				HealthBarType.Combat => CombatHealthBarStyle, 
				HealthBarType.AllyList => AllyListHealthBarStyle, 
				HealthBarType.Unknown => FallbackHealthBarStyle, 
				_ => throw new NotImplementedException($"{barType} is not implemented"), 
			};
		}
	}
}
namespace Unity
{
	[StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)]
	public class GeneratedNetworkCode
	{
		public static void _WriteNet_RunFixedTimeStampWrapper_None(NetworkWriter writer, Net_RunFixedTimeStampWrapper value)
		{
			writer.Write(value.t);
		}

		public static void _WriteDelayedDamageInfo_None(NetworkWriter writer, DelayedDamageInfo value)
		{
			writer.Write(value.Damage);
			_WriteNet_RunFixedTimeStampWrapper_None(writer, value.Wrap_DamageTimestamp);
		}

		public static Net_RunFixedTimeStampWrapper _ReadNet_RunFixedTimeStampWrapper_None(NetworkReader reader)
		{
			Net_RunFixedTimeStampWrapper result = default(Net_RunFixedTimeStampWrapper);
			result.t = reader.ReadSingle();
			return result;
		}

		public static DelayedDamageInfo _ReadDelayedDamageInfo_None(NetworkReader reader)
		{
			DelayedDamageInfo result = default(DelayedDamageInfo);
			result.Damage = reader.ReadSingle();
			result.Wrap_DamageTimestamp = _ReadNet_RunFixedTimeStampWrapper_None(reader);
			return result;
		}
	}
}