Decompiled source of DaemonWeaponUtils v1.0.7

DaemonWeaponUtils.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DaemonWeaponUtilsPlugin;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using UnityEngine;
using UnityEngine.UI;

[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("DaemonWeaponUtils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DaemonWeaponUtils")]
[assembly: AssemblyTitle("DaemonWeaponUtils")]
[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
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class Colors
{
	[HarmonyPatch(typeof(Shotgun), "Shoot")]
	public class ShotgunShootPatch
	{
		[HarmonyPrefix]
		private static void Prefix()
		{
			//IL_0098: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			if (!ModConfig.customColors || !Plugin.modEnabled)
			{
				return;
			}
			int num = -1;
			if (MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().variation == 0)
			{
				num = 0;
			}
			else if (MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().variation == 1)
			{
				num = 1;
			}
			else if (MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().variation == 2)
			{
				num = 2;
			}
			Color settingColor = ModConfig.shotgunPelletColors[num];
			if (ModConfig.enableColors[1, num])
			{
				Color color = default(Color);
				((Color)(ref color))..ctor(1f, 1f, 1f);
				MeshRenderer val = default(MeshRenderer);
				if (MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().muzzleFlash.TryGetComponent<MeshRenderer>(ref val) && Object.op_Implicit((Object)(object)((Renderer)val).material) && ((Renderer)val).material.HasProperty("_Color"))
				{
					color = ((Renderer)val).material.GetColor("_Color");
				}
				settingColor = SpecialColorLogic(ModConfig.weaponSpecialColors[1, num], color, settingColor);
				ColorGameObject(MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().muzzleFlash, settingColor);
				if (ModConfig.colorMuzzleFlashes)
				{
					GameObject gameObject = ((Component)MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().muzzleFlash.transform.GetChild(0)).gameObject;
					GameObject gameObject2 = ((Component)gameObject.transform.GetChild(0)).gameObject;
					SpriteRenderer component = gameObject2.GetComponent<SpriteRenderer>();
					Sprite sprite = Sprite.Create(BigFlashTexture, new Rect(0f, 0f, (float)((Texture)BigFlashTexture).width, (float)((Texture)BigFlashTexture).height), new Vector2(0.5f, 0.5f));
					component.sprite = sprite;
					component.color = settingColor;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Projectile), "Start")]
	public class ProjectileStartpatch
	{
		[HarmonyPostfix]
		private static void Postfix(Projectile __instance)
		{
			projectiles.Add(__instance);
		}
	}

	[HarmonyPatch(typeof(Nail), "Awake")]
	public class NailAwakePatch
	{
		[HarmonyPostfix]
		private static void Postfix(Nail __instance)
		{
			nails.Add(__instance);
		}
	}

	[HarmonyPatch(typeof(Nail), "OnDestroy")]
	public class NailDestroyPatch
	{
		[HarmonyPostfix]
		private static void Postfix(Nail __instance)
		{
			nails.Remove(__instance);
		}
	}

	[HarmonyPatch(typeof(Harpoon), "Start")]
	public class HarpoonStartPatch
	{
		[HarmonyPostfix]
		private static void Postfix(Harpoon __instance)
		{
			harpoons.Add(__instance);
		}
	}

	[HarmonyPatch(typeof(Harpoon), "OnDestroy")]
	public class HarpoonDestroyPatch
	{
		[HarmonyPostfix]
		private static void Postfix(Harpoon __instance)
		{
			harpoons.Remove(__instance);
		}
	}

	[HarmonyPatch(typeof(Shotgun), "ShootSinks")]
	public class ShotgunShootSinksPatch
	{
		[HarmonyPrefix]
		private static void Prefix()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_00e5: 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)
			Color coreEjectColor = ModConfig.coreEjectColor;
			if (ModConfig.customColors && Plugin.modEnabled && ModConfig.enableColors[1, 0])
			{
				ColorGameObject(MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().muzzleFlash, coreEjectColor);
				if (ModConfig.colorMuzzleFlashes)
				{
					GameObject gameObject = ((Component)MonoSingleton<GunControl>.Instance.currentWeapon.GetComponent<Shotgun>().muzzleFlash.transform.GetChild(0)).gameObject;
					GameObject gameObject2 = ((Component)gameObject.transform.GetChild(0)).gameObject;
					SpriteRenderer component = gameObject2.GetComponent<SpriteRenderer>();
					Sprite sprite = Sprite.Create(BigFlashTexture, new Rect(0f, 0f, (float)((Texture)BigFlashTexture).width, (float)((Texture)BigFlashTexture).height), new Vector2(0.5f, 0.5f));
					component.sprite = sprite;
					component.color = coreEjectColor;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Punch), "ParryProjectile")]
	public class ParryProjectilePatch
	{
		[HarmonyPostfix]
		private static void Postfix(Projectile proj)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_00e9: 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_00f4: 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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			Color parryProjectileColor = ModConfig.parryProjectileColor;
			if (ModConfig.customColors && Plugin.modEnabled && ModConfig.parryProjectileColored)
			{
				projectiles = (Object.FindObjectsOfType(typeof(Projectile)) as Projectile[]).ToList();
				Color currentColor = default(Color);
				((Color)(ref currentColor))..ctor(1f, 1f, 1f);
				parryProjectileColor = SpecialColorLogic(ModConfig.parrySpecialColor, currentColor, parryProjectileColor);
				MeshRenderer val = default(MeshRenderer);
				if (((Component)proj).TryGetComponent<MeshRenderer>(ref val) && Object.op_Implicit((Object)(object)((Renderer)val).material) && ((Renderer)val).material.HasProperty("_Color"))
				{
					((Renderer)val).material.SetColor("_Color", parryProjectileColor);
				}
				TrailRenderer val2 = default(TrailRenderer);
				if (((Component)proj).TryGetComponent<TrailRenderer>(ref val2))
				{
					Gradient val3 = new Gradient();
					val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(parryProjectileColor, 0f),
						new GradientColorKey(parryProjectileColor, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val2.colorGradient = val3;
				}
				Light val4 = default(Light);
				if (((Component)proj).TryGetComponent<Light>(ref val4))
				{
					val4.color = parryProjectileColor;
				}
			}
		}
	}

	[HarmonyPatch(typeof(RevolverBeam), "Start")]
	public class RevolverBeamStartPatch
	{
		[HarmonyPostfix]
		private static void Postfix(RevolverBeam __instance)
		{
			if (!((Object)(object)__instance == (Object)null))
			{
				ColorRevolverBeamStart(__instance, changeWidth: true, firstTime: true);
			}
		}
	}

	[HarmonyPatch(typeof(Coin), "DelayedReflectRevolver")]
	public class CoinDelayedReflectRevolverPatch
	{
		[HarmonyPostfix]
		private static void Postfix(GameObject beam)
		{
			if (!((Object)(object)beam == (Object)null) && !((Object)(object)beam.GetComponent<RevolverBeam>() == (Object)null))
			{
				ColorRevolverBeamStart(beam.GetComponent<RevolverBeam>(), changeWidth: true, firstTime: true);
			}
		}
	}

	[HarmonyPatch(typeof(Revolver), "CheckCoinCharges")]
	public class CheckCoinChargesPatch
	{
		[HarmonyPostfix]
		private static void Postfix()
		{
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: 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_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: 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)
			if (!Plugin.modEnabled || !ModConfig.customColors || !ModConfig.enableColors[0, 1])
			{
				return;
			}
			GameObject weapon = Plugin.weapon;
			DualWield[] componentsInChildren = ((Component)MonoSingleton<GunControl>.Instance).GetComponentsInChildren<DualWield>();
			List<GameObject> list = new List<GameObject>();
			list.Add(weapon);
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if ((Object)(object)componentsInChildren[i].currentWeapon != (Object)null)
				{
					list.Add(componentsInChildren[i].currentWeapon);
				}
			}
			foreach (GameObject item in list)
			{
				if (!((Object)(object)item != (Object)null) || !((Object)(object)item.GetComponent<Revolver>() != (Object)null) || item.GetComponent<Revolver>().gunVariation != 1 || !ModConfig.coinSettingsToggle)
				{
					continue;
				}
				float num = 0f;
				for (int j = 0; j < item.GetComponent<Revolver>().coinPanels.Length; j++)
				{
					num += item.GetComponent<Revolver>().coinPanels[j].fillAmount;
				}
				for (int k = 0; k < 4; k++)
				{
					Color val = default(Color);
					if ((double)k == Math.Floor(num))
					{
						val = ModConfig.marksmanCoinChargingColor;
					}
					else if ((float)k < num)
					{
						val = ModConfig.marksmanCoinChargedColor;
						val = SpecialColorLogic(ModConfig.marksmanCoinChargedSpecialColor, new Color(1f, 1f, 1f), val);
					}
					else
					{
						val = Color.black;
					}
					((Graphic)item.GetComponent<Revolver>().coinPanels[k]).color = val;
				}
			}
		}
	}

	[HarmonyPatch(typeof(Revolver), "Update")]
	public class RevolverUpdatePatch
	{
		[HarmonyPostfix]
		private static void Postfix()
		{
			//IL_00c7: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_0102: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.modEnabled || !ModConfig.customColors || !ModConfig.enableColors[0, 0] || Plugin.weapon.GetComponent<Revolver>().gunVariation != 0)
			{
				return;
			}
			List<GameObject> list = new List<GameObject>();
			list.Add(Plugin.weapon);
			DualWield[] componentsInChildren = ((Component)MonoSingleton<GunControl>.Instance).GetComponentsInChildren<DualWield>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if ((Object)(object)componentsInChildren[i].currentWeapon != (Object)null)
				{
					list.Add(componentsInChildren[i].currentWeapon);
				}
			}
			foreach (GameObject item in list)
			{
				if (item.GetComponent<Revolver>().pierceCharge >= 100f)
				{
					Color piercerChargedAltHUDColor = ModConfig.PiercerChargedAltHUDColor;
					piercerChargedAltHUDColor = SpecialColorLogic(ModConfig.PiercerChargedAltHUDSpecialColor, new Color(1f, 1f, 1f), piercerChargedAltHUDColor);
					item.GetComponent<Revolver>().screenProps.SetColor("_Color", piercerChargedAltHUDColor);
					((Renderer)item.GetComponent<Revolver>().screenMR).SetPropertyBlock(Plugin.weapon.GetComponent<Revolver>().screenProps);
				}
			}
		}
	}

	[HarmonyPatch(typeof(RocketLauncher), "Update")]
	public class RocketLauncherUpdatePatch
	{
		[HarmonyPostfix]
		private static void Postfix()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Plugin.weapon == (Object)null || (Object)(object)Plugin.weapon.GetComponent<RocketLauncher>() == (Object)null)
			{
				return;
			}
			RocketLauncher component = Plugin.weapon.GetComponent<RocketLauncher>();
			if (!ModConfig.customColors || !Plugin.modEnabled)
			{
				return;
			}
			for (int i = 0; i < component.variationColorables.Length; i++)
			{
				if (ModConfig.enableColors[4, 0] && component.variation == 0)
				{
					Color freezeframeColor = ModConfig.freezeframeColor;
					freezeframeColor = SpecialColorLogic(ModConfig.freezeframeSpecialColor, new Color(1f, 1f, 1f), freezeframeColor);
					((Graphic)component.variationColorables[i]).color = new Color(freezeframeColor.r, freezeframeColor.g, freezeframeColor.b, component.colorablesTransparencies[i] * 1f);
				}
			}
		}
	}

	public static string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";

	public static Texture2D BigFlashTexture = new Texture2D(0, 0, (TextureFormat)20, false);

	public static Texture2D SmallFlashTexture = new Texture2D(0, 0, (TextureFormat)20, false);

	public static Texture2D PiercerAltChargeTexture = new Texture2D(0, 0, (TextureFormat)20, false);

	public static List<RevolverBeam> revolverBeams = new List<RevolverBeam>();

	public static List<Projectile> projectiles = new List<Projectile>();

	public static List<Nail> nails = new List<Nail>();

	public static List<Harpoon> harpoons = new List<Harpoon>();

	public static Texture2D ColoredPiercerAltTexture = null;

	public static Color LastPiercerAltTextureColor = Color.white;

	public static float NextTimeUpdatePiercerAltTexture = 0f;

	public static Color HSVToColor(float h, float S, float V)
	{
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		float num;
		for (num = h; num < 0f; num += 360f)
		{
		}
		while (num >= 360f)
		{
			num -= 360f;
		}
		float num4;
		float num3;
		float num2;
		if (V <= 0f)
		{
			num4 = (num3 = (num2 = 0f));
		}
		else if (S <= 0f)
		{
			num4 = (num3 = (num2 = V));
		}
		else
		{
			float num5 = num / 60f;
			int num6 = (int)Math.Floor(num5);
			float num7 = num5 - (float)num6;
			float num8 = V * (1f - S);
			float num9 = V * (1f - S * num7);
			float num10 = V * (1f - S * (1f - num7));
			switch (num6)
			{
			case 0:
				num4 = V;
				num3 = num10;
				num2 = num8;
				break;
			case 1:
				num4 = num9;
				num3 = V;
				num2 = num8;
				break;
			case 2:
				num4 = num8;
				num3 = V;
				num2 = num10;
				break;
			case 3:
				num4 = num8;
				num3 = num9;
				num2 = V;
				break;
			case 4:
				num4 = num10;
				num3 = num8;
				num2 = V;
				break;
			case 5:
				num4 = V;
				num3 = num8;
				num2 = num9;
				break;
			case 6:
				num4 = V;
				num3 = num10;
				num2 = num8;
				break;
			case -1:
				num4 = V;
				num3 = num8;
				num2 = num9;
				break;
			default:
				num4 = (num3 = (num2 = V));
				break;
			}
		}
		Color result = default(Color);
		((Color)(ref result))..ctor(num4, num3, num2);
		return result;
	}

	public static Color SpecialColorLogic(ModConfig.SpecialColorEnum sc, Color currentColor, Color settingColor, bool firstTime = false)
	{
		//IL_000a: 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_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: 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)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: 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)
		//IL_00f7: 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_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		switch (sc)
		{
		case ModConfig.SpecialColorEnum.Default:
			return settingColor;
		case ModConfig.SpecialColorEnum.RandomRainbow:
			if (currentColor == settingColor || currentColor == new Color(1f, 1f, 1f) || firstTime)
			{
				return GetRandomRainbowColor();
			}
			break;
		}
		switch (sc)
		{
		case ModConfig.SpecialColorEnum.TimeBasedRainbow:
			return GetCurrentRainbowColor();
		case ModConfig.SpecialColorEnum.Confetti:
			return GetRandomRainbowColor();
		case ModConfig.SpecialColorEnum.PulseWhite:
			return GetCurrentPulseColor(settingColor, Color.white);
		case ModConfig.SpecialColorEnum.PulseBlack:
			return GetCurrentPulseColor(settingColor, Color.black);
		case ModConfig.SpecialColorEnum.HSVRandom:
			if (currentColor == settingColor || currentColor == new Color(1f, 1f, 1f) || firstTime)
			{
				return GetRandomHSV();
			}
			break;
		}
		if (sc == ModConfig.SpecialColorEnum.RGBRandom && (currentColor == settingColor || currentColor == new Color(1f, 1f, 1f) || firstTime))
		{
			return GetRandomRGB();
		}
		return currentColor;
	}

	public static Color GetCurrentPulseColor(Color settingColor, Color pulseColor)
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		float num = 0.5f + Convert.ToSingle(Math.Sin((double)(Time.time * ModConfig.colorEffectSpeed * 2f) * Math.PI)) / 2f;
		Color result = default(Color);
		result.r = settingColor.r * (1f - num) + pulseColor.r * num;
		result.g = settingColor.g * (1f - num) + pulseColor.g * num;
		result.b = settingColor.b * (1f - num) + pulseColor.b * num;
		result.a = 1f;
		return result;
	}

	public static Color GetRandomRainbowColor()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		Random random = new Random();
		return HSVToColor(Convert.ToSingle(random.NextDouble() * 360.0), 1f, 1f);
	}

	public static Color GetCurrentRainbowColor()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: 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)
		return HSVToColor(Convert.ToSingle((double)Time.time * 360.0 * (double)ModConfig.colorEffectSpeed), 1f, 1f);
	}

	public static Color GetRandomHSV()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		Random random = new Random();
		return HSVToColor(Convert.ToSingle(random.NextDouble() * 360.0), Convert.ToSingle(random.NextDouble()), Convert.ToSingle(random.NextDouble()));
	}

	public static Color GetRandomRGB()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		Random random = new Random();
		Color result = default(Color);
		((Color)(ref result))..ctor(Convert.ToSingle(random.NextDouble()), Convert.ToSingle(random.NextDouble()), Convert.ToSingle(random.NextDouble()));
		return result;
	}

	public static void LoadImages()
	{
		ImageConversion.LoadImage(BigFlashTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "BigFlash.png") ?? ""));
		ImageConversion.LoadImage(SmallFlashTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "SmallFlash.png") ?? ""));
		ImageConversion.LoadImage(PiercerAltChargeTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "PiercerCharge.png") ?? ""));
		((Texture)BigFlashTexture).filterMode = (FilterMode)0;
		((Texture)SmallFlashTexture).filterMode = (FilterMode)0;
		((Texture)PiercerAltChargeTexture).filterMode = (FilterMode)0;
	}

	public static void ColorGameObject(GameObject gameObject, Color color)
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Expected O, but got Unknown
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: 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_00ad: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
		MeshRenderer val = default(MeshRenderer);
		if (gameObject.TryGetComponent<MeshRenderer>(ref val) && Object.op_Implicit((Object)(object)((Renderer)val).material) && ((Renderer)val).material.HasProperty("_Color"))
		{
			((Renderer)val).material.SetColor("_Color", color);
		}
		TrailRenderer val2 = default(TrailRenderer);
		if (gameObject.TryGetComponent<TrailRenderer>(ref val2))
		{
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(color, 0f),
				new GradientColorKey(color, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(1f, 0f),
				new GradientAlphaKey(0f, 1f)
			});
			val2.colorGradient = val3;
		}
		Light val4 = default(Light);
		if (gameObject.TryGetComponent<Light>(ref val4))
		{
			val4.color = color;
		}
	}

	public static void ColorEverything()
	{
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: 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)
		//IL_00e1: 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_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_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0583: Unknown result type (might be due to invalid IL or missing references)
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b81: 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)
		//IL_0603: 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_0608: Unknown result type (might be due to invalid IL or missing references)
		//IL_060d: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0404: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_023c: Expected O, but got Unknown
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_0865: Unknown result type (might be due to invalid IL or missing references)
		//IL_086a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e30: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_064f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e65: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0445: Unknown result type (might be due to invalid IL or missing references)
		//IL_0668: Unknown result type (might be due to invalid IL or missing references)
		//IL_066f: Expected O, but got Unknown
		//IL_0679: Unknown result type (might be due to invalid IL or missing references)
		//IL_0680: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Unknown result type (might be due to invalid IL or missing references)
		//IL_068c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0693: Unknown result type (might be due to invalid IL or missing references)
		//IL_0698: Unknown result type (might be due to invalid IL or missing references)
		//IL_06af: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c47: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c49: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c4c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c51: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c38: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e7a: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0476: Expected O, but got Unknown
		//IL_0480: Unknown result type (might be due to invalid IL or missing references)
		//IL_0487: Unknown result type (might be due to invalid IL or missing references)
		//IL_048c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0493: Unknown result type (might be due to invalid IL or missing references)
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_08de: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_070b: Unknown result type (might be due to invalid IL or missing references)
		//IL_079d: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0511: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ecf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed9: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_093f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c9c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1097: Unknown result type (might be due to invalid IL or missing references)
		//IL_109c: Unknown result type (might be due to invalid IL or missing references)
		//IL_109e: Unknown result type (might be due to invalid IL or missing references)
		//IL_10a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0958: Unknown result type (might be due to invalid IL or missing references)
		//IL_095f: Expected O, but got Unknown
		//IL_0969: Unknown result type (might be due to invalid IL or missing references)
		//IL_0970: Unknown result type (might be due to invalid IL or missing references)
		//IL_0975: Unknown result type (might be due to invalid IL or missing references)
		//IL_097c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0983: Unknown result type (might be due to invalid IL or missing references)
		//IL_0988: Unknown result type (might be due to invalid IL or missing references)
		//IL_099f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cb5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cbc: Expected O, but got Unknown
		//IL_0cc6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ce0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ce5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cfc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d12: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a78: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b0b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f34: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f3b: Expected O, but got Unknown
		//IL_0f45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f51: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f58: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f7b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f80: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f91: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f96: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fbe: Unknown result type (might be due to invalid IL or missing references)
		//IL_1118: Unknown result type (might be due to invalid IL or missing references)
		//IL_111a: Unknown result type (might be due to invalid IL or missing references)
		//IL_111d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1122: Unknown result type (might be due to invalid IL or missing references)
		//IL_110b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1110: Unknown result type (might be due to invalid IL or missing references)
		//IL_1159: Unknown result type (might be due to invalid IL or missing references)
		//IL_115b: Unknown result type (might be due to invalid IL or missing references)
		//IL_115e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1163: Unknown result type (might be due to invalid IL or missing references)
		//IL_114c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1151: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d5: Expected O, but got Unknown
		//IL_11df: Unknown result type (might be due to invalid IL or missing references)
		//IL_11e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_11eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_11f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_11f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_11fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_1215: Unknown result type (might be due to invalid IL or missing references)
		//IL_121a: Unknown result type (might be due to invalid IL or missing references)
		//IL_122b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1230: Unknown result type (might be due to invalid IL or missing references)
		//IL_1292: Unknown result type (might be due to invalid IL or missing references)
		//IL_1297: Unknown result type (might be due to invalid IL or missing references)
		//IL_129d: Unknown result type (might be due to invalid IL or missing references)
		//IL_12cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_12dc: Unknown result type (might be due to invalid IL or missing references)
		if (!ModConfig.customColors || !Plugin.modEnabled)
		{
			return;
		}
		Color color = default(Color);
		MeshRenderer val2 = default(MeshRenderer);
		MeshRenderer val3 = default(MeshRenderer);
		MeshRenderer val4 = default(MeshRenderer);
		MeshRenderer val5 = default(MeshRenderer);
		TrailRenderer val6 = default(TrailRenderer);
		Light val8 = default(Light);
		Color color2 = default(Color);
		MeshRenderer val9 = default(MeshRenderer);
		MeshRenderer val10 = default(MeshRenderer);
		TrailRenderer val11 = default(TrailRenderer);
		Light val13 = default(Light);
		for (int i = 0; i < projectiles.Count; i++)
		{
			Projectile val = projectiles[i];
			if ((Object)(object)val == (Object)null)
			{
				projectiles.Remove(val);
				i += -1;
			}
			else if (val.parried)
			{
				if (!ModConfig.parryProjectileColored)
				{
					continue;
				}
				Color parryProjectileColor = ModConfig.parryProjectileColor;
				((Color)(ref color))..ctor(1f, 1f, 1f);
				if (((Component)val).TryGetComponent<MeshRenderer>(ref val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material) && ((Renderer)val2).material.HasProperty("_Color"))
				{
					color = ((Renderer)val2).material.GetColor("_Color");
				}
				parryProjectileColor = SpecialColorLogic(ModConfig.parrySpecialColor, color, parryProjectileColor);
				if (((Component)val).TryGetComponent<MeshRenderer>(ref val3) && Object.op_Implicit((Object)(object)((Renderer)val3).material) && ((Renderer)val3).material.HasProperty("_Color"))
				{
					((Renderer)val3).material.SetColor("_Color", parryProjectileColor);
				}
				if (((Component)val).gameObject.transform.childCount != 0)
				{
					GameObject gameObject = ((Component)((Component)val).gameObject.transform.GetChild(0)).gameObject;
					if (gameObject.TryGetComponent<MeshRenderer>(ref val4) && Object.op_Implicit((Object)(object)((Renderer)val4).material) && ((Renderer)val4).material.HasProperty("_Color"))
					{
						((Renderer)val4).material.SetColor("_Color", parryProjectileColor);
					}
					if (gameObject.transform.childCount != 0)
					{
						GameObject gameObject2 = ((Component)gameObject.transform.GetChild(0)).gameObject;
						if (gameObject2.TryGetComponent<MeshRenderer>(ref val5) && Object.op_Implicit((Object)(object)((Renderer)val5).material) && ((Renderer)val5).material.HasProperty("_Color"))
						{
							((Renderer)val5).material.SetColor("_Color", parryProjectileColor);
						}
					}
				}
				if (((Component)val).TryGetComponent<TrailRenderer>(ref val6))
				{
					Gradient val7 = new Gradient();
					val7.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(parryProjectileColor, 0f),
						new GradientColorKey(parryProjectileColor, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val6.colorGradient = val7;
				}
				if (((Component)val).TryGetComponent<Light>(ref val8))
				{
					val8.color = parryProjectileColor;
				}
			}
			else if (val.weaponType == "shotgun0" || val.weaponType == "shotgun1" || val.weaponType == "shotgun2")
			{
				int num = -1;
				if (val.weaponType == "shotgun0")
				{
					num = 0;
				}
				else if (val.weaponType == "shotgun1")
				{
					num = 1;
				}
				else if (val.weaponType == "shotgun2")
				{
					num = 2;
				}
				Color settingColor = ModConfig.shotgunPelletColors[num];
				if (!ModConfig.enableColors[1, num])
				{
					break;
				}
				((Color)(ref color2))..ctor(1f, 1f, 1f);
				if (((Component)val).TryGetComponent<MeshRenderer>(ref val9) && Object.op_Implicit((Object)(object)((Renderer)val9).material) && ((Renderer)val9).material.HasProperty("_Color"))
				{
					color2 = ((Renderer)val9).material.GetColor("_Color");
				}
				settingColor = SpecialColorLogic(ModConfig.weaponSpecialColors[1, num], color2, settingColor);
				if (((Component)val).TryGetComponent<MeshRenderer>(ref val10) && Object.op_Implicit((Object)(object)((Renderer)val10).material) && ((Renderer)val10).material.HasProperty("_Color"))
				{
					((Renderer)val10).material.SetColor("_Color", settingColor);
					((Renderer)val10).material.mainTexture = (Texture)(object)Texture2D.whiteTexture;
				}
				if (((Component)val).TryGetComponent<TrailRenderer>(ref val11))
				{
					Gradient val12 = new Gradient();
					val12.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(settingColor, 0f),
						new GradientColorKey(settingColor, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val11.colorGradient = val12;
				}
				if (((Component)val).TryGetComponent<Light>(ref val13))
				{
					val13.color = settingColor;
				}
				ColorGameObject(val.sourceWeapon.GetComponent<Shotgun>().muzzleFlash, settingColor);
			}
		}
		Color color3 = default(Color);
		MeshRenderer val14 = default(MeshRenderer);
		MeshRenderer val15 = default(MeshRenderer);
		TrailRenderer val16 = default(TrailRenderer);
		Light val18 = default(Light);
		Color color4 = default(Color);
		Color color5 = default(Color);
		MeshRenderer val19 = default(MeshRenderer);
		MeshRenderer val20 = default(MeshRenderer);
		TrailRenderer val21 = default(TrailRenderer);
		Light val23 = default(Light);
		foreach (Grenade grenade in MonoSingleton<ObjectTracker>.Instance.grenadeList)
		{
			if ((Object)(object)grenade != (Object)null && ((Object)grenade).name == "Grenade(Clone)")
			{
				Color coreEjectColor = ModConfig.coreEjectColor;
				if (!ModConfig.enableColors[1, 0])
				{
					break;
				}
				((Color)(ref color3))..ctor(1f, 1f, 1f);
				if (((Component)grenade).TryGetComponent<MeshRenderer>(ref val14) && Object.op_Implicit((Object)(object)((Renderer)val14).material) && ((Renderer)val14).material.HasProperty("_Color"))
				{
					color3 = ((Renderer)val14).material.GetColor("_Color");
				}
				coreEjectColor = SpecialColorLogic(ModConfig.coreEjectSpecialColor, color3, coreEjectColor);
				if (((Component)grenade).TryGetComponent<MeshRenderer>(ref val15) && Object.op_Implicit((Object)(object)((Renderer)val15).material) && ((Renderer)val15).material.HasProperty("_Color"))
				{
					((Renderer)val15).material.SetColor("_Color", coreEjectColor);
				}
				if (((Component)grenade).TryGetComponent<TrailRenderer>(ref val16))
				{
					Gradient val17 = new Gradient();
					val17.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(coreEjectColor, 0f),
						new GradientColorKey(coreEjectColor, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val16.colorGradient = val17;
				}
				if (((Component)grenade).TryGetComponent<Light>(ref val18))
				{
					val18.color = coreEjectColor;
				}
				((Color)(ref color4))..ctor(coreEjectColor.r, coreEjectColor.g, coreEjectColor.b, Convert.ToSingle(1.100000023841858 * Math.Sin((double)(Time.time * 30f * 2f) * Math.PI)));
				GameObject gameObject3 = ((Component)((Component)grenade).transform.GetChild(1)).gameObject;
				GameObject gameObject4 = ((Component)gameObject3.transform.GetChild(0)).gameObject;
				SpriteRenderer component = gameObject4.GetComponent<SpriteRenderer>();
				Sprite sprite = Sprite.Create(BigFlashTexture, new Rect(0f, 0f, (float)((Texture)BigFlashTexture).width, (float)((Texture)BigFlashTexture).height), new Vector2(0.5f, 0.5f));
				component.sprite = sprite;
				component.color = color4;
			}
			else if ((Object)(object)grenade != (Object)null && ((Object)grenade).name == "Rocket(Clone)")
			{
				int num2 = -1;
				if (grenade.sourceWeapon.GetComponent<RocketLauncher>().variation == 0)
				{
					num2 = 0;
				}
				else if (grenade.sourceWeapon.GetComponent<RocketLauncher>().variation == 1)
				{
					num2 = 1;
				}
				else if (grenade.sourceWeapon.GetComponent<RocketLauncher>().variation == 2)
				{
					num2 = 2;
				}
				Color settingColor2 = ModConfig.rocketLauncherRocketColors[num2];
				if (!ModConfig.enableColors[4, num2])
				{
					break;
				}
				((Color)(ref color5))..ctor(1f, 1f, 1f);
				if (((Component)grenade).TryGetComponent<MeshRenderer>(ref val19) && Object.op_Implicit((Object)(object)((Renderer)val19).material) && ((Renderer)val19).material.HasProperty("_Color"))
				{
					color5 = ((Renderer)val19).material.GetColor("_Color");
				}
				settingColor2 = SpecialColorLogic(ModConfig.weaponSpecialColors[4, num2], color5, settingColor2);
				if (((Component)grenade).TryGetComponent<MeshRenderer>(ref val20) && Object.op_Implicit((Object)(object)((Renderer)val20).material) && ((Renderer)val20).material.HasProperty("_Color"))
				{
					((Renderer)val20).material.SetColor("_Color", settingColor2);
				}
				if (((Component)grenade).TryGetComponent<TrailRenderer>(ref val21))
				{
					Gradient val22 = new Gradient();
					val22.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(settingColor2, 0f),
						new GradientColorKey(settingColor2, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val21.colorGradient = val22;
				}
				if (((Component)grenade).TryGetComponent<Light>(ref val23))
				{
					val23.color = settingColor2;
				}
				GameObject gameObject5 = ((Component)((Component)grenade).transform.GetChild(1)).gameObject;
				GameObject gameObject6 = ((Component)gameObject5.transform.GetChild(0)).gameObject;
				SpriteRenderer component2 = gameObject6.GetComponent<SpriteRenderer>();
				component2.color = settingColor2;
				GameObject freezeEffect = grenade.freezeEffect;
				GameObject gameObject7 = ((Component)freezeEffect.transform.GetChild(0)).gameObject;
				GameObject gameObject8 = ((Component)gameObject7.transform.GetChild(0)).gameObject;
				((Behaviour)gameObject7.GetComponent<SpriteGetVariationColor>()).enabled = false;
				Color freezeframeColor = ModConfig.freezeframeColor;
				freezeframeColor = SpecialColorLogic(ModConfig.freezeframeSpecialColor, gameObject8.GetComponent<SpriteRenderer>().color, freezeframeColor);
				gameObject8.GetComponent<SpriteRenderer>().color = freezeframeColor;
				GameObject gameObject9 = ((Component)gameObject8.transform.GetChild(0)).gameObject;
				GameObject gameObject10 = ((Component)gameObject8.transform.GetChild(1)).gameObject;
				GameObject gameObject11 = ((Component)gameObject8.transform.GetChild(2)).gameObject;
				GameObject gameObject12 = ((Component)gameObject8.transform.GetChild(3)).gameObject;
				gameObject9.GetComponent<SpriteRenderer>().color = freezeframeColor;
				gameObject10.GetComponent<SpriteRenderer>().color = freezeframeColor;
				gameObject11.GetComponent<SpriteRenderer>().color = freezeframeColor;
				gameObject12.GetComponent<SpriteRenderer>().color = freezeframeColor;
			}
		}
		Color color6 = default(Color);
		MeshRenderer val26 = default(MeshRenderer);
		MeshRenderer val27 = default(MeshRenderer);
		TrailRenderer val28 = default(TrailRenderer);
		Light val30 = default(Light);
		for (int j = 0; j < harpoons.Count; j++)
		{
			Harpoon val24 = harpoons[j];
			if ((Object)(object)val24 == (Object)null)
			{
				harpoons.Remove(val24);
				j += -1;
				continue;
			}
			Color val25 = default(Color);
			if ((Object)(object)val24.sourceWeapon != (Object)null && (Object)(object)val24.sourceWeapon.GetComponent<Railcannon>() != (Object)null)
			{
				val25 = ModConfig.railcannonBeamColors[1];
				if (!ModConfig.enableColors[3, 1])
				{
					break;
				}
				((Color)(ref color6))..ctor(1f, 1f, 1f);
				if (((Component)val24).TryGetComponent<MeshRenderer>(ref val26) && Object.op_Implicit((Object)(object)((Renderer)val26).material) && ((Renderer)val26).material.HasProperty("_Color"))
				{
					color6 = ((Renderer)val26).material.GetColor("_Color");
				}
				val25 = SpecialColorLogic(ModConfig.weaponSpecialColors[3, 1], color6, val25);
				if (((Component)val24).TryGetComponent<MeshRenderer>(ref val27) && Object.op_Implicit((Object)(object)((Renderer)val27).material) && ((Renderer)val27).material.HasProperty("_Color"))
				{
					((Renderer)val27).material.SetColor("_Color", val25);
				}
				if (((Component)val24).TryGetComponent<TrailRenderer>(ref val28))
				{
					Gradient val29 = new Gradient();
					val29.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(val25, 0f),
						new GradientColorKey(val25, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val28.colorGradient = val29;
				}
				if (((Component)val24).TryGetComponent<Light>(ref val30))
				{
					val30.color = val25;
				}
			}
		}
		MeshRenderer val32 = default(MeshRenderer);
		TrailRenderer val33 = default(TrailRenderer);
		Light val35 = default(Light);
		for (int k = 0; k < nails.Count; k++)
		{
			Nail val31 = nails[k];
			if ((Object)(object)val31 == (Object)null)
			{
				nails.Remove(val31);
				k += -1;
				continue;
			}
			int num3 = -1;
			if ((Object)(object)val31.sourceWeapon.GetComponent<Nailgun>() != (Object)null)
			{
				if (val31.sourceWeapon.GetComponent<Nailgun>().variation == 1)
				{
					num3 = 0;
				}
				else if (val31.sourceWeapon.GetComponent<Nailgun>().variation == 0)
				{
					num3 = 1;
				}
				else if (val31.sourceWeapon.GetComponent<Nailgun>().variation == 2)
				{
					num3 = 2;
				}
				Color settingColor3 = ModConfig.nailgunNailColors[num3];
				if (!ModConfig.enableColors[2, num3])
				{
					break;
				}
				Color color7 = ((Component)val31).GetComponent<TrailRenderer>().colorGradient.colorKeys[0].color;
				if (color7.r < 0.01f && Math.Abs(color7.g - 0.8745f) < 0.01f && color7.b > 0.99f)
				{
					((Color)(ref color7))..ctor(1f, 1f, 1f);
				}
				settingColor3 = SpecialColorLogic(ModConfig.weaponSpecialColors[2, num3], color7, settingColor3);
				if (((Component)val31).TryGetComponent<MeshRenderer>(ref val32) && Object.op_Implicit((Object)(object)((Renderer)val32).material) && ((Renderer)val32).material.HasProperty("_Color"))
				{
					((Renderer)val32).material.SetColor("_Color", settingColor3);
				}
				if (((Component)val31).TryGetComponent<TrailRenderer>(ref val33))
				{
					Gradient val34 = new Gradient();
					val34.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(settingColor3, 0f),
						new GradientColorKey(settingColor3, 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(1f, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					val33.colorGradient = val34;
				}
				if (((Component)val31).TryGetComponent<Light>(ref val35))
				{
					val35.color = settingColor3;
				}
				ColorGameObject(val31.sourceWeapon.GetComponent<Nailgun>().muzzleFlash, settingColor3);
				ColorGameObject(val31.sourceWeapon.GetComponent<Nailgun>().muzzleFlash2, settingColor3);
			}
		}
		foreach (Cannonball cannonball in MonoSingleton<ObjectTracker>.Instance.cannonballList)
		{
		}
		Color color8 = default(Color);
		MeshRenderer val36 = default(MeshRenderer);
		Color startColor = default(Color);
		TrailRenderer val37 = default(TrailRenderer);
		MeshRenderer val38 = default(MeshRenderer);
		TrailRenderer val39 = default(TrailRenderer);
		foreach (Coin revolverCoins in MonoSingleton<CoinList>.Instance.revolverCoinsList)
		{
			if (!ModConfig.coinSettingsToggle || !ModConfig.enableColors[0, 1])
			{
				break;
			}
			Color coinColor = ModConfig.coinColor;
			Color coinTrailColor = ModConfig.coinTrailColor;
			((Color)(ref color8))..ctor(1f, 1f, 1f);
			if (((Component)((Component)revolverCoins).transform.GetChild(0)).gameObject.TryGetComponent<MeshRenderer>(ref val36) && Object.op_Implicit((Object)(object)((Renderer)val36).material) && ((Renderer)val36).material.HasProperty("_Color"))
			{
				color8 = ((Renderer)val36).material.GetColor("_Color");
			}
			coinColor = SpecialColorLogic(ModConfig.coinEntitySpecialColor, color8, coinColor);
			((Color)(ref startColor))..ctor(1f, 1f, 1f);
			if (((Component)revolverCoins).TryGetComponent<TrailRenderer>(ref val37))
			{
				startColor = val37.startColor;
			}
			coinTrailColor = SpecialColorLogic(ModConfig.coinTrailSpecialColor, startColor, coinTrailColor);
			if (((Component)((Component)revolverCoins).transform.GetChild(0)).gameObject.TryGetComponent<MeshRenderer>(ref val38) && Object.op_Implicit((Object)(object)((Renderer)val38).material) && ((Renderer)val38).material.HasProperty("_Color"))
			{
				((Renderer)val38).material.SetColor("_Color", coinColor);
			}
			if (((Component)revolverCoins).TryGetComponent<TrailRenderer>(ref val39))
			{
				Gradient val40 = new Gradient();
				val40.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
				{
					new GradientColorKey(coinTrailColor, 0f),
					new GradientColorKey(coinTrailColor, 1f)
				}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
				{
					new GradientAlphaKey(1f, 0f),
					new GradientAlphaKey(0f, 1f)
				});
				val39.colorGradient = val40;
			}
			if (((Component)revolverCoins).transform.childCount > 2)
			{
				SpriteRenderer component3 = ((Component)((Component)((Component)((Component)revolverCoins).transform.GetChild(2)).transform.GetChild(0)).transform.GetChild(0)).GetComponent<SpriteRenderer>();
				component3.color = SpecialColorLogic(ModConfig.marksmanCoinFlashSpecialColor, component3.color, ModConfig.marksmanCoinFlashColor);
				Sprite sprite2 = Sprite.Create(SmallFlashTexture, new Rect(0f, 0f, (float)((Texture)SmallFlashTexture).width, (float)((Texture)SmallFlashTexture).height), new Vector2(0.5f, 0.5f));
				component3.sprite = sprite2;
			}
		}
		for (int l = 0; l < revolverBeams.Count; l++)
		{
			RevolverBeam val41 = revolverBeams[l];
			if ((Object)(object)val41 == (Object)null)
			{
				revolverBeams.Remove(val41);
				l += -1;
			}
			else
			{
				ColorRevolverBeamStart(val41, changeWidth: false);
			}
		}
	}

	public static void ColorLineRenderer(LineRenderer lineRenderer, Color color, float width = 1f)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//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_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		if (ModConfig.customColors && !((Object)(object)lineRenderer == (Object)null))
		{
			Gradient val = new Gradient();
			val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(color, 0f),
				new GradientColorKey(color, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(1f, 0f),
				new GradientAlphaKey(1f, 1f)
			});
			lineRenderer.colorGradient = val;
			if (width != 1f)
			{
				lineRenderer.widthMultiplier *= width;
			}
		}
	}

	public static void ColorRevolverBeamStart(RevolverBeam revolverBeam, bool changeWidth, bool firstTime = false)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Invalid comparison between Unknown and I4
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: 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_0550: Unknown result type (might be due to invalid IL or missing references)
		//IL_0413: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_041f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0435: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Unknown result type (might be due to invalid IL or missing references)
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_053f: 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_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)revolverBeam == (Object)null || (Object)(object)revolverBeam.sourceWeapon == (Object)null || !ModConfig.customColors || (int)revolverBeam.beamType == 3)
		{
			return;
		}
		if (firstTime)
		{
			revolverBeams.Add(revolverBeam);
		}
		Color val = Color.black;
		ModConfig.SpecialColorEnum sc = ModConfig.SpecialColorEnum.Default;
		int num = -1;
		float num2 = 1f;
		if ((Object)(object)revolverBeam.sourceWeapon.GetComponent<Revolver>() != (Object)null)
		{
			if (revolverBeam.sourceWeapon.GetComponent<Revolver>().gunVariation == 0)
			{
				num = 0;
				sc = ModConfig.weaponSpecialColors[0, num];
				val = ModConfig.revolverBeamColors[num];
				if (revolverBeam.maxHitsPerTarget > 2)
				{
					val = ModConfig.piercerAltBeamColor;
					sc = ModConfig.piercerAltBeamSpecialColor;
				}
			}
			else if (revolverBeam.sourceWeapon.GetComponent<Revolver>().gunVariation == 1)
			{
				num = 1;
				sc = ModConfig.weaponSpecialColors[0, num];
				val = ModConfig.revolverBeamColors[num];
			}
			else if (revolverBeam.sourceWeapon.GetComponent<Revolver>().gunVariation == 2)
			{
				num = 2;
				val = ModConfig.revolverBeamColors[num];
				sc = ModConfig.weaponSpecialColors[0, num];
				if (revolverBeam.ricochetAmount > 0 || revolverBeam.hasBeenRicocheter)
				{
					val = ModConfig.sharpshooterAltBeamColor;
					sc = ModConfig.sharpshooterAltBeamSpecialColor;
				}
			}
			if (!ModConfig.enableColors[0, num])
			{
				return;
			}
			if (changeWidth)
			{
				num2 = ModConfig.revolverBeamWidths[num];
				if (revolverBeam.maxHitsPerTarget > 2 && revolverBeam.sourceWeapon.GetComponent<Revolver>().gunVariation == 0)
				{
					num2 *= ModConfig.piercerAltBeamWidth;
				}
				else if (revolverBeam.ricochetAmount > 0 || revolverBeam.hasBeenRicocheter)
				{
					num2 *= ModConfig.sharpshooterAltBeamWidth;
				}
			}
			Color currentColor = Color.white;
			if ((Object)(object)revolverBeam.lr != (Object)null)
			{
				currentColor = revolverBeam.lr.startColor;
			}
			val = SpecialColorLogic(sc, currentColor, val, firstTime);
			if ((Object)(object)revolverBeam.muzzleLight != (Object)null)
			{
				revolverBeam.muzzleLight.color = val;
			}
		}
		else if ((Object)(object)revolverBeam.sourceWeapon.GetComponent<Railcannon>() != (Object)null)
		{
			if (revolverBeam.sourceWeapon.GetComponent<Railcannon>().variation == 0)
			{
				num = 0;
				if (changeWidth)
				{
					num2 = ModConfig.railcannonBeamWidths[num];
				}
				val = ModConfig.railcannonBeamColors[num];
				Color currentColor2 = Color.white;
				if ((Object)(object)revolverBeam.lr != (Object)null)
				{
					currentColor2 = revolverBeam.lr.startColor;
				}
				val = SpecialColorLogic(ModConfig.weaponSpecialColors[3, num], currentColor2, val, firstTime);
				GameObject gameObject = ((Component)((Component)revolverBeam).transform.GetChild(1)).gameObject;
				GameObject gameObject2 = ((Component)((Component)revolverBeam).transform.GetChild(2)).gameObject;
				if (ModConfig.electricRailcannonEffectColorChange)
				{
					ColorLineRenderer(gameObject.GetComponent<LineRenderer>(), val, num2);
					ColorLineRenderer(gameObject2.GetComponent<LineRenderer>(), val, num2);
				}
				else if (num2 != 1f)
				{
					LineRenderer component = gameObject.GetComponent<LineRenderer>();
					component.widthMultiplier *= num2;
					LineRenderer component2 = gameObject2.GetComponent<LineRenderer>();
					component2.widthMultiplier *= num2;
				}
			}
			else if (revolverBeam.sourceWeapon.GetComponent<Railcannon>().variation == 2)
			{
				num = 2;
				if (changeWidth)
				{
					num2 = ModConfig.railcannonBeamWidths[num];
				}
				val = ModConfig.railcannonBeamColors[num];
				Color color = revolverBeam.muzzleLight.color;
				val = SpecialColorLogic(ModConfig.weaponSpecialColors[3, num], color, val, firstTime);
			}
			if (!ModConfig.enableColors[3, num])
			{
				return;
			}
		}
		else if ((Object)(object)revolverBeam.sourceWeapon.GetComponent<ShotgunHammer>() != (Object)null)
		{
			if (!ModConfig.jackhammerCustomBeamColor)
			{
				return;
			}
			Color color2 = revolverBeam.muzzleLight.color;
			val = ModConfig.jackhammerBeamColor;
			val = SpecialColorLogic(ModConfig.jackhammerBeamSpecialColor, color2, val, firstTime);
			revolverBeam.muzzleLight.color = val;
		}
		if (ModConfig.colorMuzzleFlashes && ((Component)revolverBeam).transform.childCount != 0)
		{
			GameObject gameObject3 = ((Component)((Component)revolverBeam).transform.GetChild(0)).gameObject;
			if (gameObject3.transform.childCount != 0)
			{
				GameObject gameObject4 = ((Component)gameObject3.transform.GetChild(0)).gameObject;
				SpriteRenderer component3 = gameObject4.GetComponent<SpriteRenderer>();
				Sprite sprite = (component3.sprite = Sprite.Create(SmallFlashTexture, new Rect(0f, 0f, (float)((Texture)SmallFlashTexture).width, (float)((Texture)SmallFlashTexture).height), new Vector2(0.5f, 0.5f)));
				component3.color = val;
				if (gameObject4.transform.childCount != 0)
				{
					GameObject gameObject5 = ((Component)gameObject4.transform.GetChild(0)).gameObject;
					SpriteRenderer component4 = gameObject5.GetComponent<SpriteRenderer>();
					component4.sprite = sprite;
					component4.color = val;
				}
			}
		}
		ColorLineRenderer(((Component)revolverBeam).GetComponent<LineRenderer>(), val, num2);
	}

	public static void MakeColoredPiercerAltTexture(Color color)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_0115: 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_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: 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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		Texture2D val = new Texture2D(((Texture)PiercerAltChargeTexture).width, ((Texture)PiercerAltChargeTexture).height);
		Color val2 = default(Color);
		for (int i = 0; i < ((Texture)PiercerAltChargeTexture).width; i++)
		{
			for (int j = 0; j < ((Texture)PiercerAltChargeTexture).height; j++)
			{
				Color pixel = PiercerAltChargeTexture.GetPixel(i, j);
				float num = 1f - (pixel.r + pixel.g + pixel.b) / 3f;
				float num2 = 1f - num * (1f - color.r);
				float num3 = 1f - num * (1f - color.g);
				float num4 = 1f - num * (1f - color.b);
				((Color)(ref val2))..ctor(num2, num3, num4, pixel.a);
				val.SetPixel(i, j, val2);
			}
		}
		ColoredPiercerAltTexture = val;
		ColoredPiercerAltTexture.SetPixels(val.GetPixels());
		ColoredPiercerAltTexture.Apply();
		LastPiercerAltTextureColor = color;
	}

	public static void OtherColorEffects()
	{
		//IL_0104: 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_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: 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_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0275: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Expected O, but got Unknown
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		if (!Plugin.modEnabled || !ModConfig.customColors || !ModConfig.enableColors[0, 0] || !((Object)(object)Plugin.weapon.GetComponent<Revolver>() != (Object)null) || Plugin.weapon.GetComponent<Revolver>().gunVariation != 0)
		{
			return;
		}
		GameObject gameObject = ((Component)Plugin.weapon.transform.GetChild(0)).gameObject;
		GameObject gameObject2 = ((Component)gameObject.transform.GetChild(0)).gameObject;
		GameObject gameObject3 = ((Component)gameObject2.transform.GetChild(0)).gameObject;
		GameObject gameObject4 = ((Component)gameObject3.transform.GetChild(0)).gameObject;
		GameObject gameObject5 = ((Component)gameObject4.transform.GetChild(0)).gameObject;
		GameObject gameObject6 = ((Component)gameObject5.transform.GetChild(5)).gameObject;
		GameObject gameObject7 = ((Component)gameObject6.transform.GetChild(2)).gameObject;
		GameObject gameObject8 = ((Component)gameObject7.transform.GetChild(0)).gameObject;
		Color val = ModConfig.revolverBeamColors[0];
		Color piercerChargeEffectColor = ModConfig.piercerChargeEffectColor;
		if (Time.time >= NextTimeUpdatePiercerAltTexture)
		{
			piercerChargeEffectColor = SpecialColorLogic(ModConfig.piercerChargeEffectSpecialColor, new Color(1f, 1f, 1f), piercerChargeEffectColor);
			MakeColoredPiercerAltTexture(piercerChargeEffectColor);
			NextTimeUpdatePiercerAltTexture = Time.time + 0.05f;
		}
		else
		{
			Color color = default(Color);
			((Color)(ref color))..ctor(1f, 1f, 1f);
			MeshRenderer val2 = default(MeshRenderer);
			if (gameObject8.TryGetComponent<MeshRenderer>(ref val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material) && ((Renderer)val2).material.HasProperty("_Color"))
			{
				color = ((Renderer)val2).material.GetColor("_Color");
			}
			val = SpecialColorLogic(ModConfig.weaponSpecialColors[0, 0], color, val);
		}
		if (!ModConfig.enableColors[0, 0])
		{
			return;
		}
		MeshRenderer val3 = default(MeshRenderer);
		if (gameObject8.TryGetComponent<MeshRenderer>(ref val3) && Object.op_Implicit((Object)(object)((Renderer)val3).material) && ((Renderer)val3).material.HasProperty("_Color"))
		{
			if (ModConfig.useColorableTexturePiercer)
			{
				((Renderer)val3).material.mainTexture = (Texture)(object)ColoredPiercerAltTexture;
			}
			else
			{
				((Renderer)val3).material.SetColor("_Color", val);
			}
		}
		TrailRenderer val4 = default(TrailRenderer);
		if (gameObject8.TryGetComponent<TrailRenderer>(ref val4))
		{
			Gradient val5 = new Gradient();
			val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(val, 0f),
				new GradientColorKey(val, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(1f, 0f),
				new GradientAlphaKey(0f, 1f)
			});
			val4.colorGradient = val5;
		}
		Light val6 = default(Light);
		if (gameObject8.TryGetComponent<Light>(ref val6))
		{
			val6.color = val;
		}
	}
}
public class Crosshairs
{
	public static string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";

	public static Texture2D ClosedCircleTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D OpenCircleTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D ClosedCrossTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D OpenCrossTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D GrenadeTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D CrossBorderTexture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom1Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom2Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom3Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom4Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom5Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom6Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom7Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom8Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom9Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static Texture2D Custom10Texture = new Texture2D(0, 0, (TextureFormat)4, false);

	public static void LoadImages()
	{
		ImageConversion.LoadImage(ClosedCircleTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "ClosedCircle.png") ?? ""));
		ImageConversion.LoadImage(OpenCircleTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "OpenCircle.png") ?? ""));
		ImageConversion.LoadImage(ClosedCrossTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "ClosedCross.png") ?? ""));
		ImageConversion.LoadImage(OpenCrossTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "OpenCross.png") ?? ""));
		ImageConversion.LoadImage(GrenadeTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "GrenadeCross.png") ?? ""));
		ImageConversion.LoadImage(CrossBorderTexture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "BorderCross.png") ?? ""));
		ImageConversion.LoadImage(Custom1Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom1Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom2Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom2Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom3Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom3Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom4Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom4Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom5Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom5Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom6Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom6Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom7Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom7Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom8Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom8Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom9Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom9Cross.png") ?? ""));
		ImageConversion.LoadImage(Custom10Texture, File.ReadAllBytes(Path.Combine(DefaultParentFolder, "Custom10Cross.png") ?? ""));
	}

	public static void RenderBaseCrosshair()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: 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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_0324: Unknown result type (might be due to invalid IL or missing references)
		Color color = ((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color;
		if (ModConfig.mainCrossHairEnum == ModConfig.CrossHairEnum.UltrakillBase)
		{
			((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color.r, color.g, color.b, 1f);
			return;
		}
		if (Plugin.IsMenu())
		{
			((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color.r, color.g, color.b, 1f);
			((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(true);
			((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(true);
			((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(true);
			return;
		}
		Color color2 = ((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color;
		((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color2.r, color2.g, color2.b, 0f);
		if (ModConfig.mainCrossHairEnum != ModConfig.CrossHairEnum.None)
		{
			if (((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.activeSelf && !ModConfig.mainCrossHairKeepInfo)
			{
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(false);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(false);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(false);
			}
			else if (!((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.activeSelf && ModConfig.mainCrossHairKeepInfo)
			{
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(true);
			}
			Texture2D val = ConvertCrosshairEnumToTexture(ModConfig.mainCrossHairEnum);
			if (!((Object)(object)val == (Object)null))
			{
				float num = Screen.width / 2;
				float num2 = Screen.height / 2;
				float num3 = ModConfig.mainCrossHairScale / 4f * (float)((Texture)val).width;
				float num4 = ModConfig.mainCrossHairScale / 4f * (float)((Texture)val).height;
				GUI.DrawTexture(new Rect(num - num3 / 2f, num2 - num4 / 2f, num3, num4), (Texture)(object)val, (ScaleMode)0, true, 0f, ModConfig.mainCrossHairColor, 0f, 0f);
			}
		}
	}

	public static Texture2D ConvertCrosshairEnumToTexture(ModConfig.CrossHairEnum crosshairStyle)
	{
		//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_0115: 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_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		Texture2D result = null;
		switch (crosshairStyle)
		{
		case ModConfig.CrossHairEnum.UltrakillBase:
		{
			if (!((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.activeSelf)
			{
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(true);
			}
			Color color = ((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color;
			((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color.r, color.g, color.b, 1f);
			return null;
		}
		case ModConfig.CrossHairEnum.None:
			result = null;
			break;
		case ModConfig.CrossHairEnum.ClosedCircle:
			result = ClosedCircleTexture;
			break;
		case ModConfig.CrossHairEnum.OpenCircle:
			result = OpenCircleTexture;
			break;
		case ModConfig.CrossHairEnum.ClosedCross:
			result = ClosedCrossTexture;
			break;
		case ModConfig.CrossHairEnum.OpenCross:
			result = OpenCrossTexture;
			break;
		case ModConfig.CrossHairEnum.Grenade:
			result = GrenadeTexture;
			break;
		case ModConfig.CrossHairEnum.CrossBorder:
			result = CrossBorderTexture;
			break;
		case ModConfig.CrossHairEnum.Custom1:
			result = Custom1Texture;
			break;
		case ModConfig.CrossHairEnum.Custom2:
			result = Custom2Texture;
			break;
		case ModConfig.CrossHairEnum.Custom3:
			result = Custom3Texture;
			break;
		case ModConfig.CrossHairEnum.Custom4:
			result = Custom4Texture;
			break;
		case ModConfig.CrossHairEnum.Custom5:
			result = Custom5Texture;
			break;
		case ModConfig.CrossHairEnum.Custom6:
			result = Custom6Texture;
			break;
		case ModConfig.CrossHairEnum.Custom7:
			result = Custom7Texture;
			break;
		case ModConfig.CrossHairEnum.Custom8:
			result = Custom8Texture;
			break;
		case ModConfig.CrossHairEnum.Custom9:
			result = Custom9Texture;
			break;
		case ModConfig.CrossHairEnum.Custom10:
			result = Custom10Texture;
			break;
		}
		return result;
	}

	public static void DrawCrosshair(int i, int j)
	{
		//IL_00c4: 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)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: 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_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
		if (i > 5 || i < 0)
		{
			RenderBaseCrosshair();
		}
		else
		{
			if ((Object)(object)MonoSingleton<StatsManager>.Instance == (Object)null || (Object)(object)MonoSingleton<StatsManager>.Instance.crosshair == (Object)null || (Object)(object)MonoSingleton<StatsManager>.Instance.crosshair.transform == (Object)null || (Object)(object)MonoSingleton<StatsManager>.Instance.crosshair.transform.parent == (Object)null || (Object)(object)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.parent).gameObject == (Object)null)
			{
				return;
			}
			i += -1;
			ModConfig.CrossHairEnum crosshairStyle = ModConfig.crosshairStyles[i, j];
			float num = ModConfig.crosshairScales[i, j];
			Color val = ModConfig.crosshairColors[i, j];
			((Color)(ref val))..ctor(val.r, val.g, val.b, ModConfig.crosshairOpacities[i, j]);
			Texture2D val2 = ConvertCrosshairEnumToTexture(crosshairStyle);
			if ((Object)(object)val2 == (Object)null)
			{
				RenderBaseCrosshair();
				return;
			}
			if (Plugin.IsMenu())
			{
				Color color = ((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color;
				((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color.r, color.g, color.b, 1f);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(true);
				return;
			}
			Color color2 = ((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color;
			((Graphic)((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform).GetComponent<Image>()).color = new Color(color2.r, color2.g, color2.b, 0f);
			if (((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.activeSelf && !ModConfig.keepCrosshairInfo[i, j])
			{
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(false);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(false);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(false);
			}
			else if (!((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.activeSelf && ModConfig.keepCrosshairInfo[i, j])
			{
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(4)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(5)).gameObject.SetActive(true);
				((Component)MonoSingleton<StatsManager>.Instance.crosshair.transform.GetChild(6)).gameObject.SetActive(true);
			}
			if (!((Object)(object)val2 == (Object)null))
			{
				float num2 = Screen.width / 2;
				float num3 = Screen.height / 2;
				float num4 = num / 4f * (float)((Texture)val2).width;
				float num5 = num / 4f * (float)((Texture)val2).height;
				GUI.DrawTexture(new Rect(num2 - num4 / 2f, num3 - num5 / 2f, num4, num5), (Texture)(object)val2, (ScaleMode)0, true, 0f, val, 0f, 0f);
			}
		}
	}
}
public class HitstopPatches
{
	[HarmonyPatch(typeof(TimeController), "TrueStop")]
	public class TrueStopPatch
	{
		[HarmonyPrefix]
		private static void Prefix(ref float length)
		{
			length *= ModConfig.truestopMult + NextHitStopMultAdd;
			NextHitStopMultAdd = 0f;
		}
	}

	[HarmonyPatch(typeof(ShotgunHammer), "Impact")]
	public class ShotgunHammerImpactPatch
	{
		[HarmonyPrefix]
		private static void Prefix()
		{
			NextHitStopMultAdd = ModConfig.jackhammerAddTimeStop;
		}

		[HarmonyPostfix]
		private static void Postfix()
		{
			NextHitStopMultAdd = 0f;
		}
	}

	[HarmonyPatch(typeof(TimeController), "HitStop")]
	public class HitStopPatch
	{
		[HarmonyPrefix]
		private static void Prefix(ref float length)
		{
			length *= ModConfig.hitstopMult;
		}
	}

	[HarmonyPatch(typeof(TimeController), "SlowDown")]
	public class SlowDownPatch
	{
		[HarmonyPrefix]
		private static void Prefix(ref float amount)
		{
			amount *= ModConfig.slowdownMult;
		}
	}

	public static float NextHitStopMultAdd;
}
public class ModConfig
{
	public enum SpecialColorEnum
	{
		Default,
		RandomRainbow,
		TimeBasedRainbow,
		Confetti,
		PulseWhite,
		PulseBlack,
		HSVRandom,
		RGBRandom
	}

	public enum CrossHairEnum
	{
		UltrakillBase,
		None,
		ClosedCircle,
		OpenCircle,
		ClosedCross,
		OpenCross,
		Grenade,
		CrossBorder,
		Custom1,
		Custom2,
		Custom3,
		Custom4,
		Custom5,
		Custom6,
		Custom7,
		Custom8,
		Custom9,
		Custom10
	}

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

		public static ColorValueChangeEventDelegate <>9__65_4;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_5;

		public static FloatValueChangeEventDelegate <>9__65_6;

		public static BoolValueChangeEventDelegate <>9__65_7;

		public static ColorValueChangeEventDelegate <>9__65_8;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_9;

		public static ColorValueChangeEventDelegate <>9__65_10;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_11;

		public static ColorValueChangeEventDelegate <>9__65_13;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_14;

		public static ColorValueChangeEventDelegate <>9__65_15;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_16;

		public static ColorValueChangeEventDelegate <>9__65_17;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_18;

		public static ColorValueChangeEventDelegate <>9__65_19;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_20;

		public static ColorValueChangeEventDelegate <>9__65_21;

		public static FloatValueChangeEventDelegate <>9__65_22;

		public static ColorValueChangeEventDelegate <>9__65_23;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__65_24;

		public static ColorValueChangeEventDelegate <>9__70_3;

		public static EnumValueChangeEventDelegate<SpecialColorEnum> <>9__70_4;

		public static BoolValueChangeEventDelegate <>9__76_4;

		public static ColorValueChangeEventDelegate <>9__82_3;

		public static EnumValue