Decompiled source of RemoveScreenEffectsTintsAndDistortions v1.1.1

RemoveScreenEffects.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;

[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("RemoveScreenEffects")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+fbe13143a3e129c63bed5ebcafd3cc214f8eafd9")]
[assembly: AssemblyProduct("RemoveScreenEffects")]
[assembly: AssemblyTitle("RemoveScreenEffects")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace RemoveScreenEffects
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.pseudo.removeScreenEffects", "Remove Screen Effects, Tints And Distortions", "1.1.1")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "com.pseudo.removeScreenEffects";

		public const string PluginName = "Remove Screen Effects, Tints And Distortions";

		public const string PluginVersion = "1.1.1";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		public static Dictionary<string, ConfigEntry<bool>> StringToConfig { get; set; }

		private ConfigEntry<bool>? ResourceStringToConfigEntry(string resourceString)
		{
			if (!Global.Value)
			{
				return null;
			}
			if (string.IsNullOrEmpty(resourceString))
			{
				return null;
			}
			if (StringToConfig.TryGetValue(resourceString, out ConfigEntry<bool> value))
			{
				return value;
			}
			return null;
		}

		public ConfigEntry<bool>? ResourceNameToConfigEntry(string? resourceName)
		{
			string resourceName2 = resourceName;
			if (!Global.Value)
			{
				return null;
			}
			if (string.IsNullOrEmpty(resourceName2))
			{
				return null;
			}
			string resourceString = (from k in StringToConfig.Keys
				select new
				{
					Original = k,
					Short = k.Split('/')[^1]
				} into k
				where k.Short == resourceName2
				select k.Original).FirstOrDefault();
			return ResourceStringToConfigEntry(resourceString);
		}

		public void SetupConfig()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Expected O, but got Unknown
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Expected O, but got Unknown
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Expected O, but got Unknown
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Expected O, but got Unknown
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Expected O, but got Unknown
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Expected O, but got Unknown
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Expected O, but got Unknown
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Expected O, but got Unknown
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Expected O, but got Unknown
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Expected O, but got Unknown
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Expected O, but got Unknown
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Expected O, but got Unknown
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Expected O, but got Unknown
			//IL_043d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Expected O, but got Unknown
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Expected O, but got Unknown
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Expected O, but got Unknown
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Expected O, but got Unknown
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Expected O, but got Unknown
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Expected O, but got Unknown
			Global = ((BaseUnityPlugin)this).Config.Bind<bool>("!Global", "All", true, new ConfigDescription("Disable all effects", (AcceptableValueBase)null, Array.Empty<object>()));
			EngiShield = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "EngiShield", true, new ConfigDescription("Disable EngiShield screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			BucklerDefense = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "BucklerDefense", true, new ConfigDescription("Disable BucklerDefense screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			SlowDownTime = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "SlowDownTime", true, new ConfigDescription("Disable SlowDownTime screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			CrippleEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "CrippleEffect", true, new ConfigDescription("Disable CrippleEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			TonicBuffEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "TonicBuffEffect", true, new ConfigDescription("Disable TonicBuffEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			WeakEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "WeakEffect", true, new ConfigDescription("Disable WeakEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			EnergizedEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "EnergizedEffect", true, new ConfigDescription("Disable EnergizedEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			BarrierEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "BarrierEffect", true, new ConfigDescription("Disable BarrierEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			RegenBoostEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "RegenBoostEffect", true, new ConfigDescription("Disable RegenBoostEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			NullSafeZoneEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "NullSafeZoneEffect", true, new ConfigDescription("Disable NullSafeZoneEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			ElephantDefense = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "ElephantDefense", true, new ConfigDescription("Disable ElephantDefense screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			HealingDisabledEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "HealingDisabledEffect", true, new ConfigDescription("Disable HealingDisabledEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			NoCooldownEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "NoCooldownEffect", true, new ConfigDescription("Disable NoCooldownEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			DoppelgangerEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "DoppelgangerEffect", true, new ConfigDescription("Disable DoppelgangerEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			NullifyStack1Effect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "NullifyStack1Effect", true, new ConfigDescription("Disable NullifyStack1Effect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			NullifyStack2Effect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "NullifyStack2Effect", true, new ConfigDescription("Disable NullifyStack2Effect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			NullifyStack3Effect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "NullifyStack3Effect", true, new ConfigDescription("Disable NullifyStack3Effect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			DeathMarkEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "DeathMarkEffect", true, new ConfigDescription("Disable DeathMarkEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			CrocoRegenEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "CrocoRegenEffect", true, new ConfigDescription("Disable CrocoRegenEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			MercExposeEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "MercExposeEffect", true, new ConfigDescription("Disable MercExposeEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			LifeStealOnHitAura = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "LifeStealOnHitAura", true, new ConfigDescription("Disable LifeStealOnHitAura screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			TeamWarCryAura = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "TeamWarCryAura", true, new ConfigDescription("Disable TeamWarCryAura screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			LunarDefense = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "LunarDefense", true, new ConfigDescription("Disable LunarDefense screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			RandomDamageBuffEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "RandomDamageBuffEffect", true, new ConfigDescription("Disable RandomDamageBuffEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			WarbannerBuffEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "WarbannerBuffEffect", true, new ConfigDescription("Disable WarbannerBuffEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			TeslaFieldBuffEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "TeslaFieldBuffEffect", true, new ConfigDescription("Disable TeslaFieldBuffEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			LunarSecondaryRootEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "LunarSecondaryRootEffect", true, new ConfigDescription("Disable LunarSecondaryRootEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			LunarDetonatorEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "LunarDetonatorEffect", true, new ConfigDescription("Disable LunarDetonatorEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			FruitingEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Effects", "FruitingEffect", true, new ConfigDescription("Disable FruitingEffect screen effect/distortion if there is any.", (AcceptableValueBase)null, Array.Empty<object>()));
			StringToConfig = new Dictionary<string, ConfigEntry<bool>>
			{
				["Prefabs/TemporaryVisualEffects/EngiShield"] = EngiShield,
				["Prefabs/TemporaryVisualEffects/BucklerDefense"] = BucklerDefense,
				["Prefabs/TemporaryVisualEffects/SlowDownTime"] = SlowDownTime,
				["Prefabs/TemporaryVisualEffects/CrippleEffect"] = CrippleEffect,
				["Prefabs/TemporaryVisualEffects/TonicBuffEffect"] = TonicBuffEffect,
				["Prefabs/TemporaryVisualEffects/WeakEffect"] = WeakEffect,
				["Prefabs/TemporaryVisualEffects/EnergizedEffect"] = EnergizedEffect,
				["Prefabs/TemporaryVisualEffects/BarrierEffect"] = BarrierEffect,
				["Prefabs/TemporaryVisualEffects/RegenBoostEffect"] = RegenBoostEffect,
				["Prefabs/TemporaryVisualEffects/NullSafeZoneEffect"] = NullSafeZoneEffect,
				["Prefabs/TemporaryVisualEffects/ElephantDefense"] = ElephantDefense,
				["Prefabs/TemporaryVisualEffects/HealingDisabledEffect"] = HealingDisabledEffect,
				["Prefabs/TemporaryVisualEffects/NoCooldownEffect"] = NoCooldownEffect,
				["Prefabs/TemporaryVisualEffects/DoppelgangerEffect"] = DoppelgangerEffect,
				["Prefabs/TemporaryVisualEffects/NullifyStack1Effect"] = NullifyStack1Effect,
				["Prefabs/TemporaryVisualEffects/NullifyStack2Effect"] = NullifyStack2Effect,
				["Prefabs/TemporaryVisualEffects/NullifyStack3Effect"] = NullifyStack3Effect,
				["Prefabs/TemporaryVisualEffects/DeathMarkEffect"] = DeathMarkEffect,
				["Prefabs/TemporaryVisualEffects/CrocoRegenEffect"] = CrocoRegenEffect,
				["Prefabs/TemporaryVisualEffects/MercExposeEffect"] = MercExposeEffect,
				["Prefabs/TemporaryVisualEffects/LifeStealOnHitAura"] = LifeStealOnHitAura,
				["Prefabs/TemporaryVisualEffects/TeamWarCryAura"] = TeamWarCryAura,
				["Prefabs/TemporaryVisualEffects/LunarDefense"] = LunarDefense,
				["Prefabs/TemporaryVisualEffects/RandomDamageBuffEffect"] = RandomDamageBuffEffect,
				["Prefabs/TemporaryVisualEffects/WarbannerBuffEffect"] = WarbannerBuffEffect,
				["Prefabs/TemporaryVisualEffects/TeslaFieldBuffEffect"] = TeslaFieldBuffEffect,
				["Prefabs/TemporaryVisualEffects/LunarSecondaryRootEffect"] = LunarSecondaryRootEffect,
				["Prefabs/TemporaryVisualEffects/LunarDetonatorEffect"] = LunarDetonatorEffect,
				["Prefabs/TemporaryVisualEffects/FruitingEffect"] = FruitingEffect
			};
		}

		private void SetupUIConfig()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Global, false));
			foreach (ConfigEntry<bool> value in StringToConfig.Values)
			{
				if (value != null)
				{
					ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(value, false));
				}
			}
		}

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			SetupConfig();
			SetupUIConfig();
			Hooks();
		}

		public void Hooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			CharacterBody.UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_GameObject_float_bool_string += new hook_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_GameObject_float_bool_string(CharacterBody_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_GameObject_float_bool_string);
			CharacterBody.UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_string_float_bool_string += new hook_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_string_float_bool_string(CharacterBody_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_string_float_bool_string);
		}

		private void CharacterBody_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_GameObject_float_bool_string(orig_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_GameObject_float_bool_string originalMethod, CharacterBody thisReference, ref TemporaryVisualEffect tempEffect, GameObject tempEffectPrefab, float effectRadius, bool active, string childLocatorOverride)
		{
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			bool flag = (Object)(object)tempEffect != (Object)null;
			if (flag == active)
			{
				return;
			}
			if (active)
			{
				if (flag)
				{
					return;
				}
				if (!Object.op_Implicit((Object)(object)tempEffectPrefab))
				{
					Debug.LogError((object)"Can't instantiate null temporary visual effect");
					return;
				}
				GameObject val = Object.Instantiate<GameObject>(tempEffectPrefab, thisReference.corePosition, Quaternion.identity);
				tempEffect = val.GetComponent<TemporaryVisualEffect>();
				tempEffect.parentTransform = thisReference.coreTransform;
				tempEffect.visualState = (VisualState)0;
				tempEffect.healthComponent = thisReference.healthComponent;
				tempEffect.radius = effectRadius;
				ConfigEntry<bool>? obj = ResourceNameToConfigEntry((tempEffectPrefab != null) ? ((Object)tempEffectPrefab).name : null);
				if (obj == null || !obj.Value)
				{
					LocalCameraEffect component = val.GetComponent<LocalCameraEffect>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.targetCharacter = ((Component)thisReference).gameObject;
					}
				}
				if (string.IsNullOrEmpty(childLocatorOverride))
				{
					return;
				}
				ModelLocator modelLocator = thisReference.modelLocator;
				ChildLocator val2;
				if ((Object)(object)modelLocator == (Object)null)
				{
					val2 = null;
				}
				else
				{
					Transform modelTransform = modelLocator.modelTransform;
					val2 = (((Object)(object)modelTransform != (Object)null) ? ((Component)modelTransform).GetComponent<ChildLocator>() : null);
				}
				ChildLocator val3 = val2;
				if (Object.op_Implicit((Object)(object)val3))
				{
					Transform val4 = val3.FindChild(childLocatorOverride);
					if (Object.op_Implicit((Object)(object)val4))
					{
						tempEffect.parentTransform = val4;
					}
				}
			}
			else if (Object.op_Implicit((Object)(object)tempEffect))
			{
				tempEffect.visualState = (VisualState)1;
			}
		}

		private void CharacterBody_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_string_float_bool_string(orig_UpdateSingleTemporaryVisualEffect_refTemporaryVisualEffect_string_float_bool_string orig, CharacterBody thisReference, ref TemporaryVisualEffect tempEffect, string resourceString, float effectRadius, bool active, string childLocatorOverride)
		{
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			bool flag = (Object)(object)tempEffect != (Object)null;
			if (flag == active)
			{
				return;
			}
			if (active)
			{
				if (flag)
				{
					return;
				}
				GameObject val = Object.Instantiate<GameObject>(Resources.Load<GameObject>(resourceString), thisReference.corePosition, Quaternion.identity);
				tempEffect = val.GetComponent<TemporaryVisualEffect>();
				tempEffect.parentTransform = thisReference.coreTransform;
				tempEffect.visualState = (VisualState)0;
				tempEffect.healthComponent = thisReference.healthComponent;
				tempEffect.radius = effectRadius;
				ConfigEntry<bool>? obj = ResourceStringToConfigEntry(resourceString);
				if (obj == null || !obj.Value)
				{
					LocalCameraEffect component = val.GetComponent<LocalCameraEffect>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.targetCharacter = ((Component)thisReference).gameObject;
					}
				}
				if (string.IsNullOrEmpty(childLocatorOverride))
				{
					return;
				}
				ModelLocator modelLocator = thisReference.modelLocator;
				ChildLocator val2;
				if ((Object)(object)modelLocator == (Object)null)
				{
					val2 = null;
				}
				else
				{
					Transform modelTransform = modelLocator.modelTransform;
					val2 = (((Object)(object)modelTransform != (Object)null) ? ((Component)modelTransform).GetComponent<ChildLocator>() : null);
				}
				ChildLocator val3 = val2;
				if (Object.op_Implicit((Object)(object)val3))
				{
					Transform val4 = val3.FindChild(childLocatorOverride);
					if (Object.op_Implicit((Object)(object)val4))
					{
						tempEffect.parentTransform = val4;
					}
				}
			}
			else if (Object.op_Implicit((Object)(object)tempEffect))
			{
				tempEffect.visualState = (VisualState)1;
			}
		}
	}
}