Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of FireworksMissileVisualDisabler v1.0.0
plugins/FireworksMissileVisualDisabler.dll
Decompiled a day agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("0.0.0.0")] namespace FireworksMissileVisualDisabler; [BepInPlugin("com.yourname.fireworksmissilevisualdisabler", "Fireworks Missile Visual Disabler", "1.0.0")] public class FireworksMissileVisualDisabler : BaseUnityPlugin { public const string PluginGUID = "com.yourname.fireworksmissilevisualdisabler"; public const string PluginName = "Fireworks Missile Visual Disabler"; public const string PluginVersion = "1.0.0"; private ConfigEntry<bool> disableFireworksVisuals; private ConfigEntry<bool> disableAtGMissileVisuals; private ConfigEntry<bool> disableFireworkActivationEffect; public void Awake() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) disableFireworksVisuals = ((BaseUnityPlugin)this).Config.Bind<bool>("Visual Effects", "DisableFireworksVisuals", true, "禁用烟花束的视觉效果(保留伤害)"); disableAtGMissileVisuals = ((BaseUnityPlugin)this).Config.Bind<bool>("Visual Effects", "DisableAtGMissileVisuals", true, "禁用AtG导弹的视觉效果(保留伤害)"); disableFireworkActivationEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Visual Effects", "DisableFireworkActivationEffect", true, "禁用烟花道具触发时的庆祝粒子特效"); AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Firework/FireworkGhost.prefab"); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { if ((Object)(object)handle.Result == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load FireworkGhost.prefab"); } else { GameObject result4 = handle.Result; TrailRenderer trail2 = result4.GetComponent<TrailRenderer>(); if ((Object)(object)trail2 != (Object)null) { disableFireworksVisuals.SettingChanged += delegate { ((Renderer)trail2).enabled = !disableFireworksVisuals.Value; }; ((Renderer)trail2).enabled = !disableFireworksVisuals.Value; } ParticleSystem[] componentsInChildren8 = result4.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem ps4 in componentsInChildren8) { disableFireworksVisuals.SettingChanged += delegate { if (disableFireworksVisuals.Value) { ps4.Stop(true, (ParticleSystemStopBehavior)0); } }; if (disableFireworksVisuals.Value) { ps4.Stop(true, (ParticleSystemStopBehavior)0); } } Renderer[] componentsInChildren9 = result4.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer4 in componentsInChildren9) { disableFireworksVisuals.SettingChanged += delegate { renderer4.enabled = !disableFireworksVisuals.Value; }; renderer4.enabled = !disableFireworksVisuals.Value; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Firework visual effects disabled successfully"); } }; val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/MissileGhost.prefab"); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { if ((Object)(object)handle.Result == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load MissileGhost.prefab"); } else { GameObject result3 = handle.Result; TrailRenderer trail = result3.GetComponent<TrailRenderer>(); if ((Object)(object)trail != (Object)null) { disableAtGMissileVisuals.SettingChanged += delegate { ((Renderer)trail).enabled = !disableAtGMissileVisuals.Value; }; ((Renderer)trail).enabled = !disableAtGMissileVisuals.Value; } ParticleSystem[] componentsInChildren6 = result3.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem ps3 in componentsInChildren6) { disableAtGMissileVisuals.SettingChanged += delegate { if (disableAtGMissileVisuals.Value) { ps3.Stop(true, (ParticleSystemStopBehavior)0); } }; if (disableAtGMissileVisuals.Value) { ps3.Stop(true, (ParticleSystemStopBehavior)0); } } Renderer[] componentsInChildren7 = result3.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer3 in componentsInChildren7) { disableAtGMissileVisuals.SettingChanged += delegate { renderer3.enabled = !disableAtGMissileVisuals.Value; }; renderer3.enabled = !disableAtGMissileVisuals.Value; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"AtG Missile visual effects disabled successfully"); } }; val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Firework/FireworkLauncher.prefab"); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { if ((Object)(object)handle.Result == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Failed to load FireworkLauncher.prefab"); } else { GameObject result2 = handle.Result; ParticleSystem[] componentsInChildren3 = result2.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem ps2 in componentsInChildren3) { disableFireworkActivationEffect.SettingChanged += delegate { if (disableFireworkActivationEffect.Value) { ps2.Stop(true, (ParticleSystemStopBehavior)0); } else { ps2.Play(); } }; if (disableFireworkActivationEffect.Value) { ps2.Stop(true, (ParticleSystemStopBehavior)0); } } Renderer[] componentsInChildren4 = result2.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer2 in componentsInChildren4) { disableFireworkActivationEffect.SettingChanged += delegate { renderer2.enabled = !disableFireworkActivationEffect.Value; }; renderer2.enabled = !disableFireworkActivationEffect.Value; } Light[] componentsInChildren5 = result2.GetComponentsInChildren<Light>(true); foreach (Light light in componentsInChildren5) { disableFireworkActivationEffect.SettingChanged += delegate { ((Behaviour)light).enabled = !disableFireworkActivationEffect.Value; }; ((Behaviour)light).enabled = !disableFireworkActivationEffect.Value; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Firework launcher effect disabled successfully"); } }; val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Firework/FireworkExplosion2.prefab"); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { if ((Object)(object)handle.Result == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Failed to load FireworkExplosion2.prefab"); } else { GameObject result = handle.Result; ParticleSystem[] componentsInChildren = result.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem ps in componentsInChildren) { disableFireworkActivationEffect.SettingChanged += delegate { if (disableFireworkActivationEffect.Value) { ps.Stop(true, (ParticleSystemStopBehavior)0); } else { ps.Play(); } }; if (disableFireworkActivationEffect.Value) { ps.Stop(true, (ParticleSystemStopBehavior)0); } } Renderer[] componentsInChildren2 = result.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer in componentsInChildren2) { disableFireworkActivationEffect.SettingChanged += delegate { renderer.enabled = !disableFireworkActivationEffect.Value; }; renderer.enabled = !disableFireworkActivationEffect.Value; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Firework explosion effect disabled successfully"); } }; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Fireworks Missile Visual Disabler is loaded!"); } }