Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Bobots AV Effect Options v3.0.0
plugins/AVOptions/AVOptions.dll
Decompiled 2 hours agousing System; using System.Collections; using System.Collections.Generic; 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 AK.Wwise; using AVOptions.Configurations; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HG.Reflection; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.UI; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Audio; using RoR2.Projectile; using RoR2.UI; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AVOptions")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("2.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+db762eb3fcbe90135827991a705e577ccceaccc9")] [assembly: AssemblyProduct("AVOptions")] [assembly: AssemblyTitle("AVOptions")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 AVOptions { [BepInPlugin("com.thejpaproject.AVFX_Options", "Bobot's AV Effect Options", "3.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class AvOptions : BaseUnityPlugin { public static FlickerConfiguration _flickerConfiguration; public static DamageFlashConfiguration _damageFlashConfiguration; public static BlastShowerConfiguration _blastShowerConfiguration; public static FireworkTailConfiguration _fireworkTailConfiguration; public static FrelicAvConfiguration _frelicAvConfiguration; public static IdpVisualConfiguration _idpVisualConfiguration; public static KjaroVisualConfiguration _kjaroVisualConfiguration; public static PlasmaShrimpConfiguration _plasmaShrimpConfiguration; public static RoseBucklerConfiguration _roseBucklerConfiguration; public static RunaldsVisualConfiguration _runaldsVisualConfiguration; public static ViendAudioConfiguration _viendAudioConfiguration; public static WungusVisualConfiguration _wungusVisualConfiguration; public static WungusAudioConfiguration _wungusAudioConfiguration; public static BortalConfiguration _bortalConfiguration; public static GortalConfiguration _gortalConfiguration; public static LittleDiscipleConfiguration _littleDiscipleConfiguration; public static BrilliantBehemothConfiguration brilliantBehemothConfiguration; public static FaradaySpurConfiguration _faradaySpurConfiguration; public static FaradaySpurSoundConfiguration _faradaySpurSoundConfiguration; public static GhostBladeConfiguration _ghostBladeConfiguration; public static ShurikenConfiguration _shurikenConfiguration; public static AntlerConfiguration _antlerConfiguration; public static AvOptions Instance; [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] private void Awake() { Instance = this; try { RiskOfOptions.Configure(); brilliantBehemothConfiguration = new BrilliantBehemothConfiguration(((BaseUnityPlugin)this).Config); _blastShowerConfiguration = new BlastShowerConfiguration(((BaseUnityPlugin)this).Config); _bortalConfiguration = new BortalConfiguration(((BaseUnityPlugin)this).Config); PrefabConfigurer.BindVfx("KillEliteFrenzy/NoCooldownEffect", "Brainstalks", "Enables Brainstalks' screen effect. \n\nEffective upon next activation"); _fireworkTailConfiguration = new FireworkTailConfiguration(((BaseUnityPlugin)this).Config); _frelicAvConfiguration = new FrelicAvConfiguration(((BaseUnityPlugin)this).Config); PrefabConfigurer.BindVfx("IgniteOnKill/IgniteExplosionVFX", "Gasoline", "Enables Gasoline's explosion\n\nEffective immediately"); _gortalConfiguration = new GortalConfiguration(((BaseUnityPlugin)this).Config); _idpVisualConfiguration = new IdpVisualConfiguration(((BaseUnityPlugin)this).Config); _kjaroVisualConfiguration = new KjaroVisualConfiguration(((BaseUnityPlugin)this).Config); PrefabConfigurer.BindVfx("FireballsOnHit/FireMeatBallGhost", "Molten Perforator Fireballs", "Enables the Molten Perforator fireballs.\n\nEffective immediately"); _plasmaShrimpConfiguration = new PlasmaShrimpConfiguration(((BaseUnityPlugin)this).Config); PrefabConfigurer.BindVoidVfx("MissileVoid/MissileVoidOrbEffect", "Plasma Shrimp Orbs", "It's the missiles that shoot out.\n\nEffective immediately"); _shurikenConfiguration = new ShurikenConfiguration(((BaseUnityPlugin)this).Config); _roseBucklerConfiguration = new RoseBucklerConfiguration(((BaseUnityPlugin)this).Config); _runaldsVisualConfiguration = new RunaldsVisualConfiguration(((BaseUnityPlugin)this).Config); _littleDiscipleConfiguration = new LittleDiscipleConfiguration(((BaseUnityPlugin)this).Config); PrefabConfigurer.BindVfx("BleedOnHitAndExplode/BleedOnHitAndExplode_Explosion", "Shatterspleen", "Enables Shatterspleen's explosion.\n\nEffective immediately"); PrefabConfigurer.BindVfx("Tonic/TonicBuffEffect", "Spinel Tonic", "Enables Spinel Tonic's screen effect. \n\nEffective upon next activation"); PrefabConfigurer.BindVfx("StickyBomb/StickyBombGhost", "Sticky Bomb Bombs", "Enables Sticky Bomb's bombs.\n\nEffective immediately"); PrefabConfigurer.BindVfx("StickyBomb/BehemothVFX", "Sticky Bomb Explosion", "Enables Sticky Bomb's explosion.\n\nEffective immediately"); _antlerConfiguration = new AntlerConfiguration(((BaseUnityPlugin)this).Config); _faradaySpurConfiguration = new FaradaySpurConfiguration(((BaseUnityPlugin)this).Config); _faradaySpurSoundConfiguration = new FaradaySpurSoundConfiguration(((BaseUnityPlugin)this).Config); _ghostBladeConfiguration = new GhostBladeConfiguration(((BaseUnityPlugin)this).Config); _flickerConfiguration = new FlickerConfiguration(((BaseUnityPlugin)this).Config); _damageFlashConfiguration = new DamageFlashConfiguration(((BaseUnityPlugin)this).Config); 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.\n\nEffective immediately"); _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!"); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("AVOptions"); if (num >= 0) { callerPath = callerPath.Substring(num + "AVOptions".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Debug(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogDebug((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Debug_NoCallerPrefix(object data) { _logSource.LogDebug(data); } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } public static class PrefabConfigurer { public static Dictionary<string, ConfigEntry<bool>> configEntries = new Dictionary<string, ConfigEntry<bool>>(); public static void BindVfx(string assetPath, string title, string description) { BindAsset(Category.BASE_VFX, "Base/" + assetPath, title, description); } public static void BindSfx(string assetPath, string title, string description) { BindAsset(Category.BASE_SFX, "Base/" + assetPath, title, description); } public static void BindVoidVfx(string assetPath, string title, string description) { BindAsset(Category.VOID_VFX, "DLC1/" + assetPath, title, description); } public static void BindVoidSfx(string assetPath, string title, string description) { BindAsset(Category.VOID_SFX, "DLC1/" + assetPath, title, description); } public static void BindACVfx(string assetPath, string title, string description) { BindAsset(Category.AC_VFX, "DLC3/" + assetPath, title, description); } public static void BindACSfx(string assetPath, string title, string description) { BindAsset(Category.AC_SFX, "DLC3/" + assetPath, title, description); } public static void BindHCVfx(string assetPath, string title, string description) { BindAsset(Category.HC_VFX, "DLC4/" + assetPath, title, description); } public static void BindHCSfx(string assetPath, string title, string description) { BindAsset(Category.HC_SFX, "DLC4/" + assetPath, title, description); } public static void BindAsset(string category, string assetPath, string title, string description) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Addressables.LoadAsset<GameObject>((object)("RoR2/" + assetPath + ".prefab")).WaitForCompletion(); ConfigEntry<bool> value = ((BaseUnityPlugin)AvOptions.Instance).Config.Bind<bool>(category, title, true, description); configEntries.Add(title, value); val.AddComponent<BindVfx>().configKey = title; RiskOfOptions.AddOption(value); } catch (Exception ex) { throw new ConfigurationException(assetPath, ex); } } } public static class RiskOfOptions { private static readonly bool s_enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static void AddOption(ConfigEntry<bool> value) { if (s_enabled) { Add(value); } } public static void AddSliderOption(ConfigEntry<int> value) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown if (s_enabled) { ModSettingsManager.AddOption((BaseOption)new IntSliderOption(value, new IntSliderConfig { min = 0, max = 100, formatString = "{0}%" })); } } private static void Add(ConfigEntry<bool> value) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(value)); } public static void Configure() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!s_enabled) { return; } ModSettingsManager.SetModDescription("Enable or disable various item audio/visual effects."); using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AVOptions.resources.icon.png"); Texture2D val = new Texture2D(0, 0); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); if (ImageConversion.LoadImage(val, array)) { ModSettingsManager.SetModIcon(Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero)); } } } } namespace AVOptions.Configurations { public class BlastShowerConfiguration : AvConfiguration { private static Transform s_cleanseTransform; private static EffectComponent s_effectComponent; private const string Description = "Enables Blast Shower's effects.\n\nEffective immediately"; public BlastShowerConfiguration(ConfigFile configFile) : base(configFile, Category.BASE_VFX, "Blast Shower", "Enables Blast Shower's effects.\n\nEffective immediately") { } protected override void HandleEvent(object x, EventArgs args) { //IL_0045: 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); } } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Cleanse.CleanseEffect_prefab).WaitForCompletion(); s_cleanseTransform = val.transform; s_effectComponent = val.GetComponent<EffectComponent>(); ((Behaviour)s_effectComponent).enabled = _configEntry.Value; } } public 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") { } 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; } } protected override void SetBehavior() { //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 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); if (NetworkServer.active) { GameObject bortal = GameObject.Find("PortalShop"); if (!((Object)(object)bortal == (Object)null)) { Light light = bortal.GetComponentInChildren<Light>(); setLightRange(light); } } } private void Callback(orig_Awake orig, HUD self) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) 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); } } public class BrilliantBehemothConfiguration : AvConfiguration { public BrilliantBehemothConfiguration(ConfigFile configFile) : base(configFile, Category.BASE_VFX, "Brilliant Behemoth", "Behemoth explosion.\n\nEffective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; } protected override void SetBehavior() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnHitAllProcess += new Manipulator(GlobalEventManagerOnOnHitAllProcess); } private void GlobalEventManagerOnOnHitAllProcess(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = val.DefineLabel(); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "Behemoth"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective") })) { _logger.LogWarning((object)"BrilliantBehemothConfiguration.GlobalEventManagerOnOnHitAllProcess GetItemCountEffective(Behemoth) TryGotoNext failed"); return; } if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(LegacyResourcesAPI), "Load") })) { _logger.LogWarning((object)"BrilliantBehemothConfiguration.GlobalEventManagerOnOnHitAllProcess OmniExplosionVFXQuick TryGotoNext failed"); return; } val.EmitDelegate<Func<bool>>((Func<bool>)(() => _configEntry.Value)); val.Emit(OpCodes.Brfalse, (object)val2); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(EffectManager), "SpawnEffect") })) { _logger.LogWarning((object)"BrilliantBehemothConfiguration.GlobalEventManagerOnOnHitAllProcess EffectManager.SpawnEffect TryGotoNext failed"); } else { val.MarkLabel(val2); } } } public class FireworkTailConfiguration : AvConfiguration { private static TrailRenderer s_trailRenderer; public FireworkTailConfiguration(ConfigFile configFile) : base(configFile, Category.BASE_VFX, "Fireworks Tails", "Fireworks normally have tails.\n\nEffective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; ((Renderer)s_trailRenderer).enabled = value; } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Firework.FireworkGhost_prefab).WaitForCompletion(); ProjectileGhostController component = val.GetComponent<ProjectileGhostController>(); s_trailRenderer = ((Component)component).GetComponent<TrailRenderer>(); } } public class FrelicAvConfiguration { 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_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) 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(); } } } } public 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") { } protected override void HandleEvent(object x, EventArgs args) { } protected override void SetBehavior() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) { Light componentInChildren = val.GetComponentInChildren<Light>(); componentInChildren.range = (_configEntry.Value ? 100 : 20); PostProcessVolume componentInChildren2 = val.GetComponentInChildren<PostProcessVolume>(); ((Behaviour)componentInChildren2).enabled = _configEntry.Value; } timer -= delay; } } } public class IdpVisualConfiguration : AvConfiguration { private const string Description = "Enables the spore, plus sign, and mushroom visual effects from Interstellar Desk Plant's healing ward indicator. \nDoes not affect the particle effects of the Desk Plant seed, or the perimeter sphere of the ward.\n\nDisable: Effective immediately\nEnable: Effective on next level\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. \nDoes not affect the particle effects of the Desk Plant seed, or the perimeter sphere of the ward.\n\nDisable: Effective immediately\nEnable: Effective on next level\n") { } protected override void HandleEvent(object x, EventArgs args = null) { bool value = ((ConfigEntry<bool>)x).Value; _deskPlantSpores.SetActive(value); _deskPlantSymbols.SetActive(value); _deskPlantMushrooms.SetActive(value); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)Addressables.LoadAssetAsync<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; } } public 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") { } protected override void HandleEvent(object x, EventArgs args) { ToggleEffects(((ConfigEntry<bool>)x).Value); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Transform transform = Addressables.LoadAssetAsync<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); } } public class LittleDiscipleConfiguration : AvConfiguration { private static AkEvent[] s_events; private Event[] _enabledEvents; public LittleDiscipleConfiguration(ConfigFile configFile) : base(configFile, Category.BASE_SFX, "Little Disciple Sounds", "Laughing sound when the Little Disciple wisps spawn and its impact sound.\n\nEffective immediately", defaultSetting: true, needsEffectCatalog: true) { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; for (int i = 0; i < s_events.Length; i++) { s_events[i].data = ((!value) ? null : _enabledEvents[i]); } } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_SprintWisp.WispOrbEffect_prefab).WaitForCompletion(); s_events = val.GetComponents<AkEvent>(); _enabledEvents = (Event[])(object)new Event[s_events.Length]; for (int i = 0; i < s_events.Length; i++) { _enabledEvents[i] = s_events[i].data; } } } public 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.\n\nEffective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_event.data = ((!value) ? null : _enabledEvent); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_SprintArmor.BucklerDefense_prefab).WaitForCompletion(); s_event = val.GetComponent<AkEvent>(); _enabledEvent = s_event.data; } } public 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") { } 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++) { Transform child = s_transform.GetChild(i); ((Component)child).gameObject.SetActive(value); } } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_ElementalRings.IceRingExplosion_prefab).WaitForCompletion(); s_transform = val.transform; s_effectComponent = val.GetComponent<EffectComponent>(); ((Behaviour)s_effectComponent).enabled = _configEntry.Value; } } public class PlasmaShrimpConfiguration : AvConfiguration { private static EffectDef s_effectDef; public PlasmaShrimpConfiguration(ConfigFile configFile) : base(configFile, Category.VOID_SFX, "Plasma Shrimp Sounds", "Sounds like bowling!.\n\nEffective immediately", defaultSetting: true, needsEffectCatalog: true) { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_effectDef.spawnSoundEventName = (value ? "Play_item_void_critGlasses" : string.Empty); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) EffectIndex val = EffectCatalog.FindEffectIndex("MissileVoidOrbEffect"); s_effectDef = EffectCatalog.GetEffectDef(val); s_effectDef.spawnSoundEventName = (_configEntry.Value ? "Play_item_void_critGlasses" : string.Empty); } } public class ShurikenConfiguration : AvConfiguration { private static ProjectileController s_projectileController; private static ProjectileSingleTargetImpact s_projectileSingleTargetImpact; public ShurikenConfiguration(ConfigFile configFile) : base(configFile, Category.VOID_SFX, "Shuriken Spawn Sound", "for wife.\n\nEffective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_projectileController.startSound = (value ? "Play_bandit2_m2_alt_throw" : string.Empty); s_projectileSingleTargetImpact.hitSoundString = (value ? "Play_bandit2_m2_impact" : string.Empty); s_projectileSingleTargetImpact.enemyHitSoundString = (value ? "Play_bandit2_m2_impact" : string.Empty); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_PrimarySkillShuriken.ShurikenProjectile_prefab).WaitForCompletion(); s_projectileController = val.GetComponent<ProjectileController>(); s_projectileSingleTargetImpact = val.GetComponent<ProjectileSingleTargetImpact>(); } } public 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") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; ((Behaviour)_sprintEffectController).enabled = value; } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_VoidSurvivor.VoidSurvivorBody_prefab).WaitForCompletion(); _sprintEffectController = val.GetComponent<SprintEffectController>(); } } public class WungusAudioConfiguration : AvConfiguration { private LoopSoundPlayer MushroomVoidAudio; private const string Description = "Enables Weeping Fungus sound effects. \n\nDisable: Effective immediately\nEnable: Effective on next level"; public WungusAudioConfiguration(ConfigFile configFile) : base(configFile, Category.VOID_SFX, "Weeping Fungus Sound", "Enables Weeping Fungus sound effects. \n\nDisable: Effective immediately\nEnable: Effective on next level") { } protected override void HandleEvent(object x, EventArgs args) { ((Behaviour)MushroomVoidAudio).enabled = ((ConfigEntry<bool>)x).Value; } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_MushroomVoid.MushroomVoidEffect_prefab).WaitForCompletion(); MushroomVoidAudio = val.GetComponent<LoopSoundPlayer>(); ((Behaviour)MushroomVoidAudio).enabled = _configEntry.Value; } } public class WungusVisualConfiguration : AvConfiguration { private TemporaryVisualEffect _mushroomVoidVisual; private const string Description = "Enables Weeping Fungus' visual particle effects. \nThis includes the floating plus symbols, the floating spore particles, and the void star particle effects. \nDoes not affect the generic green healing pulsing effect. \n\nDisable: Effective immediately\nEnable: Effective on next level"; public WungusVisualConfiguration(ConfigFile configFile) : base(configFile, Category.VOID_VFX, "Weeping Fungus Visuals", "Enables Weeping Fungus' visual particle effects. \nThis includes the floating plus symbols, the floating spore particles, and the void star particle effects. \nDoes not affect the generic green healing pulsing effect. \n\nDisable: Effective immediately\nEnable: Effective on next level") { } protected override void HandleEvent(object x, EventArgs args) { ((Behaviour)_mushroomVoidVisual).enabled = ((ConfigEntry<bool>)x).Value; } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_MushroomVoid.MushroomVoidEffect_prefab).WaitForCompletion(); _mushroomVoidVisual = val.GetComponent<TemporaryVisualEffect>(); ((Behaviour)_mushroomVoidVisual).enabled = _configEntry.Value; } } public class AntlerConfiguration : AvConfiguration { private const string Description = "Enables Elusive Antler's orb spawn sound.\n\nToggle: Effective immediately"; private static ElusiveAntlersPickup s_pickup; private Event _enabledEvent; public AntlerConfiguration(ConfigFile configFile) : base(configFile, Category.SOTS_SFX, "Elusive Antler Orbs", "Enables Elusive Antler's orb spawn sound.\n\nToggle: Effective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_pickup.shardSpawnEvent = ((!value) ? null : _enabledEvent); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Items_SpeedBoostPickup.ElusiveAntlersPickup_prefab).WaitForCompletion(); s_pickup = val.GetComponent<ElusiveAntlersPickup>(); _enabledEvent = s_pickup.shardSpawnEvent; } } public class ChransionConfiguration : AvConfiguration { private static IncreaseDamageOnMultiKillItemDisplayUpdater s_displayUpdater; private static float s_blinkBelow; public ChransionConfiguration(ConfigFile configFile) : base(configFile, Category.SOTS_SFX, "Chronic Expansion Beep", "Chronic Expansion beeping and text flashing") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_displayUpdater.blinkBelow = (value ? s_blinkBelow : 0f); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAsset<GameObject>((object)"RoR2/DLC2/Items/IncreaseDamageOnMultiKill/DisplayIncreaseDamageOnMultiKill.prefab").WaitForCompletion(); s_displayUpdater = val.GetComponent<IncreaseDamageOnMultiKillItemDisplayUpdater>(); s_blinkBelow = s_displayUpdater.blinkBelow; } } public class FaradaySpurConfiguration : AvConfiguration { private static Transform s_strikeTransform; private static EffectComponent s_effectComponent; private const string Description = "Enables Faraday Spur's explosion.\n\nToggle: Effective immediately"; public FaradaySpurConfiguration(ConfigFile configFile) : base(configFile, Category.AC_VFX, "Faraday Spur Explosion", "Enables Faraday Spur's explosion.\n\nToggle: Effective immediately") { } 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_strikeTransform.childCount; i++) { ((Component)s_strikeTransform.GetChild(i)).gameObject.SetActive(value); } } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC3_Items_JumpDamageStrike.JumpDamageStrikeVFX_prefab).WaitForCompletion(); s_strikeTransform = val.transform; s_effectComponent = val.GetComponent<EffectComponent>(); ((Behaviour)s_effectComponent).enabled = _configEntry.Value; } } public class FaradaySpurSoundConfiguration : AvConfiguration { private static Transform s_soundEmitterTransform; private const string Description = "Enables Faraday Spur's zapping sound it makes when charged.\n\nToggle: Effective immediately"; public FaradaySpurSoundConfiguration(ConfigFile configFile) : base(configFile, Category.AC_SFX, "Faraday Spur", "Enables Faraday Spur's zapping sound it makes when charged.\n\nToggle: Effective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; _logger.LogDebug((object)$"FaradaySpurSound effects enabled={value}"); ((Component)s_soundEmitterTransform.GetChild(0).GetChild(2)).gameObject.SetActive(value); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC3_Items_JumpDamageStrike.JumpDamageStrikeLightningAura_prefab).WaitForCompletion(); s_soundEmitterTransform = val.transform; } } public class GhostBladeConfiguration : AvConfiguration { private static ProjectileController s_projectileController; private static LoopSoundDef s_flightSoundLoop; private const string Description = "Enables Stained Scimitar's sounds.\r\n\r\nToggle: Effective immediately"; public GhostBladeConfiguration(ConfigFile configFile) : base(configFile, Category.HC_SFX, "Stained Scimitar", "Enables Stained Scimitar's sounds.\r\n\r\nToggle: Effective immediately") { } protected override void HandleEvent(object x, EventArgs args) { bool value = ((ConfigEntry<bool>)x).Value; s_projectileController.flightSoundLoop = (value ? s_flightSoundLoop : null); s_projectileController.startSound = (value ? "Play_Item_Cursed_GhostBlades_Spawn" : null); } protected override void SetBehavior() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC4_GhostBlades.GhostBladesProjectile_prefab).WaitForCompletion(); s_projectileController = val.GetComponent<ProjectileController>(); s_flightSoundLoop = s_projectileController.flightSoundLoop; } } internal static class Category { public static readonly string FLICKERING = "FLICKERING/FLASHES"; 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"; public static readonly string SOTS_VFX = "SOTS VFX"; public static readonly string SOTS_SFX = "SOTS SFX"; public static readonly string AC_VFX = "AC VFX"; public static readonly string AC_SFX = "AC SFX"; public static readonly string HC_VFX = "HC VFX"; public static readonly string HC_SFX = "HC SFX"; } public abstract class AvConfiguration { protected ConfigEntry<bool> _configEntry; protected ManualLogSource _logger; private string _name; protected AvConfiguration(ConfigFile configFile, string category, string key, string description, bool defaultSetting = true, bool needsEffectCatalog = false) { _name = "c.t.a.c." + GetType().Name; _logger = Logger.CreateLogSource(_name); try { _configEntry = configFile.Bind<bool>(category, key, defaultSetting, description); if (needsEffectCatalog) { if (((ResourceAvailability)(ref EffectCatalog.availability)).available) { } _configEntry.SettingChanged += delegate(object sender, EventArgs args) { if (((ResourceAvailability)(ref EffectCatalog.availability)).available) { HandleEvent(sender, args); } }; ((ResourceAvailability)(ref EffectCatalog.availability)).CallWhenAvailable((Action)delegate { SetBehavior(); HandleEvent(_configEntry, null); }); } else { SetBehavior(); HandleEvent(_configEntry, null); _configEntry.SettingChanged += HandleEvent; } RiskOfOptions.AddOption(_configEntry); _logger.LogDebug((object)"Configuration completed."); } catch (Exception ex) { _logger.LogError((object)ex); throw new ConfigurationException(_name, ex); } } protected abstract void HandleEvent(object x, EventArgs args); protected abstract void SetBehavior(); } public class BindVfx : MonoBehaviour { public string configKey; private void OnEnable() { ((Component)this).gameObject.SetActive(PrefabConfigurer.configEntries[configKey].Value); } } internal class ConfigurationException : Exception { public ConfigurationException(string message, Exception ex) : base(message, ex) { } } public class DamageFlashConfiguration { private protected ManualLogSource _logger; private readonly ConfigEntry<int> _damageFlashSliderPlayer; private readonly ConfigEntry<int> _damageFlashSliderOther; private readonly ConfigEntry<int> _healFlashSliderPlayer; private readonly ConfigEntry<int> _healFlashSliderOther; internal DamageFlashConfiguration(ConfigFile configFile) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown _logger = Logger.CreateLogSource("c.t.a.c." + GetType().Name); _damageFlashSliderPlayer = configFile.Bind<int>(Category.FLICKERING, "Ally Damage Flash Intensity", 100, "Controls the intensity of the orange flash on allies' models when they take damage.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_damageFlashSliderPlayer); _damageFlashSliderOther = configFile.Bind<int>(Category.FLICKERING, "Enemy Damage Flash Intensity", 100, "Controls the intensity of the orange flash on enemies models when they take damage.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_damageFlashSliderOther); _healFlashSliderPlayer = configFile.Bind<int>(Category.FLICKERING, "Ally Heal Flash Intensity", 100, "Controls the intensity of the green flash on allies' models when they heal.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_healFlashSliderPlayer); _healFlashSliderOther = configFile.Bind<int>(Category.FLICKERING, "Enemy Heal Flash Intensity", 100, "Controls the intensity of the green flash on enemies' models when they heal.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_healFlashSliderOther); _logger.LogDebug((object)"Configuration completed."); CharacterModel.UpdateMaterials += new Manipulator(CharacterModelOnUpdateMaterials); } private void CharacterModelOnUpdateMaterials(ILContext il) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_00bd: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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) ILCursor val = new ILCursor(il); int colourVar = -1; float num = default(float); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<CharacterModel>(x, "healFlashColor"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Color>(x, "op_Multiply"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref colourVar) })) { _logger.LogWarning((object)"DamageFlashConfiguration.CharacterModelOnUpdateMaterials healFlashColor TryGotoNext failed"); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_S, (byte)colourVar); val.EmitDelegate<Func<CharacterModel, Color, Color>>((Func<CharacterModel, Color, Color>)delegate(CharacterModel model, Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) num = (((int)model.body.teamComponent.teamIndex == 1) ? _healFlashSliderPlayer.Value : _healFlashSliderOther.Value); num /= 100f; num = Mathf.Clamp01(num); return color * num; }); val.Emit(OpCodes.Stloc_S, (byte)colourVar); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<CharacterModel>(x, "hitFlashShieldColor"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Color>(x, "op_Multiply"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, colourVar) })) { _logger.LogWarning((object)"DamageFlashConfiguration.CharacterModelOnUpdateMaterials hitFlashShieldColor TryGotoNext failed"); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_S, (byte)colourVar); val.EmitDelegate<Func<CharacterModel, Color, Color>>((Func<CharacterModel, Color, Color>)delegate(CharacterModel model, Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) num = (((int)model.body.teamComponent.teamIndex == 1) ? _damageFlashSliderPlayer.Value : _damageFlashSliderOther.Value); num /= 100f; num = Mathf.Clamp01(num); return color * num; }); val.Emit(OpCodes.Stloc_S, (byte)colourVar); } } public class FlickerConfiguration { private protected ManualLogSource _logger; private readonly ConfigEntry<int> _flickerIntensitySlider; private readonly ConfigEntry<int> _flickerSpeedSlider; internal FlickerConfiguration(ConfigFile configFile) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown _logger = Logger.CreateLogSource("c.t.a.c." + GetType().Name); _flickerIntensitySlider = configFile.Bind<int>(Category.FLICKERING, "Flickering Light Intensity", 100, "Controls the intensity of (most) flickering lights.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_flickerIntensitySlider); _flickerSpeedSlider = configFile.Bind<int>(Category.FLICKERING, "Flickering Light Speed", 100, "Controls the speed of (most) flickering lights.\n\nEffective immediately"); RiskOfOptions.AddSliderOption(_flickerSpeedSlider); FlickerLight.Update += new Manipulator(FlickerLightOnUpdate); } private void FlickerLightOnUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<FlickerLight>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Time>(x, "get_deltaTime") })) { _logger.LogWarning((object)"FlickerLight.FlickerLightOnUpdate get_deltaTime TryGotoNext failed"); return; } val.EmitDelegate<Func<float, float>>((Func<float, float>)delegate(float time) { float num = (float)_flickerSpeedSlider.Value / 100f; return time * Mathf.Clamp01(num); }); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<FlickerLight>(x, "stopwatch"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Wave>(x, "Evaluate") })) { _logger.LogWarning((object)"FlickerLight.FlickerLightOnUpdate Wave.Evaluate TryGotoNext failed"); return; } val.EmitDelegate<Func<float, float>>((Func<float, float>)delegate(float wave) { float num = (float)_flickerIntensitySlider.Value / 100f; return wave * Mathf.Clamp01(num); }); } } }