Decompiled source of NoWeaponsGlow v1.0.1

plugins/NoWeaponsGlow.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using NoWeaponsGlow.Common;
using NoWeaponsGlow.Prefabs;
using NoWeaponsGlow.Prefabs.Code;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("NoWeaponsGlow")]
[assembly: AssemblyDescription("Disables glow of various weapons in Valheim.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoWeaponsGlow")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("748670d6-f89a-325f-037b-502ec1c79424")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
internal static class PluginInfo
{
	public const string PluginGUID = "noglow.NoWeaponsGlow";

	public const string PluginName = "NoWeaponsGlow";

	public const string PluginDescription = "Disables glow of various weapons in Valheim.";

	public const string PluginVersion = "1.0.0";
}
namespace NoWeaponsGlow
{
	internal class PluginConfig
	{
		public static ConfigFile File;

		public static ConfigEntry<bool> DisableGlowOnDraugarFang;

		public static ConfigEntry<bool> DisableGlowOnSpineSnap;

		public static ConfigEntry<bool> DisableGlowOnFrostner;

		public static ConfigEntry<bool> DisableGlowOnCrystalBattleaxe;

		public static ConfigEntry<bool> DisableGlowOnMistwalker;

		public static ConfigEntry<bool> DisableGlowOnPorcupine;

		public static ConfigEntry<bool> DisableGlowOnJotunBane;

		public static ConfigEntry<bool> DisableGlowOnHimminafl;

		public static ConfigEntry<bool> DisableGlowOnStaffOfEmbers;

		public static ConfigEntry<bool> DisableGlowOnStaffOfFrost;

		public static ConfigEntry<bool> DisableGlowOnStaffOfProtection;

		public static ConfigEntry<bool> DisableGlowOnDeadRaiser;

		public static ConfigEntry<bool> DisableGlowOnDyrnwyn;

		public static void Bind(ConfigFile config)
		{
			if (File == null)
			{
				File = config;
				DisableGlowOnDraugarFang = config.Bind<bool>("Disable glow and effects", "Draugar Fang", true, "Draugar Fang");
				DisableGlowOnSpineSnap = config.Bind<bool>("Disable glow and effects", "Spine snap", true, "Spine Snap");
				DisableGlowOnFrostner = config.Bind<bool>("Disable glow and effects", "Frostner", true, "Frostner");
				DisableGlowOnCrystalBattleaxe = config.Bind<bool>("Disable glow and effects", "Crystal Battleaxe", true, "Crystal Battleaxe");
				DisableGlowOnMistwalker = config.Bind<bool>("Disable glow and effects", "Mistwalker", true, "Mistwalker");
				DisableGlowOnPorcupine = config.Bind<bool>("Disable glow and effects", "Porcupine", true, "Porcupine");
				DisableGlowOnJotunBane = config.Bind<bool>("Disable glow and effects", "Jotun Bane", true, "Jotun Bane");
				DisableGlowOnHimminafl = config.Bind<bool>("Disable glow and effects", "Himminafl", true, "Himminafl");
				DisableGlowOnStaffOfEmbers = config.Bind<bool>("Disable glow and effects", "Staff of Embers", true, "Staff of Embers");
				DisableGlowOnStaffOfFrost = config.Bind<bool>("Disable glow and effects", "Staff of Frost", true, "Staff of Frost");
				DisableGlowOnStaffOfProtection = config.Bind<bool>("Disable glow and effects", "Staff of Protection", true, "Staff of Protection");
				DisableGlowOnDeadRaiser = config.Bind<bool>("Disable glow and effects", "Dead Raiser", true, "Dead Raiser");
				DisableGlowOnDyrnwyn = config.Bind<bool>("Disable glow and effects", "Dyrnwyn", true, "Dyrnwyn");
			}
		}
	}
	internal static class Flags
	{
		public static PrefabState DraugarFang;

		public static PrefabState SpineSnap;

		public static PrefabState Frostner;

		public static PrefabState CrystalBattleaxe;

		public static PrefabState Mistwalker;

		public static PrefabState Porcupine;

		public static PrefabState JotunBane;

		public static PrefabState Himminafl;

		public static PrefabState StaffOfEmbers;

		public static PrefabState StaffOfFrost;

		public static PrefabState StaffOfProtection;

		public static PrefabState DeadRaiser;

		public static PrefabState Dyrnwyn;

		public static bool Evaluate()
		{
			bool flag = false;
			flag = Evaluate(ref DraugarFang, PluginConfig.DisableGlowOnDraugarFang.Value) || flag;
			flag = Evaluate(ref SpineSnap, PluginConfig.DisableGlowOnSpineSnap.Value) || flag;
			flag = Evaluate(ref Frostner, PluginConfig.DisableGlowOnFrostner.Value) || flag;
			flag = Evaluate(ref CrystalBattleaxe, PluginConfig.DisableGlowOnCrystalBattleaxe.Value) || flag;
			flag = Evaluate(ref Mistwalker, PluginConfig.DisableGlowOnMistwalker.Value) || flag;
			flag = Evaluate(ref Porcupine, PluginConfig.DisableGlowOnPorcupine.Value) || flag;
			flag = Evaluate(ref JotunBane, PluginConfig.DisableGlowOnJotunBane.Value) || flag;
			flag = Evaluate(ref Himminafl, PluginConfig.DisableGlowOnHimminafl.Value) || flag;
			flag = Evaluate(ref StaffOfEmbers, PluginConfig.DisableGlowOnStaffOfEmbers.Value) || flag;
			flag = Evaluate(ref StaffOfFrost, PluginConfig.DisableGlowOnStaffOfFrost.Value) || flag;
			flag = Evaluate(ref StaffOfProtection, PluginConfig.DisableGlowOnStaffOfProtection.Value) || flag;
			flag = Evaluate(ref DeadRaiser, PluginConfig.DisableGlowOnDeadRaiser.Value) || flag;
			return Evaluate(ref Dyrnwyn, PluginConfig.DisableGlowOnDyrnwyn.Value) || flag;
		}

		private static bool Evaluate(ref PrefabState state, bool config)
		{
			if (config)
			{
				state = PrefabState.ToModify;
				return true;
			}
			if (state == PrefabState.ToRestore)
			{
				return false;
			}
			if (state == PrefabState.Modified)
			{
				state = PrefabState.ToRestore;
				return true;
			}
			state = PrefabState.Unknown;
			return false;
		}
	}
	[BepInPlugin("noglow.NoWeaponsGlow", "NoWeaponsGlow", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	internal class Plugin : BaseUnityPlugin
	{
		public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization();

		public void Awake()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Invalid comparison between Unknown and I4
			if ((int)SystemInfo.graphicsDeviceType != 4)
			{
				PluginConfig.Bind(((BaseUnityPlugin)this).Config);
				PrefabManager.OnVanillaPrefabsAvailable += OnVanillaPrefabsAvailable;
			}
		}

		private static void OnVanillaPrefabsAvailable()
		{
			if (Flags.Evaluate())
			{
				Dictionary<string, GameObject> dictionary = Controller.Find();
				if (dictionary.Count != 0)
				{
					Controller.Restore(dictionary);
					Controller.Modify(dictionary);
				}
			}
		}
	}
}
namespace NoWeaponsGlow.Common
{
	internal enum PrefabState
	{
		Unknown,
		ToModify,
		Modified,
		ToRestore,
		Restored
	}
	internal static class GameObjectExtensions
	{
		public static bool SetChildrenInactive(this GameObject prefab, params string[] names)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			int num = 0;
			Transform[] componentsInChildren = prefab.GetComponentsInChildren<Transform>(false);
			foreach (Transform val in componentsInChildren)
			{
				if ((Object)(object)val != (Object)null && names.Contains<string>(((Object)val).name, StringComparer.InvariantCultureIgnoreCase))
				{
					GameObject gameObject = ((Component)val).gameObject;
					if ((Object)(object)gameObject != (Object)null)
					{
						gameObject.SetActive(false);
						num++;
					}
				}
			}
			return num > 0;
		}

		public static bool SetSubChildrenInactive(this GameObject prefab, string subParent, params string[] names)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			Transform val = prefab.GetComponentsInChildren<Transform>(true)?.FirstOrDefault((Func<Transform, bool>)((Transform x) => string.Compare(((Object)x).name, subParent, StringComparison.InvariantCultureIgnoreCase) == 0));
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			int num = 0;
			Transform[] componentsInChildren = ((Component)val).GetComponentsInChildren<Transform>(false);
			foreach (Transform val2 in componentsInChildren)
			{
				if ((Object)(object)val2 != (Object)null && names.Contains<string>(((Object)val2).name, StringComparer.InvariantCultureIgnoreCase))
				{
					GameObject gameObject = ((Component)val2).gameObject;
					if ((Object)(object)gameObject != (Object)null)
					{
						gameObject.SetActive(false);
						num++;
					}
				}
			}
			return num > 0;
		}

		public static bool SetChildrenActive(this GameObject prefab, params string[] names)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			int num = 0;
			Transform[] componentsInChildren = prefab.GetComponentsInChildren<Transform>(true);
			foreach (Transform val in componentsInChildren)
			{
				if ((Object)(object)val != (Object)null && names.Contains<string>(((Object)val).name, StringComparer.InvariantCultureIgnoreCase))
				{
					GameObject gameObject = ((Component)val).gameObject;
					if ((Object)(object)gameObject != (Object)null)
					{
						gameObject.SetActive(true);
						num++;
					}
				}
			}
			return num > 0;
		}

		public static bool SetSubChildrenActive(this GameObject prefab, string subParent, params string[] names)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			Transform val = prefab.GetComponentsInChildren<Transform>(true)?.FirstOrDefault((Func<Transform, bool>)((Transform x) => string.Compare(((Object)x).name, subParent, StringComparison.InvariantCultureIgnoreCase) == 0));
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			int num = 0;
			Transform[] componentsInChildren = ((Component)val).GetComponentsInChildren<Transform>(true);
			foreach (Transform val2 in componentsInChildren)
			{
				if ((Object)(object)val2 != (Object)null && names.Contains<string>(((Object)val2).name, StringComparer.InvariantCultureIgnoreCase))
				{
					GameObject gameObject = ((Component)val2).gameObject;
					if ((Object)(object)gameObject != (Object)null)
					{
						gameObject.SetActive(true);
						num++;
					}
				}
			}
			return num > 0;
		}

		public static bool DisableShaderKeyword(this GameObject prefab, string rendererName, string keyword)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			Renderer val = ((prefab == null) ? null : prefab.GetComponentsInChildren<Renderer>()?.FirstOrDefault((Func<Renderer, bool>)((Renderer x) => StringComparer.InvariantCultureIgnoreCase.Compare(((Object)x).name, rendererName) == 0)));
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			Material sharedMaterial = val.sharedMaterial;
			if ((Object)(object)sharedMaterial == (Object)null)
			{
				return false;
			}
			sharedMaterial.DisableKeyword(keyword);
			return true;
		}

		public static bool EnableShaderKeyword(this GameObject prefab, string rendererName, string keyword)
		{
			if ((Object)(object)prefab == (Object)null)
			{
				return false;
			}
			Renderer val = ((prefab == null) ? null : prefab.GetComponentsInChildren<Renderer>()?.FirstOrDefault((Func<Renderer, bool>)((Renderer x) => StringComparer.InvariantCultureIgnoreCase.Compare(((Object)x).name, rendererName) == 0)));
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			Material sharedMaterial = val.sharedMaterial;
			if ((Object)(object)sharedMaterial == (Object)null)
			{
				return false;
			}
			sharedMaterial.EnableKeyword(keyword);
			return true;
		}
	}
}
namespace NoWeaponsGlow.Prefabs
{
	internal static class Controller
	{
		private static readonly HashSet<string> Names = new HashSet<string>
		{
			"BattleaxeCrystal", "StaffSkeleton", "BowDraugrFang", "SwordIronFire", "MaceSilver", "AtgeirHimminAfl", "AxeJotunBane", "SwordMistwalker", "MaceNeedle", "BowSpineSnap",
			"StaffFireball", "StaffIceShards", "StaffShield"
		};

		public static Dictionary<string, GameObject> Find()
		{
			Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>();
			foreach (string name2 in Names)
			{
				GameObject prefab = PrefabManager.Instance.GetPrefab(name2);
				if (!((Object)(object)prefab == (Object)null) && !string.IsNullOrEmpty(((Object)prefab).name))
				{
					string name = ((Object)prefab).name;
					dictionary.Add(name, prefab);
				}
			}
			return dictionary;
		}

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			bool flag = true;
			flag = DraugarFang.Modify(prefabs) && flag;
			flag = SpineSnap.Modify(prefabs) && flag;
			flag = Frostner.Modify(prefabs) && flag;
			flag = CrystalBattleaxe.Modify(prefabs) && flag;
			flag = Mistwalker.Modify(prefabs) && flag;
			flag = Porcupine.Modify(prefabs) && flag;
			flag = JotunBane.Modify(prefabs) && flag;
			flag = Himminafl.Modify(prefabs) && flag;
			flag = StaffOfEmbers.Modify(prefabs) && flag;
			flag = StaffOfFrost.Modify(prefabs) && flag;
			flag = StaffOfProtection.Modify(prefabs) && flag;
			flag = DeadRaiser.Modify(prefabs) && flag;
			return Dyrnwyn.Modify(prefabs) && flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			bool flag = true;
			flag = DraugarFang.Restore(prefabs) && flag;
			flag = SpineSnap.Restore(prefabs) && flag;
			flag = Frostner.Restore(prefabs) && flag;
			flag = CrystalBattleaxe.Restore(prefabs) && flag;
			flag = Mistwalker.Restore(prefabs) && flag;
			flag = Porcupine.Restore(prefabs) && flag;
			flag = JotunBane.Restore(prefabs) && flag;
			flag = Himminafl.Restore(prefabs) && flag;
			flag = StaffOfEmbers.Restore(prefabs) && flag;
			flag = StaffOfFrost.Restore(prefabs) && flag;
			flag = StaffOfProtection.Restore(prefabs) && flag;
			flag = DeadRaiser.Restore(prefabs) && flag;
			return Dyrnwyn.Restore(prefabs) && flag;
		}
	}
}
namespace NoWeaponsGlow.Prefabs.Code
{
	internal static class CrystalBattleaxe
	{
		public const string PrefabName = "BattleaxeCrystal";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnCrystalBattleaxe.Value)
			{
				return true;
			}
			if (Flags.CrystalBattleaxe != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BattleaxeCrystal", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point Light", "flare") && flag;
			flag = value.DisableShaderKeyword("default", "_EMISSION") && flag;
			if (flag)
			{
				Flags.CrystalBattleaxe = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.CrystalBattleaxe != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BattleaxeCrystal", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point Light", "flare") && flag;
			flag = value.EnableShaderKeyword("default", "_EMISSION") && flag;
			if (flag)
			{
				Flags.CrystalBattleaxe = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class Frostner
	{
		public const string PrefabName = "MaceSilver";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnFrostner.Value)
			{
				return true;
			}
			if (Flags.Frostner != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("MaceSilver", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("soft cloud") && flag;
			if (flag)
			{
				Flags.Frostner = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.Frostner != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("MaceSilver", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("soft cloud") && flag;
			if (flag)
			{
				Flags.Frostner = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class JotunBane
	{
		public const string PrefabName = "AxeJotunBane";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnJotunBane.Value)
			{
				return true;
			}
			if (Flags.JotunBane != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("AxeJotunBane", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "Glow", "poison drip", "poison splat") && flag;
			if (flag)
			{
				Flags.JotunBane = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.JotunBane != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("AxeJotunBane", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "Glow", "poison drip", "poison splat") && flag;
			if (flag)
			{
				Flags.JotunBane = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class Himminafl
	{
		public const string PrefabName = "AtgeirHimminAfl";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnHimminafl.Value)
			{
				return true;
			}
			if (Flags.Himminafl != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("AtgeirHimminAfl", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "Sparcs") && flag;
			if (flag)
			{
				Flags.Himminafl = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.Himminafl != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("AtgeirHimminAfl", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "Sparcs") && flag;
			if (flag)
			{
				Flags.Himminafl = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class DeadRaiser
	{
		public const string PrefabName = "StaffSkeleton";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnDeadRaiser.Value)
			{
				return true;
			}
			if (Flags.DeadRaiser != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffSkeleton", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "flames_world", "flames", "embers", "fi_vil_combs_props_bone_skull (1)") && flag;
			flag = value.DisableShaderKeyword("fi_vil_combs_props_bone_skull", "_EMISSION") && flag;
			if (flag)
			{
				Flags.DeadRaiser = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.DeadRaiser != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffSkeleton", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "flames_world", "flames", "embers", "fi_vil_combs_props_bone_skull (1)") && flag;
			flag = value.EnableShaderKeyword("fi_vil_combs_props_bone_skull", "_EMISSION") && flag;
			if (flag)
			{
				Flags.DeadRaiser = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class StaffOfEmbers
	{
		public const string PrefabName = "StaffFireball";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnStaffOfEmbers.Value)
			{
				return true;
			}
			if (Flags.StaffOfEmbers != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffFireball", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetSubChildrenInactive("equiped", "flames_world", "embers", "flames") && flag;
			flag = value.SetSubChildrenInactive("effects", "Point light", "flare", "embers") && flag;
			if (flag)
			{
				Flags.StaffOfEmbers = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.StaffOfEmbers != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffFireball", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetSubChildrenActive("equiped", "flames_world", "embers", "flames") && flag;
			flag = value.SetSubChildrenActive("effects", "Point light", "flare", "embers") && flag;
			if (flag)
			{
				Flags.StaffOfEmbers = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class StaffOfFrost
	{
		public const string PrefabName = "StaffIceShards";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnStaffOfFrost.Value)
			{
				return true;
			}
			if (Flags.StaffOfFrost != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffIceShards", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "flare", "embers (1)") && flag;
			flag = value.DisableShaderKeyword("default (1)", "_EMISSION") && flag;
			if (flag)
			{
				Flags.StaffOfFrost = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.StaffOfFrost != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffIceShards", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "flare", "embers (1)") && flag;
			flag = value.EnableShaderKeyword("default (1)", "_EMISSION") && flag;
			if (flag)
			{
				Flags.StaffOfFrost = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class StaffOfProtection
	{
		public const string PrefabName = "StaffShield";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnStaffOfProtection.Value)
			{
				return true;
			}
			if (Flags.StaffOfProtection != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffShield", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("flames") && flag;
			if (flag)
			{
				Flags.StaffOfProtection = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.StaffOfProtection != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("StaffShield", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("flames") && flag;
			if (flag)
			{
				Flags.StaffOfProtection = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class Porcupine
	{
		public const string PrefabName = "MaceNeedle";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnPorcupine.Value)
			{
				return true;
			}
			if (Flags.Porcupine != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("MaceNeedle", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point Light") && flag;
			flag = value.DisableShaderKeyword("default", "_EMISSION") && flag;
			if (flag)
			{
				Flags.Porcupine = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.Porcupine != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("MaceNeedle", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point Light") && flag;
			flag = value.EnableShaderKeyword("default", "_EMISSION") && flag;
			if (flag)
			{
				Flags.Porcupine = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class Dyrnwyn
	{
		public const string PrefabName = "SwordIronFire";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnDyrnwyn.Value)
			{
				return true;
			}
			if (Flags.Dyrnwyn != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("SwordIronFire", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "SFX", "flames (1)", "embers", "flames_local", "flames", "smoke (1)", "trail", "base", "tip") && flag;
			flag = value.DisableShaderKeyword("Viking_Sword (1)", "_EMISSION") && flag;
			if (flag)
			{
				Flags.Dyrnwyn = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.Dyrnwyn != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("SwordIronFire", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "SFX", "flames (1)", "embers", "flames_local", "flames", "smoke (1)", "trail", "base", "tip") && flag;
			flag = value.EnableShaderKeyword("Viking_Sword (1)", "_EMISSION") && flag;
			if (flag)
			{
				Flags.Dyrnwyn = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class Mistwalker
	{
		public const string PrefabName = "SwordMistwalker";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnMistwalker.Value)
			{
				return true;
			}
			if (Flags.Mistwalker != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("SwordMistwalker", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "Particle System", "Particle System Force Field") && flag;
			if (flag)
			{
				Flags.Mistwalker = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.Mistwalker != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("SwordMistwalker", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "Particle System", "Particle System Force Field") && flag;
			if (flag)
			{
				Flags.Mistwalker = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class SpineSnap
	{
		public const string PrefabName = "BowSpineSnap";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnSpineSnap.Value)
			{
				return true;
			}
			if (Flags.SpineSnap != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BowSpineSnap", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "Particle System") && flag;
			if (flag)
			{
				Flags.SpineSnap = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.SpineSnap != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BowSpineSnap", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "Particle System") && flag;
			if (flag)
			{
				Flags.SpineSnap = PrefabState.Restored;
			}
			return flag;
		}
	}
	internal static class DraugarFang
	{
		public const string PrefabName = "BowDraugrFang";

		public static bool Modify(Dictionary<string, GameObject> prefabs)
		{
			if (!PluginConfig.DisableGlowOnDraugarFang.Value)
			{
				return true;
			}
			if (Flags.DraugarFang != PrefabState.ToModify)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BowDraugrFang", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenInactive("Point light", "Particle System") && flag;
			if (flag)
			{
				Flags.DraugarFang = PrefabState.Modified;
			}
			return flag;
		}

		public static bool Restore(Dictionary<string, GameObject> prefabs)
		{
			if (Flags.DraugarFang != PrefabState.ToRestore)
			{
				return false;
			}
			if (!prefabs.TryGetValue("BowDraugrFang", out var value))
			{
				return false;
			}
			bool flag = true;
			flag = value.SetChildrenActive("Point light", "Particle System") && flag;
			if (flag)
			{
				Flags.DraugarFang = PrefabState.Restored;
			}
			return flag;
		}
	}
}