Decompiled source of LCSplatBombGrenadeMod v1.4.0

LCSplatBombGrenadeMod.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using HarmonyLib.Tools;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("LCSplatBombGrenadeMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Replace the visuals and sounds of the Grenades with Bombs from Splatoon!")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0")]
[assembly: AssemblyProduct("LCSplatBombGrenadeMod")]
[assembly: AssemblyTitle("LCSplatBombGrenadeMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.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;
		}
	}
}
namespace LCSplatBombGrenadeMod
{
	public class Configs
	{
		public static ConfigEntry<bool> SplatBombConfig;

		public static ConfigEntry<bool> FizzyBombConfig;

		public static ConfigEntry<bool> BurstBombConfig;

		public static ConfigEntry<bool> ScreenSplatters;

		public Configs(ConfigFile cfg)
		{
			SplatBombConfig = cfg.Bind<bool>("Customization", "Splat Bombs", true, "Set whether Splat Bombs replace Stun Grenades.");
			FizzyBombConfig = cfg.Bind<bool>("Customization", "Fizzy Bombs", true, "Set whether Fizzy Bombs replace Homemade Flashbangs.");
			BurstBombConfig = cfg.Bind<bool>("Customization", "Burst Bombs", true, "Set whether Burst Bombs replace Easter Eggs.");
			ScreenSplatters = cfg.Bind<bool>("Customization", "Screen Splatters", true, "Set whether Splat Bombs and Fizzy Bombs replace the grenade's flashbang filter with ink splatters.");
		}

		public static void DisplayConfigs()
		{
			if (!SplatBombConfig.Value && !BurstBombConfig.Value && !FizzyBombConfig.Value)
			{
				Plugin.Logger.LogInfo((object)"Configs [Splat Bombs], [Fizzy Bombs], and [Burst Bombs] are all set to FALSE. :(");
				return;
			}
			if (SplatBombConfig.Value)
			{
				Plugin.Logger.LogInfo((object)"Config [Splat Bombs] is set to TRUE.  Splat Bombs will replace Stun Grenades.");
			}
			else
			{
				Plugin.Logger.LogInfo((object)"Config [Splat Bombs] is set to FALSE. Stun Grenades will not be replaced.");
			}
			if (FizzyBombConfig.Value)
			{
				Plugin.Logger.LogInfo((object)"Config [Fizzy Bombs] is set to TRUE.  Fizzy Bombs will replace Homemade Flashbangs.");
			}
			else
			{
				Plugin.Logger.LogInfo((object)"Config [Fizzy Bombs] is set to FALSE. Homemade Flashbangs will not be replaced.");
			}
			if (BurstBombConfig.Value)
			{
				Plugin.Logger.LogInfo((object)"Config [Burst Bombs] is set to TRUE.  Burst Bombs will replace Easter Eggs.");
			}
			else
			{
				Plugin.Logger.LogInfo((object)"Config [Burst Bombs] is set to FALSE. Easter Eggs will not be replaced.");
			}
			if (ScreenSplatters.Value)
			{
				Plugin.Logger.LogInfo((object)"Config [Screen Splatters] is set to TRUE. Burst Bombs and Fizzy Bombs will replace the flashbang filter.");
			}
			else
			{
				Plugin.Logger.LogInfo((object)"Config [Screen Splatters] is set to FALSE. The grenade's normal flashbang filter will be used.");
			}
		}
	}
	public class HarmonyPatches
	{
		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		public class NewStartOfRoundAwake
		{
			[HarmonyPostfix]
			public static void Postfix(StartOfRound __instance)
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Expected O, but got Unknown
				if (!Configs.SplatBombConfig.Value)
				{
					SetStunGrenade = true;
				}
				if (!Configs.FizzyBombConfig.Value)
				{
					SetFlashbang = true;
				}
				if (!Configs.BurstBombConfig.Value)
				{
					SetEasterEgg = true;
				}
				if (Configs.ScreenSplatters.Value)
				{
					GameObject val = new GameObject("LCSplatBombGrenadeMod");
					val.transform.SetParent(Plugin.SearchForObject("SimonTendoManagers", ((Component)StartOfRound.Instance).gameObject.transform.parent).transform);
					val.AddComponent<SplatBehaviour>();
				}
				if (SetStunGrenade && SetFlashbang && SetEasterEgg)
				{
					return;
				}
				foreach (Item items in __instance.allItemsList.itemsList)
				{
					if (((Object)items).name == "StunGrenade" && Configs.SplatBombConfig.Value)
					{
						Plugin.Logger.LogDebug((object)"Found stun grenade, setting item properties and terminal text to Splat Bomb...");
						items.itemName = "Splat Bomb";
						items.toolTips[0] = "Use Splat Bomb : [LMB]";
						((Vector3)(ref items.positionOffset)).Set(-0.2f, 0.17f, 0.03f);
						((Vector3)(ref items.rotationOffset)).Set(180f, -25f, 0f);
						items.verticalOffset = 0.03f;
						items.spawnPrefab.GetComponent<MeshFilter>().mesh = ((Component)Plugin.SplatBomb.transform.GetChild(0)).GetComponent<MeshFilter>().mesh;
						((Component)items.spawnPrefab.transform.GetChild(0)).GetComponent<MeshFilter>().mesh = null;
						StunGrenadeItem component = items.spawnPrefab.GetComponent<StunGrenadeItem>();
						component.pullPinSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/SplatPullPinSFX.ogg");
						component.explodeSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/SplatExplodeSFX.ogg");
						((GrabbableObject)component).itemProperties.itemIcon = Plugin.SplatBombModAssets.LoadAsset<Sprite>("Assets/ItemIcon.png");
						((GrabbableObject)component).itemProperties.grabSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/SplatGrabSFX.ogg");
						((GrabbableObject)component).itemProperties.pocketSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/SplatPocketSFX.ogg");
						((GrabbableObject)component).itemProperties.dropSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/SplatDropSFX.ogg");
						component.stunGrenadeExplosion = Plugin.SplatBombModAssets.LoadAsset<GameObject>("Assets/SplatInk/GroundSplatters/SplatBombInkSplattersGround.prefab");
						Plugin.SetSplatBombKeyword();
						SetStunGrenade = true;
					}
					else if (((Object)items).name == "DiyFlashbang" && Configs.FizzyBombConfig.Value)
					{
						Plugin.Logger.LogDebug((object)"Found DIYflashbang, setting item properties to Fizzy Bomb...");
						items.itemName = "Fizzy Bomb";
						items.toolTips[0] = "Use Fizzy Bomb : [LMB]";
						((Vector3)(ref items.positionOffset)).Set(0.07f, 0.1f, -0.09f);
						((Vector3)(ref items.restingRotation)).Set(0f, 0f, 270f);
						items.verticalOffset = 0.08f;
						((Component)items.spawnPrefab.transform.GetChild(0)).GetComponent<MeshFilter>().mesh = null;
						items.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "Fizzy Bomb";
						items.spawnPrefab.GetComponent<MeshFilter>().mesh = Plugin.FizzyBomb.GetComponent<MeshFilter>().mesh;
						StunGrenadeItem component2 = items.spawnPrefab.GetComponent<StunGrenadeItem>();
						component2.pullPinSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/FizzyPullPinSFX.ogg");
						component2.explodeSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/FizzyExplodeSFX.ogg");
						((GrabbableObject)component2).itemProperties.itemIcon = Plugin.SplatBombModAssets.LoadAsset<Sprite>("Assets/FizzyBombAssets/FizzyBombIcon.png");
						((GrabbableObject)component2).itemProperties.grabSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/FizzyGrabSFX.ogg");
						((GrabbableObject)component2).itemProperties.pocketSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/FizzyPocketSFX.ogg");
						((GrabbableObject)component2).itemProperties.dropSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/FizzyDropSFX.ogg");
						component2.stunGrenadeExplosion = Plugin.SplatBombModAssets.LoadAsset<GameObject>("Assets/SplatInk/GroundSplatters/SplatBombInkSplattersGround.prefab");
						SetFlashbang = true;
					}
					else if (((Object)items).name == "EasterEgg" && Configs.BurstBombConfig.Value)
					{
						Plugin.Logger.LogDebug((object)"found easter egg, setting item properties to Burst Bomb...");
						items.itemName = "Burst Bomb";
						((Vector3)(ref items.positionOffset)).Set(-0.03f, 0.08f, -0.09f);
						((Vector3)(ref items.restingRotation)).Set(180f, 180f, 180f);
						items.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "Burst Bomb";
						items.spawnPrefab.GetComponent<MeshFilter>().mesh = Plugin.BurstBomb.GetComponent<MeshFilter>().mesh;
						StunGrenadeItem component3 = items.spawnPrefab.GetComponent<StunGrenadeItem>();
						component3.explodeSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/BurstExplodeSFX.ogg");
						((GrabbableObject)component3).itemProperties.itemIcon = Plugin.SplatBombModAssets.LoadAsset<Sprite>("Assets/BurstBombAssets/BurstBombIcon.png");
						((GrabbableObject)component3).itemProperties.grabSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/BurstGrabSFX.ogg");
						((GrabbableObject)component3).itemProperties.pocketSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/BurstPocketSFX.ogg");
						((GrabbableObject)component3).itemProperties.dropSFX = Plugin.SplatBombModAssets.LoadAsset<AudioClip>("Assets/SplatSounds/BurstDropSFX.ogg");
						SetEasterEgg = true;
					}
				}
			}
		}

		[HarmonyPatch(typeof(StunGrenadeItem), "Start")]
		public class NewStunGrenadeStart
		{
			[HarmonyPostfix]
			public static void Postfix(StunGrenadeItem __instance)
			{
				if ((Object)(object)__instance == (Object)null)
				{
					return;
				}
				if (((Object)__instance).name == "StunGrenade(Clone)" && Configs.SplatBombConfig.Value)
				{
					Object.Instantiate<GameObject>(Plugin.SplatBomb, ((Component)__instance).transform);
				}
				else if (((Object)__instance).name == "DiyFlashbang(Clone)" && Configs.FizzyBombConfig.Value)
				{
					Object.Instantiate<GameObject>(Plugin.FizzyBomb, ((Component)__instance).transform);
				}
				else if (((Object)__instance).name == "EasterEgg(Clone)" && Configs.BurstBombConfig.Value)
				{
					Object.Instantiate<GameObject>(Plugin.BurstBomb, ((Component)__instance).transform);
					int num = 4;
					if (colorRandomizer != null)
					{
						num = colorRandomizer.Next(0, 9);
					}
					Plugin.Logger.LogDebug((object)$"#{((NetworkBehaviour)__instance).NetworkObjectId} | randomNr = {num}");
					((Renderer)((Component)((Component)__instance).transform.GetChild(2)).GetComponent<MeshRenderer>()).material = Plugin.SplatBombModAssets.LoadAsset<Material>($"Assets/BurstBombAssets/BurstBombMaterials/BurstBombMaterial{num}.mat");
					__instance.stunGrenadeExplosion = Plugin.SplatBombModAssets.LoadAsset<GameObject>($"Assets/SplatInk/GroundSplatters/BurstBomb/BurstBombInkSplatters{num}.prefab");
				}
			}
		}

		[HarmonyPatch(typeof(StunGrenadeItem), "SetControlTipForGrenade")]
		public class NewStunGrenadeSetControlTip
		{
			[HarmonyPostfix]
			public static void Postfix(StunGrenadeItem __instance)
			{
				if (((NetworkBehaviour)__instance).IsOwner)
				{
					if (((Object)((Component)__instance).gameObject).name == "StunGrenade(Clone)" && Configs.SplatBombConfig.Value)
					{
						string[] array = (__instance.pinPulled ? new string[1] { "Throw Splat Bomb : [LMB]" } : new string[1] { "Activate Splat Bomb : [LMB] " });
						HUDManager.Instance.ChangeControlTipMultiple(array, true, ((GrabbableObject)__instance).itemProperties);
					}
					else if (((Object)((Component)__instance).gameObject).name == "EasterEgg(Clone)" && Configs.BurstBombConfig.Value)
					{
						string[] array2 = new string[1] { "Toss Burst Bomb : [LMB] " };
						HUDManager.Instance.ChangeControlTipMultiple(array2, true, ((GrabbableObject)__instance).itemProperties);
					}
					else if (((Object)((Component)__instance).gameObject).name == "DiyFlashbang(Clone)" && Configs.FizzyBombConfig.Value)
					{
						string[] array3 = new string[1] { "Use Fizzy Bomb : [LMB] " };
						HUDManager.Instance.ChangeControlTipMultiple(array3, true, ((GrabbableObject)__instance).itemProperties);
					}
				}
			}
		}

		[HarmonyPatch(typeof(StunGrenadeItem), "ExplodeStunGrenade")]
		public class NewStunGrenadeExplode
		{
			[HarmonyPrefix]
			public static void Prefix(StunGrenadeItem __instance)
			{
				object obj;
				if (__instance == null)
				{
					obj = null;
				}
				else
				{
					GameObject gameObject = ((Component)__instance).gameObject;
					obj = ((gameObject != null) ? ((Object)gameObject).name : null);
				}
				if ((string?)obj == "StunGrenade(Clone)" && Configs.SplatBombConfig.Value)
				{
					((Renderer)((Component)((Component)__instance).transform.GetChild(2).GetChild(1)).GetComponent<MeshRenderer>()).material = Plugin.SplatBombEmptyMaterial;
				}
			}
		}

		[HarmonyPatch(typeof(RoundManager), "GenerateNewLevelClientRpc")]
		public class NewRoundManagerGenerateLevel
		{
			[HarmonyPostfix]
			public static void Postfix()
			{
				if (!((Object)(object)StartOfRound.Instance == (Object)null))
				{
					Plugin.Logger.LogDebug((object)$"NewRoundManagerGenerateLevel starting with randomMapSeed {StartOfRound.Instance.randomMapSeed}");
					colorRandomizer = new Random(StartOfRound.Instance.randomMapSeed);
				}
			}
		}

		public static bool SetStunGrenade;

		public static bool SetFlashbang;

		public static bool SetEasterEgg;

		public static Random colorRandomizer;
	}
	[BepInPlugin("LCSplatBombGrenadeMod", "LCSplatBombGrenadeMod", "1.4.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static AssetBundle SplatBombModAssets;

		public static GameObject SplatBomb;

		public static GameObject FizzyBomb;

		public static GameObject BurstBomb;

		public static Material SplatBombEmptyMaterial;

		public static GameObject InkScreenSplatters;

		public static Configs MyConfig { get; internal set; }

		private void Awake()
		{
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin LCSplatBombGrenadeMod is loaded!");
			SplatBombModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "splatbombmodassets"));
			if ((Object)(object)SplatBombModAssets == (Object)null)
			{
				Logger.LogError((object)"Failed to load SplatBomb AssetBundle");
				return;
			}
			Logger.LogInfo((object)"Loaded SplatBomb AssetBundle");
			SplatBomb = SplatBombModAssets.LoadAsset<GameObject>("Assets/SplatBombPrefab.prefab");
			SplatBombEmptyMaterial = SplatBombModAssets.LoadAsset<Material>("Assets/SplatBombAssets/EmptyMaterial.mat");
			FizzyBomb = SplatBombModAssets.LoadAsset<GameObject>("Assets/FizzyBombAssets/FizzyBombPrefab.prefab");
			BurstBomb = SplatBombModAssets.LoadAsset<GameObject>("Assets/BurstBombAssets/BurstBombPrefab.prefab");
			InkScreenSplatters = SplatBombModAssets.LoadAsset<GameObject>("Assets/SplatInk/ScreenSplatters/SplatBombInkSplattersScreen.prefab");
			new Harmony("LCSplatBombGrenadeMod").PatchAll();
			HarmonyFileLog.Enabled = false;
			MyConfig = new Configs(((BaseUnityPlugin)this).Config);
			Configs.DisplayConfigs();
		}

		public static void SetSplatBombKeyword()
		{
			Terminal val = Object.FindObjectOfType<Terminal>();
			TerminalKeyword val2 = null;
			bool flag = false;
			bool flag2 = false;
			TerminalKeyword[] allKeywords = val.terminalNodes.allKeywords;
			foreach (TerminalKeyword val3 in allKeywords)
			{
				if (((Object)val3).name == "StunGrenade")
				{
					val3.word = "splat";
					flag = true;
				}
				else if (((Object)val3).name == "Buy")
				{
					val2 = val3;
					flag2 = true;
				}
				if (flag && flag2)
				{
					break;
				}
			}
			if ((Object)(object)val2 == (Object)null)
			{
				return;
			}
			TerminalNode val4 = null;
			CompatibleNoun[] compatibleNouns = val2.compatibleNouns;
			foreach (CompatibleNoun val5 in compatibleNouns)
			{
				if (((Object)val5.noun).name == "StunGrenade")
				{
					val4 = val5.result;
					break;
				}
			}
			if (!((Object)(object)val4 == (Object)null))
			{
				val4.displayText = "You have requested to order Splat Bombs. Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n";
				val4.terminalOptions[0].result.displayText = "Ordered [variableAmount] Splat Bombs. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\nBooyah!\n\n";
			}
		}

		public static GameObject SearchForObject(string name, Transform parentTransform = null)
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			Logger.LogDebug((object)("Starting search for " + name));
			GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0);
			GameObject[] array2 = array;
			GameObject result;
			foreach (GameObject val in array2)
			{
				if (((Object)val).name == name)
				{
					result = val;
					Logger.LogDebug((object)("Found existing " + ((Object)val).name + ", using as parent."));
					return result;
				}
			}
			result = new GameObject(name);
			if ((Object)(object)parentTransform != (Object)null)
			{
				result.transform.SetParent(parentTransform, false);
			}
			Logger.LogDebug((object)("Did not find existing " + name + ", instantiating new " + ((Object)result).name));
			return result;
		}
	}
	internal class SplatBehaviour : MonoBehaviour
	{
		[HarmonyPatch(typeof(StunGrenadeItem), "StunExplosion")]
		public class NewStunExplosion
		{
			[HarmonyPostfix]
			public static void Postfix(Vector3 explosionPosition)
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				if (Configs.ScreenSplatters.Value && (Object)(object)Instance != (Object)null)
				{
					Instance.PerformInkSplatterCheck(explosionPosition);
				}
			}
		}

		public static SplatBehaviour Instance;

		private Image InkSplattersScreen;

		private bool FlashFromInkBomb;

		private void Awake()
		{
			//IL_0092: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			StartOfRound instance = StartOfRound.Instance;
			object obj;
			if (instance == null)
			{
				obj = null;
			}
			else
			{
				Transform parent = ((Component)instance).transform.parent;
				if (parent == null)
				{
					obj = null;
				}
				else
				{
					Transform parent2 = parent.parent;
					if (parent2 == null)
					{
						obj = null;
					}
					else
					{
						Transform obj2 = parent2.Find("UI");
						obj = ((obj2 != null) ? ((Component)obj2).GetComponentInChildren<Canvas>() : null);
					}
				}
			}
			Canvas val = (Canvas)obj;
			Plugin.Logger.LogDebug((object)$"found canvas: {val}");
			if ((Object)(object)val != (Object)null)
			{
				GameObject val2 = Object.Instantiate<GameObject>(Plugin.InkScreenSplatters, ((Component)val).transform.GetChild(0));
				InkSplattersScreen = val2.GetComponent<Image>();
				Color color = ((Graphic)InkSplattersScreen).color;
				color.a = 0f;
				((Graphic)InkSplattersScreen).color = color;
			}
		}

		private void Update()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			if (FlashFromInkBomb && (Object)(object)HUDManager.Instance != (Object)null && HUDManager.Instance.flashFilter > 0.025f)
			{
				Color color = ((Graphic)InkSplattersScreen).color;
				color.a = HUDManager.Instance.flashFilter;
				((Graphic)InkSplattersScreen).color = color;
			}
			else
			{
				FlashFromInkBomb = false;
				Color color2 = ((Graphic)InkSplattersScreen).color;
				color2.a = 0f;
				((Graphic)InkSplattersScreen).color = color2;
			}
		}

		private void PerformInkSplatterCheck(Vector3 stunPos)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)InkSplattersScreen == (Object)null || (Object)(object)HUDManager.Instance == (Object)null || HUDManager.Instance.flashFilter < ((Graphic)InkSplattersScreen).color.a)
			{
				return;
			}
			StunGrenadeItem[] array = Object.FindObjectsByType<StunGrenadeItem>((FindObjectsSortMode)0);
			if (array == null || array.Length == 0)
			{
				return;
			}
			bool flashFromInkBomb = false;
			for (int i = 0; i < array.Length; i++)
			{
				if (((Configs.SplatBombConfig.Value && ((Object)((Component)array[i]).gameObject).name == "StunGrenade(Clone)") || (Configs.FizzyBombConfig.Value && ((Object)((Component)array[i]).gameObject).name == "DiyFlashbang(Clone)")) && Vector3.Distance(stunPos, ((Component)array[i]).transform.position) == 0f)
				{
					flashFromInkBomb = true;
					break;
				}
			}
			PlayerControllerB val = StartOfRound.Instance.localPlayerController;
			if (StartOfRound.Instance.localPlayerController.isPlayerDead && (Object)(object)StartOfRound.Instance.localPlayerController.spectatedPlayerScript != (Object)null)
			{
				val = StartOfRound.Instance.localPlayerController.spectatedPlayerScript;
			}
			float num = Vector3.Distance(stunPos, val.playerEye.position);
			if (num < 15f)
			{
				FlashFromInkBomb = flashFromInkBomb;
				Plugin.Logger.LogDebug((object)$"distance: {num} | FlashFromInkBomb: {FlashFromInkBomb}");
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LCSplatBombGrenadeMod";

		public const string PLUGIN_NAME = "LCSplatBombGrenadeMod";

		public const string PLUGIN_VERSION = "1.4.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}