using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using A2.NoGlow.Prefabs; using A2.NoGlow.Prefabs.Code; using A2.NoGlow.Unity; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Jotunn; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("No Glow")] [assembly: AssemblyDescription("Disables glow and particle effects for various objects.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("No Glow")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("ef0d6675-65f8-093d-be5f-d8f57c1d0b19")] [assembly: AssemblyFileVersion("1.2.2.0")] [assembly: AssemblyVersion("1.2.2.0")] [module: RefSafetyRules(11)] 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; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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; } } } internal static class PluginInfo { public const string PluginGUID = "A2.NoGlow"; public const string PluginName = "No Glow"; public const string PluginDescription = "Disables glow and particle effects for various objects."; public const string PluginSemanticVersion = "1.2.2"; public const string PluginFullVersion = "1.2.2.0"; } namespace A2.NoGlow { [BepInPlugin("A2.NoGlow", "No Glow", "1.2.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { private static readonly Harmony _harmony = new Harmony("A2.NoGlow"); private static bool _isInitialized = false; 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 && !_isInitialized) { _isInitialized = true; _harmony.PatchAll(); PluginConfig.Bind(((BaseUnityPlugin)this).Config); PrefabManager.OnVanillaPrefabsAvailable += OnVanillaPrefabsAvailable; } } public void OnDestroy() { if (_isInitialized) { _isInitialized = false; PrefabManager.OnVanillaPrefabsAvailable -= OnVanillaPrefabsAvailable; _harmony.UnpatchSelf(); } } private static void OnVanillaPrefabsAvailable() { Controller.Update(); } } internal class PluginConfig { public static ConfigFile? File; public static ConfigEntry? DisableGlowOnCryptKey; public static ConfigEntry? DisableGlowOnMeadEitrMinor; public static ConfigEntry? DisableGlowOnMeadFrostResist; public static ConfigEntry? DisableGlowOnMeadPoisonResist; public static ConfigEntry? DisableGlowOnMeadStaminaLingering; public static ConfigEntry? DisableGlowOnMeadStaminaMedium; public static ConfigEntry? DisableGlowOnMeadStaminaMinor; public static ConfigEntry? DisableGlowOnBlueMushroom; public static ConfigEntry? DisableGlowOnJotunPuffs; public static ConfigEntry? DisableGlowOnLargeGlowingMushroom; public static ConfigEntry? DisableGlowOnMagecap; public static ConfigEntry? DisableGlowOnThistle; public static ConfigEntry? DisableGlowOnYellowMushroom; public static ConfigEntry? DisableGlowOnArtisanTable; public static ConfigEntry? DisableGlowOnGaldrTable; public static ConfigEntry? DisableGlowOnCrystalBattleaxe; public static ConfigEntry? DisableGlowOnDeadRaiser; public static ConfigEntry? DisableGlowOnDraugrFang; public static ConfigEntry? DisableGlowOnDyrnwyn; public static ConfigEntry? DisableGlowOnFrostner; public static ConfigEntry? DisableGlowOnHimminafl; public static ConfigEntry? DisableGlowOnJotunBane; public static ConfigEntry? DisableGlowOnMistwalker; public static ConfigEntry? DisableGlowOnPorcupine; public static ConfigEntry? DisableGlowOnSpineSnap; public static ConfigEntry? DisableGlowOnStaffOfEmbers; public static ConfigEntry? DisableGlowOnStaffOfFrost; public static ConfigEntry? DisableGlowOnStaffOfProtection; public static ConfigEntry? DisableGlowOnStaffOfTheWild; public static void Bind(ConfigFile config) { if (File == null) { File = config; DisableGlowOnCryptKey = WithChangedHandler(config.Bind("Items", "Swamp key", true, "Swamp key")); DisableGlowOnMeadEitrMinor = WithChangedHandler(config.Bind("Items", "Minor eitr mead", true, "Minor eitr mead")); DisableGlowOnMeadFrostResist = WithChangedHandler(config.Bind("Items", "Frost resistance mead", true, "Frost resistance mead")); DisableGlowOnMeadPoisonResist = WithChangedHandler(config.Bind("Items", "Poison resistance mead", true, "Poison resistance mead")); DisableGlowOnMeadStaminaLingering = WithChangedHandler(config.Bind("Items", "Lingering stamina mead", true, "Lingering stamina mead")); DisableGlowOnMeadStaminaMedium = WithChangedHandler(config.Bind("Items", "Medium stamina mead", true, "Medium stamina mead")); DisableGlowOnMeadStaminaMinor = WithChangedHandler(config.Bind("Items", "Minor stamina mead", true, "Minor stamina mead")); DisableGlowOnBlueMushroom = WithChangedHandler(config.Bind("Plants", "Blue mushroom", true, "Blue mushroom")); DisableGlowOnJotunPuffs = WithChangedHandler(config.Bind("Plants", "Jotun puffs", true, "Jotun puffs")); DisableGlowOnLargeGlowingMushroom = WithChangedHandler(config.Bind("Plants", "Large glowing mushroom", true, "Large glowing mushroom")); DisableGlowOnMagecap = WithChangedHandler(config.Bind("Plants", "Magecap", true, "Magecap")); DisableGlowOnThistle = WithChangedHandler(config.Bind("Plants", "Thistle", true, "Thistle")); DisableGlowOnYellowMushroom = WithChangedHandler(config.Bind("Plants", "Yellow mushroom", true, "Yellow mushroom")); DisableGlowOnArtisanTable = WithChangedHandler(config.Bind("Structures", "Artisan table", true, "Artisan table")); DisableGlowOnGaldrTable = WithChangedHandler(config.Bind("Structures", "Galdr table", true, "Galdr table")); DisableGlowOnCrystalBattleaxe = WithChangedHandler(config.Bind("Weapons", "Crystal battleaxe", true, "Crystal battleaxe")); DisableGlowOnDeadRaiser = WithChangedHandler(config.Bind("Weapons", "Dead Raiser", true, "Dead Raiser")); DisableGlowOnDraugrFang = WithChangedHandler(config.Bind("Weapons", "Draugr Fang", true, "Draugr Fang")); DisableGlowOnDyrnwyn = WithChangedHandler(config.Bind("Weapons", "Dyrnwyn", true, "Dyrnwyn")); DisableGlowOnFrostner = WithChangedHandler(config.Bind("Weapons", "Frostner", true, "Frostner")); DisableGlowOnHimminafl = WithChangedHandler(config.Bind("Weapons", "Himminafl", true, "Himminafl")); DisableGlowOnJotunBane = WithChangedHandler(config.Bind("Weapons", "Jotun Bane", true, "Jotun Bane")); DisableGlowOnMistwalker = WithChangedHandler(config.Bind("Weapons", "Mistwalker", true, "Mistwalker")); DisableGlowOnPorcupine = WithChangedHandler(config.Bind("Weapons", "Porcupine", true, "Porcupine")); DisableGlowOnSpineSnap = WithChangedHandler(config.Bind("Weapons", "Spinesnap", true, "Spinesnap")); DisableGlowOnStaffOfEmbers = WithChangedHandler(config.Bind("Weapons", "Staff of Embers", true, "Staff of Embers")); DisableGlowOnStaffOfFrost = WithChangedHandler(config.Bind("Weapons", "Staff of Frost", true, "Staff of Frost")); DisableGlowOnStaffOfProtection = WithChangedHandler(config.Bind("Weapons", "Staff of Protection", true, "Staff of Protection")); DisableGlowOnStaffOfTheWild = WithChangedHandler(config.Bind("Weapons", "Staff of the Wild", true, "Staff of the Wild")); } } private static ConfigEntry? WithChangedHandler(ConfigEntry? configEntry) { if (configEntry != null) { configEntry.SettingChanged += OnSettingsChanged; } return configEntry; } private static void OnSettingsChanged(object sender, EventArgs e) { Controller.Update(); } } } namespace A2.NoGlow.Unity { 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(false); foreach (Transform val in componentsInChildren) { if ((Object)(object)val != (Object)null && names.Contains(((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) { string subParent2 = subParent; if ((Object)(object)prefab == (Object)null) { return false; } Transform val = prefab.GetComponentsInChildren(true)?.FirstOrDefault((Func)((Transform x) => string.Compare(((Object)x).name, subParent2, StringComparison.InvariantCultureIgnoreCase) == 0)); if ((Object)(object)val == (Object)null) { return false; } int num = 0; Transform[] componentsInChildren = ((Component)val).GetComponentsInChildren(false); foreach (Transform val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null && names.Contains(((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(true); foreach (Transform val in componentsInChildren) { if ((Object)(object)val != (Object)null && names.Contains(((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) { string subParent2 = subParent; if ((Object)(object)prefab == (Object)null) { return false; } Transform val = prefab.GetComponentsInChildren(true)?.FirstOrDefault((Func)((Transform x) => string.Compare(((Object)x).name, subParent2, StringComparison.InvariantCultureIgnoreCase) == 0)); if ((Object)(object)val == (Object)null) { return false; } int num = 0; Transform[] componentsInChildren = ((Component)val).GetComponentsInChildren(true); foreach (Transform val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null && names.Contains(((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) { string rendererName2 = rendererName; if ((Object)(object)prefab == (Object)null) { return false; } Renderer val = ((prefab == null) ? null : prefab.GetComponentsInChildren()?.FirstOrDefault((Func)((Renderer x) => StringComparer.InvariantCultureIgnoreCase.Compare(((Object)x).name, rendererName2) == 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) { string rendererName2 = rendererName; if ((Object)(object)prefab == (Object)null) { return false; } Renderer val = ((prefab == null) ? null : prefab.GetComponentsInChildren()?.FirstOrDefault((Func)((Renderer x) => StringComparer.InvariantCultureIgnoreCase.Compare(((Object)x).name, rendererName2) == 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 A2.NoGlow.Prefabs { internal static class Controller { private static readonly HashSet Names = new HashSet { "CryptKey", "MeadEitrMinor", "MeadFrostResist", "MeadPoisonResist", "MeadStaminaLingering", "MeadStaminaMedium", "MeadStaminaMinor", "Pickable_Mushroom_blue", "MushroomBlue", "Pickable_Mushroom_JotunPuffs", "GlowingMushroom", "Pickable_Mushroom_Magecap", "Pickable_Thistle", "Pickable_Mushroom_yellow", "MushroomYellow", "piece_artisanstation", "piece_magetable", "BattleaxeCrystal", "StaffSkeleton", "BowDraugrFang", "SwordIronFire", "SwordDyrnwyn", "MaceSilver", "AtgeirHimminAfl", "AxeJotunBane", "SwordMistwalker", "MaceNeedle", "BowSpineSnap", "StaffFireball", "StaffIceShards", "StaffShield", "StaffGreenRoots" }; private static Dictionary Find() { Dictionary dictionary = new Dictionary(); 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; } private static Dictionary FindClones() { return (from go in (from t in Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0) select ((Component)t).gameObject).Where(delegate(GameObject go) { string item = (((Object)go).name.EndsWith("(Clone)") ? ((Object)go).name.Substring(0, ((Object)go).name.Length - 7) : ((Object)go).name); return Names.Contains(item); }) group go by (!((Object)go).name.EndsWith("(Clone)")) ? ((Object)go).name : ((Object)go).name.Substring(0, ((Object)go).name.Length - 7)).ToDictionary((IGrouping g) => g.Key, (IGrouping g) => g.ToArray()); } private static bool Modify(IReadOnlyDictionary prefabs, Dictionary clones) { bool flag = true; flag = CryptKey.Modify(prefabs, clones) && flag; flag = MeadEitrMinor.Modify(prefabs, clones) && flag; flag = MeadFrostResist.Modify(prefabs, clones) && flag; flag = MeadPoisonResist.Modify(prefabs, clones) && flag; flag = MeadStaminaLingering.Modify(prefabs, clones) && flag; flag = MeadStaminaMedium.Modify(prefabs, clones) && flag; flag = MeadStaminaMinor.Modify(prefabs, clones) && flag; flag = BlueMushroom.Modify(prefabs, clones) && flag; flag = JotunPuffs.Modify(prefabs, clones) && flag; flag = LargeGlowingMushroom.Modify(prefabs, clones) && flag; flag = Magecap.Modify(prefabs, clones) && flag; flag = Thistle.Modify(prefabs, clones) && flag; flag = YellowMushroom.Modify(prefabs, clones) && flag; flag = ArtisanTable.Modify(prefabs, clones) && flag; flag = GaldrTable.Modify(prefabs, clones) && flag; flag = CrystalBattleaxe.Modify(prefabs, clones) && flag; flag = DeadRaiser.Modify(prefabs, clones) && flag; flag = DraugrFang.Modify(prefabs, clones) && flag; flag = Dyrnwyn.Modify(prefabs, clones) && flag; flag = Frostner.Modify(prefabs, clones) && flag; flag = Himminafl.Modify(prefabs, clones) && flag; flag = JotunBane.Modify(prefabs, clones) && flag; flag = Mistwalker.Modify(prefabs, clones) && flag; flag = Porcupine.Modify(prefabs, clones) && flag; flag = SpineSnap.Modify(prefabs, clones) && flag; flag = StaffOfEmbers.Modify(prefabs, clones) && flag; flag = StaffOfFrost.Modify(prefabs, clones) && flag; flag = StaffOfProtection.Modify(prefabs, clones) && flag; return StaffOfTheWild.Modify(prefabs, clones) && flag; } private static bool Restore(IReadOnlyDictionary prefabs, Dictionary clones) { bool flag = true; flag = CryptKey.Restore(prefabs, clones) && flag; flag = MeadEitrMinor.Restore(prefabs, clones) && flag; flag = MeadFrostResist.Restore(prefabs, clones) && flag; flag = MeadPoisonResist.Restore(prefabs, clones) && flag; flag = MeadStaminaLingering.Restore(prefabs, clones) && flag; flag = MeadStaminaMedium.Restore(prefabs, clones) && flag; flag = MeadStaminaMinor.Restore(prefabs, clones) && flag; flag = BlueMushroom.Restore(prefabs, clones) && flag; flag = JotunPuffs.Restore(prefabs, clones) && flag; flag = LargeGlowingMushroom.Restore(prefabs, clones) && flag; flag = Magecap.Restore(prefabs, clones) && flag; flag = Thistle.Restore(prefabs, clones) && flag; flag = YellowMushroom.Restore(prefabs, clones) && flag; flag = ArtisanTable.Restore(prefabs, clones) && flag; flag = GaldrTable.Restore(prefabs, clones) && flag; flag = CrystalBattleaxe.Restore(prefabs, clones) && flag; flag = DeadRaiser.Restore(prefabs, clones) && flag; flag = DraugrFang.Restore(prefabs, clones) && flag; flag = Dyrnwyn.Restore(prefabs, clones) && flag; flag = Frostner.Restore(prefabs, clones) && flag; flag = Himminafl.Restore(prefabs, clones) && flag; flag = JotunBane.Restore(prefabs, clones) && flag; flag = Mistwalker.Restore(prefabs, clones) && flag; flag = Porcupine.Restore(prefabs, clones) && flag; flag = SpineSnap.Restore(prefabs, clones) && flag; flag = StaffOfEmbers.Restore(prefabs, clones) && flag; flag = StaffOfFrost.Restore(prefabs, clones) && flag; flag = StaffOfProtection.Restore(prefabs, clones) && flag; return StaffOfTheWild.Restore(prefabs, clones) && flag; } public static bool Update() { if (!Flags.Evaluate()) { return false; } Dictionary dictionary = Find(); if (dictionary.Count == 0) { return false; } Dictionary clones = FindClones(); bool flag = false; flag = Restore(dictionary, clones) || flag; return Modify(dictionary, clones) || flag; } } internal static class Flags { public static PrefabState CryptKey; public static PrefabState MeadEitrMinor; public static PrefabState MeadFrostResist; public static PrefabState MeadPoisonResist; public static PrefabState MeadStaminaLingering; public static PrefabState MeadStaminaMedium; public static PrefabState MeadStaminaMinor; public static PrefabState BlueMushroom; public static PrefabState JotunPuffs; public static PrefabState LargeGlowingMushroom; public static PrefabState Magecap; public static PrefabState Thistle; public static PrefabState YellowMushroom; public static PrefabState ArtisanTable; public static PrefabState GaldrTable; public static PrefabState CrystalBattleaxe; public static PrefabState DeadRaiser; public static PrefabState DraugrFang; public static PrefabState Dyrnwyn; public static PrefabState Frostner; public static PrefabState Himminafl; public static PrefabState JotunBane; public static PrefabState Mistwalker; public static PrefabState Porcupine; public static PrefabState SpineSnap; public static PrefabState StaffOfEmbers; public static PrefabState StaffOfFrost; public static PrefabState StaffOfProtection; public static PrefabState StaffOfTheWild; public static bool Evaluate() { bool flag = false; flag = Evaluate(ref CryptKey, PluginConfig.DisableGlowOnCryptKey?.Value ?? false) || flag; flag = Evaluate(ref MeadEitrMinor, PluginConfig.DisableGlowOnMeadEitrMinor?.Value ?? false) || flag; flag = Evaluate(ref MeadFrostResist, PluginConfig.DisableGlowOnMeadFrostResist?.Value ?? false) || flag; flag = Evaluate(ref MeadPoisonResist, PluginConfig.DisableGlowOnMeadPoisonResist?.Value ?? false) || flag; flag = Evaluate(ref MeadStaminaLingering, PluginConfig.DisableGlowOnMeadStaminaLingering?.Value ?? false) || flag; flag = Evaluate(ref MeadStaminaMedium, PluginConfig.DisableGlowOnMeadStaminaMedium?.Value ?? false) || flag; flag = Evaluate(ref MeadStaminaMinor, PluginConfig.DisableGlowOnMeadStaminaMinor?.Value ?? false) || flag; flag = Evaluate(ref BlueMushroom, PluginConfig.DisableGlowOnBlueMushroom?.Value ?? false) || flag; flag = Evaluate(ref JotunPuffs, PluginConfig.DisableGlowOnJotunPuffs?.Value ?? false) || flag; flag = Evaluate(ref LargeGlowingMushroom, PluginConfig.DisableGlowOnLargeGlowingMushroom?.Value ?? false) || flag; flag = Evaluate(ref Magecap, PluginConfig.DisableGlowOnMagecap?.Value ?? false) || flag; flag = Evaluate(ref Thistle, PluginConfig.DisableGlowOnThistle?.Value ?? false) || flag; flag = Evaluate(ref YellowMushroom, PluginConfig.DisableGlowOnYellowMushroom?.Value ?? false) || flag; flag = Evaluate(ref ArtisanTable, PluginConfig.DisableGlowOnArtisanTable?.Value ?? false) || flag; flag = Evaluate(ref GaldrTable, PluginConfig.DisableGlowOnGaldrTable?.Value ?? false) || flag; flag = Evaluate(ref CrystalBattleaxe, PluginConfig.DisableGlowOnCrystalBattleaxe?.Value ?? false) || flag; flag = Evaluate(ref DeadRaiser, PluginConfig.DisableGlowOnDeadRaiser?.Value ?? false) || flag; flag = Evaluate(ref DraugrFang, PluginConfig.DisableGlowOnDraugrFang?.Value ?? false) || flag; flag = Evaluate(ref Dyrnwyn, PluginConfig.DisableGlowOnDyrnwyn?.Value ?? false) || flag; flag = Evaluate(ref Frostner, PluginConfig.DisableGlowOnFrostner?.Value ?? false) || flag; flag = Evaluate(ref Himminafl, PluginConfig.DisableGlowOnHimminafl?.Value ?? false) || flag; flag = Evaluate(ref JotunBane, PluginConfig.DisableGlowOnJotunBane?.Value ?? false) || flag; flag = Evaluate(ref Mistwalker, PluginConfig.DisableGlowOnMistwalker?.Value ?? false) || flag; flag = Evaluate(ref Porcupine, PluginConfig.DisableGlowOnPorcupine?.Value ?? false) || flag; flag = Evaluate(ref SpineSnap, PluginConfig.DisableGlowOnSpineSnap?.Value ?? false) || flag; flag = Evaluate(ref StaffOfEmbers, PluginConfig.DisableGlowOnStaffOfEmbers?.Value ?? false) || flag; flag = Evaluate(ref StaffOfFrost, PluginConfig.DisableGlowOnStaffOfFrost?.Value ?? false) || flag; flag = Evaluate(ref StaffOfProtection, PluginConfig.DisableGlowOnStaffOfProtection?.Value ?? false) || flag; return Evaluate(ref StaffOfTheWild, PluginConfig.DisableGlowOnStaffOfTheWild?.Value ?? false) || flag; } private static bool Evaluate(ref PrefabState state, bool config) { if (config) { if (state == PrefabState.ToModify) { return true; } if (state == PrefabState.Modified) { return false; } if (state == PrefabState.ToRestore) { state = PrefabState.Modified; return false; } state = PrefabState.ToModify; return true; } if (state == PrefabState.ToRestore) { return true; } if (state == PrefabState.Modified) { state = PrefabState.ToRestore; return true; } if (state == PrefabState.ToModify) { state = PrefabState.Restored; return false; } return false; } } internal enum PrefabState { Unknown, ToModify, Modified, ToRestore, Restored } internal static class PrefabTools { public static bool TryModify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones, string prefabName, ref PrefabState state, Func modifyFunc, string callerClassName, string callerMethodName) { try { if (state != PrefabState.ToModify) { return false; } if (!prefabs.TryGetValue(prefabName, out GameObject value)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName + " not found.")); return false; } bool flag = true; if (clones.TryGetValue(prefabName, out GameObject[] value2)) { GameObject[] array = value2; foreach (GameObject arg in array) { flag = modifyFunc(arg) || flag; } } flag = modifyFunc(value) && flag; if (flag) { state = PrefabState.Modified; } return flag; } catch (Exception arg2) { Logger.LogError((object)$"{callerClassName}.{callerMethodName}: Exception occurred:\n{arg2}"); return false; } } public static bool TryModify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones, string prefabName1, string prefabName2, ref PrefabState state, Func modifyFunc1, Func modifyFunc2, string callerClassName, string callerMethodName) { try { if (state != PrefabState.ToModify) { return false; } if (!prefabs.TryGetValue(prefabName1, out GameObject value)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName1 + " not found.")); return false; } if (!prefabs.TryGetValue(prefabName2, out GameObject value2)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName2 + " not found.")); return false; } bool flag = true; if (clones.TryGetValue(prefabName1, out GameObject[] value3)) { GameObject[] array = value3; foreach (GameObject arg in array) { flag = modifyFunc1(arg) || flag; } } if (clones.TryGetValue(prefabName2, out GameObject[] value4)) { GameObject[] array = value4; foreach (GameObject arg2 in array) { flag = modifyFunc2(arg2) || flag; } } flag = modifyFunc1(value) && flag; flag = modifyFunc2(value2) && flag; if (flag) { state = PrefabState.Modified; } return flag; } catch (Exception arg3) { Logger.LogError((object)$"{callerClassName}.{callerMethodName}: Exception occurred:\n{arg3}"); return false; } } public static bool TryRestore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones, string prefabName, ref PrefabState state, Func restoreFunc, string callerClassName, string callerMethodName) { try { if (state != PrefabState.ToRestore) { return false; } if (!prefabs.TryGetValue(prefabName, out GameObject value)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName + " not found.")); return false; } bool flag = true; if (clones.TryGetValue(prefabName, out GameObject[] value2)) { GameObject[] array = value2; foreach (GameObject arg in array) { flag = restoreFunc(arg) || flag; } } flag = restoreFunc(value) && flag; if (flag) { state = PrefabState.Restored; } return flag; } catch (Exception arg2) { Logger.LogError((object)$"{callerClassName}.{callerMethodName}: Exception occurred:\n{arg2}"); return false; } } public static bool TryRestore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones, string prefabName1, string prefabName2, ref PrefabState state, Func restoreFunc1, Func restoreFunc2, string callerClassName, string callerMethodName) { try { if (state != PrefabState.ToRestore) { return false; } if (!prefabs.TryGetValue(prefabName1, out GameObject value)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName1 + " not found.")); return false; } if (!prefabs.TryGetValue(prefabName2, out GameObject value2)) { Logger.LogInfo((object)(callerClassName + "." + callerMethodName + ": Prefab " + prefabName2 + " not found.")); return false; } bool flag = true; if (clones.TryGetValue(prefabName1, out GameObject[] value3)) { GameObject[] array = value3; foreach (GameObject arg in array) { flag = restoreFunc1(arg) || flag; } } if (clones.TryGetValue(prefabName2, out GameObject[] value4)) { GameObject[] array = value4; foreach (GameObject arg2 in array) { flag = restoreFunc2(arg2) || flag; } } flag = restoreFunc1(value) && flag; flag = restoreFunc2(value2) && flag; if (flag) { state = PrefabState.Restored; } return flag; } catch (Exception arg3) { Logger.LogError((object)$"{callerClassName}.{callerMethodName}: Exception occurred:\n{arg3}"); return false; } } } } namespace A2.NoGlow.Prefabs.Code { internal static class CryptKey { public const string Name = "Swamp key"; public const string PrefabName = "CryptKey"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "CryptKey", ref Flags.CryptKey, Modify, "CryptKey", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "CryptKey", ref Flags.CryptKey, Restore, "CryptKey", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light", "Particle System") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light", "Particle System") && flag; } } internal static class MeadEitrMinor { public const string Name = "Minor eitr mead"; public const string PrefabName = "MeadEitrMinor"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadEitrMinor", ref Flags.MeadEitrMinor, Modify, "MeadEitrMinor", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadEitrMinor", ref Flags.MeadEitrMinor, Restore, "MeadEitrMinor", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class MeadFrostResist { public const string Name = "Frost resistance mead"; public const string PrefabName = "MeadFrostResist"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadFrostResist", ref Flags.MeadFrostResist, Modify, "MeadFrostResist", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadFrostResist", ref Flags.MeadFrostResist, Restore, "MeadFrostResist", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class MeadPoisonResist { public const string Name = "Poison resistance mead"; public const string PrefabName = "MeadPoisonResist"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadPoisonResist", ref Flags.MeadPoisonResist, Modify, "MeadPoisonResist", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadPoisonResist", ref Flags.MeadPoisonResist, Restore, "MeadPoisonResist", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class MeadStaminaLingering { public const string Name = "Lingering stamina mead"; public const string PrefabName = "MeadStaminaLingering"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadStaminaLingering", ref Flags.MeadStaminaLingering, Modify, "MeadStaminaLingering", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadStaminaLingering", ref Flags.MeadStaminaLingering, Restore, "MeadStaminaLingering", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class MeadStaminaMedium { public const string Name = "Medium stamina mead"; public const string PrefabName = "MeadStaminaMedium"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadStaminaMedium", ref Flags.MeadStaminaMedium, Modify, "MeadStaminaMedium", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadStaminaMedium", ref Flags.MeadStaminaMedium, Restore, "MeadStaminaMedium", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class MeadStaminaMinor { public const string Name = "Minor stamina mead"; public const string PrefabName = "MeadStaminaMinor"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MeadStaminaMinor", ref Flags.MeadStaminaMinor, Modify, "MeadStaminaMinor", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MeadStaminaMinor", ref Flags.MeadStaminaMinor, Restore, "MeadStaminaMinor", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class BlueMushroom { public const string Name = "Blue mushroom"; public const string PrefabName1 = "Pickable_Mushroom_blue"; public const string PrefabName2 = "MushroomBlue"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "Pickable_Mushroom_blue", "MushroomBlue", ref Flags.BlueMushroom, ModifyPrefab1, ModifyPrefab2, "BlueMushroom", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "Pickable_Mushroom_blue", "MushroomBlue", ref Flags.BlueMushroom, RestorePrefab1, RestorePrefab2, "BlueMushroom", "Restore"); } private static bool ModifyPrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light") && flag; return prefab.DisableShaderKeyword("visual", "_EMISSION") && flag; } private static bool ModifyPrefab2(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light") && flag; } private static bool RestorePrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light") && flag; return prefab.EnableShaderKeyword("visual", "_EMISSION") && flag; } private static bool RestorePrefab2(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light") && flag; } } internal static class JotunPuffs { public const string Name = "Jotun puffs"; public const string PrefabName = "Pickable_Mushroom_JotunPuffs"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "Pickable_Mushroom_JotunPuffs", ref Flags.JotunPuffs, Modify, "JotunPuffs", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "Pickable_Mushroom_JotunPuffs", ref Flags.JotunPuffs, Restore, "JotunPuffs", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light") && flag; } } internal static class LargeGlowingMushroom { public const string Name = "Large glowing mushroom"; public const string PrefabName = "GlowingMushroom"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "GlowingMushroom", ref Flags.LargeGlowingMushroom, Modify, "LargeGlowingMushroom", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "GlowingMushroom", ref Flags.LargeGlowingMushroom, Restore, "LargeGlowingMushroom", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light") && flag; return prefab.DisableShaderKeyword("Cube", "_EMISSION") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light") && flag; return prefab.EnableShaderKeyword("Cube", "_EMISSION") && flag; } } internal static class Magecap { public const string Name = "Magecap"; public const string PrefabName = "Pickable_Mushroom_Magecap"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "Pickable_Mushroom_Magecap", ref Flags.Magecap, Modify, "Magecap", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "Pickable_Mushroom_Magecap", ref Flags.Magecap, Restore, "Magecap", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light", "Particle System") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light", "Particle System") && flag; } } internal static class Thistle { public const string Name = "Thistle"; public const string PrefabName = "Pickable_Thistle"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "Pickable_Thistle", ref Flags.Thistle, Modify, "Thistle", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "Pickable_Thistle", ref Flags.Thistle, Restore, "Thistle", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "flare", "bees") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "flare", "bees") && flag; } } internal static class YellowMushroom { public const string Name = "Yellow mushroom"; public const string PrefabName1 = "Pickable_Mushroom_yellow"; public const string PrefabName2 = "MushroomYellow"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "Pickable_Mushroom_yellow", "MushroomYellow", ref Flags.YellowMushroom, ModifyPrefab1, ModifyPrefab2, "YellowMushroom", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "Pickable_Mushroom_yellow", "MushroomYellow", ref Flags.YellowMushroom, RestorePrefab1, RestorePrefab2, "YellowMushroom", "Restore"); } private static bool ModifyPrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light") && flag; return prefab.DisableShaderKeyword("visual", "_EMISSION") && flag; } private static bool ModifyPrefab2(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light") && flag; } private static bool RestorePrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light") && flag; return prefab.EnableShaderKeyword("visual", "_EMISSION") && flag; } private static bool RestorePrefab2(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light") && flag; } } internal static class ArtisanTable { public const string Name = "Artisan table"; public const string PrefabName = "piece_artisanstation"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "piece_artisanstation", ref Flags.ArtisanTable, Modify, "ArtisanTable", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "piece_artisanstation", ref Flags.ArtisanTable, Restore, "ArtisanTable", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetSubChildrenInactive("Tear", "flare", "smoke_expl", "pixel flakes", "Point light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetSubChildrenActive("Tear", "flare", "smoke_expl", "pixel flakes", "Point light") && flag; } } internal static class GaldrTable { public const string Name = "Galdr table"; public const string PrefabName = "piece_magetable"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "piece_magetable", ref Flags.GaldrTable, Modify, "GaldrTable", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "piece_magetable", ref Flags.GaldrTable, Restore, "GaldrTable", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Effects") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Effects") && flag; } } internal static class CrystalBattleaxe { public const string Name = "Crystal battleaxe"; public const string PrefabName = "BattleaxeCrystal"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "BattleaxeCrystal", ref Flags.CrystalBattleaxe, Modify, "CrystalBattleaxe", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "BattleaxeCrystal", ref Flags.CrystalBattleaxe, Restore, "CrystalBattleaxe", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point Light", "flare") && flag; return prefab.DisableShaderKeyword("default", "_EMISSION") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point Light", "flare") && flag; return prefab.EnableShaderKeyword("default", "_EMISSION") && flag; } } internal static class DeadRaiser { public const string Name = "Dead Raiser"; public const string PrefabName = "StaffSkeleton"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "StaffSkeleton", ref Flags.DeadRaiser, Modify, "DeadRaiser", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "StaffSkeleton", ref Flags.DeadRaiser, Restore, "DeadRaiser", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "flames", "embers", "fi_vil_combs_props_bone_skull (1)") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "flames", "embers", "fi_vil_combs_props_bone_skull (1)") && flag; } } internal static class DraugrFang { public const string Name = "Draugr Fang"; public const string PrefabName = "BowDraugrFang"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "BowDraugrFang", ref Flags.DraugrFang, Modify, "DraugrFang", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "BowDraugrFang", ref Flags.DraugrFang, Restore, "DraugrFang", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "Particle System") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "Particle System") && flag; } } internal static class Dyrnwyn { public const string Name = "Dyrnwyn"; public const string PrefabName1 = "SwordIronFire"; public const string PrefabName2 = "SwordDyrnwyn"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "SwordIronFire", "SwordDyrnwyn", ref Flags.Dyrnwyn, ModifyPrefab1, ModifyPrefab2, "Dyrnwyn", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "SwordIronFire", "SwordDyrnwyn", ref Flags.Dyrnwyn, RestorePrefab1, RestorePrefab2, "Dyrnwyn", "Restore"); } private static bool ModifyPrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light", "sfx_fire_loop", "flames (1)", "embers", "flames_local", "flames", "smoke (1)") && flag; return prefab.DisableShaderKeyword("Viking_Sword (1)", "_EMISSION") && flag; } private static bool ModifyPrefab2(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light", "Burny vfx") && flag; return prefab.DisableShaderKeyword("default", "_EMISSION") && flag; } private static bool RestorePrefab1(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light", "sfx_fire_loop", "flames (1)", "embers", "flames_local", "flames", "smoke (1)") && flag; return prefab.EnableShaderKeyword("Viking_Sword (1)", "_EMISSION") && flag; } private static bool RestorePrefab2(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light", "Burny vfx") && flag; return prefab.EnableShaderKeyword("default", "_EMISSION") && flag; } } internal static class Frostner { public const string Name = "Frostner"; public const string PrefabName = "MaceSilver"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MaceSilver", ref Flags.Frostner, Modify, "Frostner", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MaceSilver", ref Flags.Frostner, Restore, "Frostner", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("soft cloud") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("soft cloud") && flag; } } internal static class Himminafl { public const string Name = "Himminafl"; public const string PrefabName = "AtgeirHimminAfl"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "AtgeirHimminAfl", ref Flags.Himminafl, Modify, "Himminafl", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "AtgeirHimminAfl", ref Flags.Himminafl, Restore, "Himminafl", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "Sparcs") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "Sparcs") && flag; } } internal static class JotunBane { public const string Name = "Jotun Bane"; public const string PrefabName = "AxeJotunBane"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "AxeJotunBane", ref Flags.JotunBane, Modify, "JotunBane", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "AxeJotunBane", ref Flags.JotunBane, Restore, "JotunBane", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "Glow", "poison drip", "poison splat") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "Glow", "poison drip", "poison splat") && flag; } } internal static class Mistwalker { public const string Name = "Mistwalker"; public const string PrefabName = "SwordMistwalker"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "SwordMistwalker", ref Flags.Mistwalker, Modify, "Mistwalker", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "SwordMistwalker", ref Flags.Mistwalker, Restore, "Mistwalker", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "Particle System", "Particle System Force Field") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "Particle System", "Particle System Force Field") && flag; } } internal static class Porcupine { public const string Name = "Porcupine"; public const string PrefabName = "MaceNeedle"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "MaceNeedle", ref Flags.Porcupine, Modify, "Porcupine", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "MaceNeedle", ref Flags.Porcupine, Restore, "Porcupine", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point Light") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point Light") && flag; } } internal static class SpineSnap { public const string Name = "Spinesnap"; public const string PrefabName = "BowSpineSnap"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "BowSpineSnap", ref Flags.SpineSnap, Modify, "SpineSnap", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "BowSpineSnap", ref Flags.SpineSnap, Restore, "SpineSnap", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("Point light", "Particle System") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("Point light", "Particle System") && flag; } } internal static class StaffOfEmbers { public const string Name = "Staff of Embers"; public const string PrefabName = "StaffFireball"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "StaffFireball", ref Flags.StaffOfEmbers, Modify, "StaffOfEmbers", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "StaffFireball", ref Flags.StaffOfEmbers, Restore, "StaffOfEmbers", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; flag = prefab.SetSubChildrenInactive("equiped", "embers", "flames") && flag; return prefab.SetSubChildrenInactive("effects", "Point light", "flare", "embers (1)") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; flag = prefab.SetSubChildrenActive("equiped", "embers", "flames") && flag; return prefab.SetSubChildrenActive("effects", "Point light", "flare", "embers (1)") && flag; } } internal static class StaffOfFrost { public const string Name = "Staff of Frost"; public const string PrefabName = "StaffIceShards"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "StaffIceShards", ref Flags.StaffOfFrost, Modify, "StaffOfFrost", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "StaffIceShards", ref Flags.StaffOfFrost, Restore, "StaffOfFrost", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenInactive("Point light", "flare", "embers (1)") && flag; return prefab.DisableShaderKeyword("default (1)", "_EMISSION") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; flag = prefab.SetChildrenActive("Point light", "flare", "embers (1)") && flag; return prefab.EnableShaderKeyword("default (1)", "_EMISSION") && flag; } } internal static class StaffOfProtection { public const string Name = "Staff of Protection"; public const string PrefabName = "StaffShield"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "StaffShield", ref Flags.StaffOfProtection, Modify, "StaffOfProtection", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "StaffShield", ref Flags.StaffOfProtection, Restore, "StaffOfProtection", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; return prefab.SetChildrenInactive("flames") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; return prefab.SetChildrenActive("flames") && flag; } } internal static class StaffOfTheWild { public const string Name = "Staff of the Wild"; public const string PrefabName = "StaffGreenRoots"; public static bool Modify(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryModify(prefabs, clones, "StaffGreenRoots", ref Flags.StaffOfTheWild, Modify, "StaffOfTheWild", "Modify"); } public static bool Restore(IReadOnlyDictionary prefabs, IReadOnlyDictionary clones) { return PrefabTools.TryRestore(prefabs, clones, "StaffGreenRoots", ref Flags.StaffOfTheWild, Restore, "StaffOfTheWild", "Restore"); } private static bool Modify(GameObject prefab) { bool flag = true; flag = prefab.SetSubChildrenInactive("effects", "Point light", "flare", "embers (1)") && flag; return prefab.SetSubChildrenInactive("glow", "Point light", "flare") && flag; } private static bool Restore(GameObject prefab) { bool flag = true; flag = prefab.SetSubChildrenActive("effects", "Point light", "flare", "embers (1)") && flag; return prefab.SetSubChildrenActive("glow", "Point light", "flare") && flag; } } }