Decompiled source of SOTS AV Effect Options v1.0.1

AVOptions.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AK.Wwise;
using AVOptions.Configurations;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.UI;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Projectile;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Rendering.PostProcessing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("AVOptions")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AVOptions")]
[assembly: AssemblyTitle("AVOptions")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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 AVOptions
{
	[BepInPlugin("com.Nuxlar.AVFX_Options", "SOTS AV Effect Options", "1.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class AVOptions : BaseUnityPlugin
	{
		private PrefabConfigurer _prefabConfigurer;

		private BlastShowerConfiguration _blastShowerConfiguration;

		private FireworkTailConfiguration _fireworkTailConfiguration;

		private FrelicAvConfiguration _frelicAvConfiguration;

		private IdpVisualConfiguration _idpVisualConfiguration;

		private KjaroVisualConfiguration _kjaroVisualConfiguration;

		private PlasmaShrimpConfiguration _plasmaShrimpConfiguration;

		private RoseBucklerConfiguration _roseBucklerConfiguration;

		private RunaldsVisualConfiguration _runaldsVisualConfiguration;

		private ViendAudioConfiguration _viendAudioConfiguration;

		private WungusVisualConfiguration _wungusVisualConfiguration;

		private WungusAudioConfiguration _wungusAudioConfiguration;

		private BortalConfiguration _bortalConfiguration;

		private GortalConfiguration _gortalConfiguration;

		[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
		public void Awake()
		{
			_prefabConfigurer = PrefabConfigurer.GetInstance(((BaseUnityPlugin)this).Config);
			try
			{
				_blastShowerConfiguration = new BlastShowerConfiguration(((BaseUnityPlugin)this).Config);
				_bortalConfiguration = new BortalConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindVfx("KillEliteFrenzy/NoCooldownEffect", "Brainstalks", "Enables Brainstalks' screen effect. Note: re-enabling may not take effect until next stage.");
				_fireworkTailConfiguration = new FireworkTailConfiguration(((BaseUnityPlugin)this).Config);
				_frelicAvConfiguration = new FrelicAvConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindVfx("IgniteOnKill/IgniteExplosionVFX", "Gasoline", "Enables Gasoline's explosion");
				_gortalConfiguration = new GortalConfiguration(((BaseUnityPlugin)this).Config);
				_idpVisualConfiguration = new IdpVisualConfiguration(((BaseUnityPlugin)this).Config);
				_kjaroVisualConfiguration = new KjaroVisualConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindVfx("FireballsOnHit/FireMeatBallGhost", "Molten Perforator", "Enables the Molten Perforator visuals");
				_plasmaShrimpConfiguration = new PlasmaShrimpConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindVoidVfx("MissileVoid/MissileVoidOrbEffect", "Plasma Shrimp Orbs", "It's the missiles that shoot out");
				_roseBucklerConfiguration = new RoseBucklerConfiguration(((BaseUnityPlugin)this).Config);
				_runaldsVisualConfiguration = new RunaldsVisualConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindVfx("BleedOnHitAndExplode/BleedOnHitAndExplode_Explosion", "Shatterspleen", "Enables Shatterspleen's explosion");
				_prefabConfigurer.BindVfx("Tonic/TonicBuffEffect", "Spinel Tonic", "Enables Spinel Tonic's screen effect");
				_prefabConfigurer.BindVfx("StickyBomb/StickyBombGhost", "Sticky Bomb Drops", "Enables Sticky Bomb's drops");
				_prefabConfigurer.BindVfx("StickyBomb/BehemothVFX", "Sticky Bomb Explosion", "Enables Sticky Bomb's explosion");
				_prefabConfigurer.BindAsset(Category.UNIT_EFFECTS, "Base/Titan/TitanDeathEffect", "Titan Death", "Enables Stone Titan's on-death explosion. Disabling will cause Stone Titans to disappear on death instead of creating a corpse.");
				_viendAudioConfiguration = new ViendAudioConfiguration(((BaseUnityPlugin)this).Config);
				_prefabConfigurer.BindAsset(Category.UNIT_EFFECTS, "Base/Vagrant/VagrantDeathExplosion", "Wandering Vagrant Death", "Enables Wandering Vagrant's on-death explosion. Disabling will cause Wandering Vagrants to disappear on death instead of creating a corpse.");
				_prefabConfigurer.BindVfx("ExplodeOnDeath/WilloWispExplosion", "Will-o-the-Wisp", "Enables Will o' the Wisp's explosion");
				_wungusVisualConfiguration = new WungusVisualConfiguration(((BaseUnityPlugin)this).Config);
				_wungusAudioConfiguration = new WungusAudioConfiguration(((BaseUnityPlugin)this).Config);
			}
			catch (ConfigurationException ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)ex);
				((BaseUnityPlugin)this).Logger.LogError((object)("Failed to register configuration for " + ex.Message + "\r" + ex.StackTrace));
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished!");
		}
	}
	public class PrefabConfigurer
	{
		private static ManualLogSource s_logger = Logger.CreateLogSource("c.t.a.PrefabConfigurer");

		private static PrefabConfigurer s_instance = null;

		private static readonly Object s_mut = new Object();

		private ConfigFile _configFile;

		private RiskOfOptions _riskOfOptions = RiskOfOptions.GetInstance();

		public static PrefabConfigurer GetInstance(ConfigFile configFile)
		{
			if (s_instance != null)
			{
				s_logger.LogWarning((object)"Configurer has already been created.");
				return s_instance;
			}
			lock (s_mut)
			{
				if (s_instance == null)
				{
					s_instance = new PrefabConfigurer(configFile);
				}
			}
			return s_instance;
		}

		private PrefabConfigurer(ConfigFile configFile)
		{
			_configFile = configFile;
		}

		public void BindVfx(string assetPath, string title, string description)
		{
			BindAsset(Category.BASE_VFX, "Base/" + assetPath, title, description);
		}

		public void BindSfx(string assetPath, string title, string description)
		{
			BindAsset(Category.BASE_SFX, "Base/" + assetPath, title, description);
		}

		public void BindVoidVfx(string assetPath, string title, string description)
		{
			BindAsset(Category.VOID_VFX, "DLC1/" + assetPath, title, description);
		}

		public void BindVoidSfx(string assetPath, string title, string description)
		{
			BindAsset(Category.VOID_SFX, "DLC1/" + assetPath, title, description);
		}

		public void BindUnitFx(string assetPath, string title, string description)
		{
			BindAsset(Category.VOID_SFX, "DLC1/" + assetPath, title, description);
		}

		public void BindAsset(string category, string assetPath, string title, string description)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject prefab = Addressables.LoadAsset<GameObject>((object)("RoR2/" + assetPath + ".prefab")).WaitForCompletion();
				ConfigEntry<bool> val = _configFile.Bind<bool>(category, title, true, description);
				val.SettingChanged += delegate(object x, EventArgs _)
				{
					prefab.SetActive(((ConfigEntry<bool>)x).Value);
				};
				prefab.SetActive(val.Value);
				_riskOfOptions.AddOption(val);
			}
			catch (Exception ex)
			{
				throw new ConfigurationException(assetPath, ex);
			}
		}
	}
	public class RiskOfOptions
	{
		private protected static ManualLogSource s_logger = Logger.CreateLogSource("c.t.a.RiskOfOptions");

		private static RiskOfOptions s_instance = null;

		private static readonly Object s_mut = new Object();

		private static readonly bool s_enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		public static RiskOfOptions Instance
		{
			get
			{
				if (s_instance == null)
				{
					throw new Exception("Instance not yet created");
				}
				return s_instance;
			}
		}

		public void AddOption(ConfigEntry<bool> value)
		{
			if (s_enabled)
			{
				Add(value);
			}
		}

		private void Add(ConfigEntry<bool> value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(value));
		}

		public static RiskOfOptions GetInstance()
		{
			if (s_instance == null)
			{
				lock (s_mut)
				{
					if (s_instance == null)
					{
						s_logger.LogDebug((object)("Creating instance with options enabled=" + s_enabled));
						s_instance = new RiskOfOptions();
					}
				}
			}
			return s_instance;
		}

		private void Configure()
		{
			ModSettingsManager.SetModDescription("Enable or disable various item audio/visual effects.");
		}

		private RiskOfOptions()
		{
			if (s_enabled)
			{
				Configure();
			}
			s_logger.LogDebug((object)$"RiskOfOptions integration enabled={s_enabled}");
		}
	}
}
namespace AVOptions.Configurations
{
	internal static class Category
	{
		public static readonly string BASE_VFX = "VFX";

		public static readonly string BASE_SFX = "SFX";

		public static readonly string VOID_VFX = "SOTV VFX";

		public static readonly string VOID_SFX = "SOTV SFX";

		public static readonly string UNIT_EFFECTS = "Unit FX";
	}
	internal abstract class AvConfiguration
	{
		private protected ConfigEntry<bool> _configEntry;

		private static readonly RiskOfOptions s_riskOfOptions = RiskOfOptions.Instance;

		private protected ManualLogSource _logger;

		private protected string _name;

		private protected AvConfiguration(ConfigFile configFile, string category, string key, string description, bool defaultSetting = true)
		{
			_name = "c.t.a.c." + GetType().Name;
			_logger = Logger.CreateLogSource(_name);
			try
			{
				_configEntry = configFile.Bind<bool>(category, key, defaultSetting, description);
				SetBehavior();
				HandleEvent(_configEntry, null);
				_configEntry.SettingChanged += HandleEvent;
				s_riskOfOptions.AddOption(_configEntry);
				_logger.LogDebug((object)"Configuration completed.");
			}
			catch (Exception ex)
			{
				_logger.LogError((object)ex);
				throw new ConfigurationException(_name, ex);
			}
		}

		private protected abstract void HandleEvent(object x, EventArgs args);

		private protected abstract void SetBehavior();
	}
	internal class BlastShowerConfiguration : AvConfiguration
	{
		private static Transform s_cleanseTransform;

		private static EffectComponent s_effectComponent;

		private const string Description = "Enables Blast Shower's effects.\r\n\r\nToggle: Effective immediately\r\n";

		public BlastShowerConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Blast Shower", "Enables Blast Shower's effects.\r\n\r\nToggle: Effective immediately\r\n")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			bool value = ((ConfigEntry<bool>)x).Value;
			_logger.LogDebug((object)$"Cleanse effects enabled={value}");
			((Behaviour)s_effectComponent).enabled = value;
			_logger.LogDebug((object)$"Index set to : {s_effectComponent.effectIndex}");
			for (int i = 0; i < s_cleanseTransform.childCount; i++)
			{
				((Component)s_cleanseTransform.GetChild(i)).gameObject.SetActive(value);
			}
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Addressables.LoadAsset<GameObject>((object)"RoR2/Base/Cleanse/CleanseEffect.prefab").WaitForCompletion();
			s_cleanseTransform = obj.transform;
			s_effectComponent = obj.GetComponent<EffectComponent>();
			((Behaviour)s_effectComponent).enabled = _configEntry.Value;
		}
	}
	internal class BortalConfiguration : AvConfiguration
	{
		private Light _light;

		private PostProcessVolume _postProcessVolume;

		public BortalConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Blue Portal Glow", "Bortal is too bright.\n\nRequires next stage to take effect")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			if ((Object)(object)_light != (Object)null && (Object)(object)_postProcessVolume != (Object)null)
			{
				bool value = ((ConfigEntry<bool>)x).Value;
				((Behaviour)_light).enabled = value;
				((Behaviour)_postProcessVolume).enabled = value;
			}
		}

		private protected override void SetBehavior()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			HUD.Awake += new hook_Awake(callback);
			Stage.Start += new hook_Start(stageStart);
		}

		private IEnumerator stageStart(orig_Start orig, Stage self)
		{
			yield return orig.Invoke(self);
			GameObject val = GameObject.Find("PortalShop");
			if ((Object)(object)val != (Object)null)
			{
				Light componentInChildren = val.GetComponentInChildren<Light>();
				setLightRange(componentInChildren);
			}
		}

		private void callback(orig_Awake orig, HUD self)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAsset<GameObject>((object)"RoR2/Base/PortalShop/PortalShop.prefab").WaitForCompletion();
			_light = val.GetComponentInChildren<Light>();
			setLightRange(_light);
			_postProcessVolume = val.GetComponentInChildren<PostProcessVolume>();
			((Behaviour)_postProcessVolume).enabled = _configEntry.Value;
			orig.Invoke(self);
		}

		private void setLightRange(Light light)
		{
			light.range = (_configEntry.Value ? 100 : 20);
		}
	}
	internal class ConfigurationException : Exception
	{
		public ConfigurationException(string message, Exception ex)
			: base(message, ex)
		{
		}
	}
	internal class FireworkTailConfiguration : AvConfiguration
	{
		private static TrailRenderer s_trailRenderer;

		public FireworkTailConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Fireworks Tails", "Fireworks normally have tails")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			bool value = ((ConfigEntry<bool>)x).Value;
			((Renderer)s_trailRenderer).enabled = value;
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			s_trailRenderer = ((Component)Addressables.LoadAsset<GameObject>((object)"RoR2/Base/Firework/FireworkGhost.prefab").WaitForCompletion().GetComponent<ProjectileGhostController>()).GetComponent<TrailRenderer>();
		}
	}
	internal class FrelicAvConfiguration
	{
		private readonly RiskOfOptions _riskOfOptions = RiskOfOptions.Instance;

		private protected ManualLogSource _logger;

		private readonly ConfigEntry<bool> _soundEnabled;

		private readonly ConfigEntry<bool> _fovEnabled;

		private readonly ConfigEntry<bool> _particlesEnabled;

		private readonly FieldInfo _icicleAuraAimRequest;

		internal FrelicAvConfiguration(ConfigFile configFile)
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			_logger = Logger.CreateLogSource("c.t.a.c." + GetType().Name);
			string text = "Enables the temporary FOV change that Frost Relic's on-kill proc gives. Does not affect the particle effects (see the Frost Relic Particles option).\n\nEffective immediately";
			_fovEnabled = configFile.Bind<bool>(Category.BASE_VFX, "Frost Relic FOV", true, text);
			string text2 = "Enables the chunk and ring effects of Frost Relic. Does not affect the spherical area effect that indicates the item's area of effect, or the floating ice crystal that follows characters with the Frost Relic item.\n\nEffective immediately";
			_particlesEnabled = configFile.Bind<bool>(Category.BASE_VFX, "Frost Relic Particles", true, text2);
			_soundEnabled = configFile.Bind<bool>(Category.BASE_SFX, "Frost Relic Sound", true, "Enables the sound effects of Frost Relic's on-kill proc.\n\nEffective immediately");
			BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
			_icicleAuraAimRequest = typeof(IcicleAuraController).GetField("aimRequest", bindingAttr);
			IcicleAuraController.OnIcicleGained += new hook_OnIcicleGained(FrelicGainedEventHandler);
			IcicleAuraController.OnIciclesActivated += new hook_OnIciclesActivated(FrelicActivationEventHandler);
			_riskOfOptions.AddOption(_fovEnabled);
			_riskOfOptions.AddOption(_particlesEnabled);
			_riskOfOptions.AddOption(_soundEnabled);
			_logger.LogDebug((object)"Configuration completed.");
		}

		private void FrelicActivationEventHandler(orig_OnIciclesActivated _, IcicleAuraController self)
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			if (_soundEnabled.Value)
			{
				Util.PlaySound("Play_item_proc_icicle", ((Component)self).gameObject);
			}
			if (_fovEnabled.Value)
			{
				CameraTargetParams component = self.owner.GetComponent<CameraTargetParams>();
				if (Object.op_Implicit((Object)(object)component))
				{
					_icicleAuraAimRequest.SetValue(self, component.RequestAimType((AimType)2));
				}
			}
			ParticleSystem[] auraParticles = self.auraParticles;
			foreach (ParticleSystem val in auraParticles)
			{
				if (_particlesEnabled.Value | (((Object)val).name == "Area"))
				{
					MainModule main = val.main;
					((MainModule)(ref main)).loop = true;
					val.Play();
				}
			}
		}

		private void FrelicGainedEventHandler(orig_OnIcicleGained orig, IcicleAuraController self)
		{
			ParticleSystem[] procParticles = self.procParticles;
			foreach (ParticleSystem val in procParticles)
			{
				if (_particlesEnabled.Value | (((Object)val).name == "Area"))
				{
					val.Play();
				}
			}
		}
	}
	internal class GortalConfiguration : AvConfiguration
	{
		private static float timer = 0f;

		private static float delay = 0.5f;

		public GortalConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Gold Shores Portal", "Gortal is too bright.\n\nEffect is relatively immmediate, though re-enabling may require a new level")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
		}

		private protected override void SetBehavior()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			HUD.Update += new hook_Update(update);
		}

		private void update(orig_Update orig, HUD self)
		{
			orig.Invoke(self);
			timer += Time.deltaTime;
			if (timer > delay)
			{
				GameObject val = GameObject.Find("PortalGoldshores(Clone)");
				if ((Object)(object)val != (Object)null)
				{
					val.GetComponentInChildren<Light>().range = (_configEntry.Value ? 100 : 20);
					((Behaviour)val.GetComponentInChildren<PostProcessVolume>()).enabled = _configEntry.Value;
				}
				timer -= delay;
			}
		}
	}
	internal class IdpVisualConfiguration : AvConfiguration
	{
		private const string Description = "Enables the spore, plus sign, and mushroom visual effects from Interstellar Desk Plant's healing ward indicator. \r\nDoes not affect the particle effects of the Desk Plant seed, or the perimeter sphere of the ward.\r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level\r\n";

		private GameObject _deskPlantSpores;

		private GameObject _deskPlantSymbols;

		private GameObject _deskPlantMushrooms;

		public IdpVisualConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Interstellar Desk Plant Vfx", "Enables the spore, plus sign, and mushroom visual effects from Interstellar Desk Plant's healing ward indicator. \r\nDoes not affect the particle effects of the Desk Plant seed, or the perimeter sphere of the ward.\r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level\r\n")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args = null)
		{
			bool value = ((ConfigEntry<bool>)x).Value;
			_deskPlantSpores.SetActive(value);
			_deskPlantSymbols.SetActive(value);
			_deskPlantMushrooms.SetActive(value);
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)Addressables.LoadAsset<GameObject>((object)"RoR2/Base/Plant/DeskplantWard.prefab").WaitForCompletion().transform.Find("Indicator")).gameObject.transform;
			_deskPlantSpores = ((Component)transform.Find("Spores")).gameObject;
			_deskPlantSymbols = ((Component)transform.Find("HealingSymbols")).gameObject;
			_deskPlantMushrooms = ((Component)transform.Find("MushroomMeshes")).gameObject;
		}
	}
	internal class KjaroVisualConfiguration : AvConfiguration
	{
		private static GameObject s_smoke;

		private static GameObject s_tornadoMeshCore;

		private static GameObject s_tornadoMeshCoreWide;

		private static GameObject s_embers;

		private static GameObject s_pointLight;

		private static GameObject s_initialBurst;

		public KjaroVisualConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Kjaros Band", "Enables Kjaro's Band's fire tornado.\n\nEffective immediately")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			ToggleEffects(((ConfigEntry<bool>)x).Value);
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = Addressables.LoadAsset<GameObject>((object)"RoR2/Base/ElementalRings/FireTornadoGhost.prefab").WaitForCompletion().transform;
			s_smoke = ((Component)transform.Find("Smoke")).gameObject;
			s_tornadoMeshCore = ((Component)transform.Find("TornadoMeshCore")).gameObject;
			s_tornadoMeshCoreWide = ((Component)transform.Find("TornadoMeshCore, Wide")).gameObject;
			s_embers = ((Component)transform.Find("Embers")).gameObject;
			s_pointLight = ((Component)transform.Find("Point Light")).gameObject;
			s_initialBurst = ((Component)transform.Find("InitialBurst")).gameObject;
			ToggleEffects(_configEntry.Value);
		}

		private void ToggleEffects(bool enabled)
		{
			s_smoke.SetActive(enabled);
			s_tornadoMeshCore.SetActive(enabled);
			s_tornadoMeshCoreWide.SetActive(enabled);
			s_embers.SetActive(enabled);
			s_pointLight.SetActive(enabled);
			s_initialBurst.SetActive(enabled);
		}
	}
	internal class PlasmaShrimpConfiguration : AvConfiguration
	{
		private static EffectComponent s_effectComponent;

		public PlasmaShrimpConfiguration(ConfigFile configFile)
			: base(configFile, Category.VOID_SFX, "Plasma Shrimp Sounds", "Sounds like bowling! \nRequires restart to take effect :(")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			((Behaviour)s_effectComponent).enabled = ((ConfigEntry<bool>)x).Value;
			s_effectComponent.soundName = (_configEntry.Value ? "Play_item_void_critGlasses" : "");
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			s_effectComponent = Addressables.LoadAsset<GameObject>((object)"RoR2/DLC1/MissileVoid/MissileVoidOrbEffect.prefab").WaitForCompletion().GetComponent<EffectComponent>();
			((Behaviour)s_effectComponent).enabled = _configEntry.Value;
			s_effectComponent.soundName = (_configEntry.Value ? "Play_item_void_critGlasses" : "");
		}
	}
	internal class RoseBucklerConfiguration : AvConfiguration
	{
		private static AkEvent s_event;

		private Event _enabledEvent;

		public RoseBucklerConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_SFX, "Rose Buckler SFX", "Buckler noise when you start sprinting")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			if (!((ConfigEntry<bool>)x).Value)
			{
				s_event.data = null;
			}
			else
			{
				s_event.data = _enabledEvent;
			}
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			s_event = Addressables.LoadAsset<GameObject>((object)"RoR2/Base/SprintArmor/BucklerDefense.prefab").WaitForCompletion().GetComponent<AkEvent>();
			_enabledEvent = s_event.data;
		}
	}
	internal class RunaldsVisualConfiguration : AvConfiguration
	{
		private static EffectComponent s_effectComponent;

		private static Transform s_transform;

		public RunaldsVisualConfiguration(ConfigFile configFile)
			: base(configFile, Category.BASE_VFX, "Runalds Band", "Enables Runald's Band's ice explosion.\n\nEffective immediately")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			bool value = ((ConfigEntry<bool>)x).Value;
			((Behaviour)s_effectComponent).enabled = value;
			for (int i = 0; i < s_transform.childCount; i++)
			{
				((Component)s_transform.GetChild(i)).gameObject.SetActive(value);
			}
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Addressables.LoadAsset<GameObject>((object)"RoR2/Base/ElementalRings/IceRingExplosion.prefab").WaitForCompletion();
			s_transform = obj.transform;
			s_effectComponent = obj.GetComponent<EffectComponent>();
			((Behaviour)s_effectComponent).enabled = _configEntry.Value;
		}
	}
	internal class ViendAudioConfiguration : AvConfiguration
	{
		private SprintEffectController _sprintEffectController;

		public ViendAudioConfiguration(ConfigFile configFile)
			: base(configFile, Category.UNIT_EFFECTS, "Viend Sprint/Jump SFX", "Enable run/jump sound effects\nRequires new level/run to take effect")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			bool value = ((ConfigEntry<bool>)x).Value;
			((Behaviour)_sprintEffectController).enabled = value;
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAsset<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion();
			_sprintEffectController = val.GetComponent<SprintEffectController>();
		}
	}
	internal class WungusAudioConfiguration : AvConfiguration
	{
		private LoopSoundPlayer MushroomVoidAudio;

		private const string Description = "Enables Weeping Fungus sound effects. \r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level";

		public WungusAudioConfiguration(ConfigFile configFile)
			: base(configFile, Category.VOID_SFX, "Weeping Fungus Sound", "Enables Weeping Fungus sound effects. \r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			((Behaviour)MushroomVoidAudio).enabled = ((ConfigEntry<bool>)x).Value;
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAsset<GameObject>((object)"RoR2/DLC1/MushroomVoid/MushroomVoidEffect.prefab").WaitForCompletion();
			MushroomVoidAudio = val.GetComponent<LoopSoundPlayer>();
			((Behaviour)MushroomVoidAudio).enabled = _configEntry.Value;
		}
	}
	internal class WungusVisualConfiguration : AvConfiguration
	{
		private TemporaryVisualEffect _mushroomVoidVisual;

		private const string Description = "Enables Weeping Fungus' visual particle effects. \r\nThis includes the floating plus symbols, the floating spore particles, and the void star particle effects. \r\nDoes not affect the generic green healing pulsing effect. \r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level";

		public WungusVisualConfiguration(ConfigFile configFile)
			: base(configFile, Category.VOID_VFX, "Weeping Fungus Visuals", "Enables Weeping Fungus' visual particle effects. \r\nThis includes the floating plus symbols, the floating spore particles, and the void star particle effects. \r\nDoes not affect the generic green healing pulsing effect. \r\n\r\nDisable: Effective immediately\r\nEnable: Effective on next level")
		{
		}

		private protected override void HandleEvent(object x, EventArgs args)
		{
			((Behaviour)_mushroomVoidVisual).enabled = ((ConfigEntry<bool>)x).Value;
		}

		private protected override void SetBehavior()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAsset<GameObject>((object)"RoR2/DLC1/MushroomVoid/MushroomVoidEffect.prefab").WaitForCompletion();
			_mushroomVoidVisual = val.GetComponent<TemporaryVisualEffect>();
			((Behaviour)_mushroomVoidVisual).enabled = _configEntry.Value;
		}
	}
}