Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of GreydwarfCloak v1.0.0
plugins\GreydwarfCloak.dll
Decompiled 9 months agousing System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("GreydwarfCloak")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GreydwarfCloak")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] namespace GreydwarfCloak { [BepInPlugin("sephalon.GreydwarfCloak", "GreydwarfCloak", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [HarmonyPatch] internal class GreydwarfCloak : BaseUnityPlugin { public const string PluginGUID = "sephalon.GreydwarfCloak"; public const string PluginName = "GreydwarfCloak"; public const string PluginVersion = "1.0.0"; public static string capeItemID = "CapeGreydwarf"; public static List<string> g_affectedTypes = new List<string> { "Greyling", "Greydwarf", "Greydwarf_Elite", "Greydwarf_Shaman" }; public void Awake() { PrefabManager.OnVanillaPrefabsAvailable += AddCapePrefab; Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "sephalon.GreydwarfCloak"); } public void AddCapePrefab() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown SE_GreydwarfCloak.SE_Greydwarf sE_Greydwarf = ScriptableObject.CreateInstance<SE_GreydwarfCloak.SE_Greydwarf>(); ((Object)sE_Greydwarf).name = "GreydwarfCloakStatusEffect"; ((StatusEffect)sE_Greydwarf).m_name = "Greydwarf\nCloak"; ((StatusEffect)sE_Greydwarf).m_icon = GUIManager.Instance.GetSprite("TrophyGreydwarfShaman"); CustomStatusEffect val = new CustomStatusEffect((StatusEffect)(object)sE_Greydwarf, false); ItemManager.Instance.AddStatusEffect(val); GameObject val2 = PrefabManager.Instance.CreateClonedPrefab("CapeGreydwarf", "CapeDeerHide"); SharedData shared = val2.GetComponent<ItemDrop>().m_itemData.m_shared; shared.m_name = "Greydwarf Cloak"; shared.m_description = "You smell like Greydwarf. It's not pleasant, but it makes them ignore you."; shared.m_equipStatusEffect = val.StatusEffect; ItemConfig val3 = new ItemConfig(); val3.Apply(val2); val3.CraftingStation = CraftingStations.Workbench; val3.AddRequirement("TrophyGreydwarf", 1, 1); val3.AddRequirement("GreydwarfEye", 2, 0); val3.AddRequirement("Resin", 1, 0); val3.AddRequirement("DeerHide", 4, 2); CustomItem val4 = new CustomItem(val2, false, val3); ItemManager.Instance.AddItem(val4); PrefabManager.OnVanillaPrefabsAvailable -= AddCapePrefab; } [HarmonyPrefix] [HarmonyPatch(typeof(BaseAI), "CanSenseTarget", new Type[] { typeof(Character), typeof(bool) })] public static bool CanSenseTargetPrefix(BaseAI __instance, ref bool __result, Character target, bool passiveAggresive) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!target.IsPlayer()) { return true; } ItemData shoulderItem = ((Humanoid)(Player)target).m_shoulderItem; if (shoulderItem == null) { return true; } if ((Object)(object)shoulderItem.m_dropPrefab == (Object)null) { return true; } if (((Object)shoulderItem.m_dropPrefab).name != capeItemID) { return true; } string text = null; try { text = ((Object)((Component)__instance).gameObject).name; } catch (Exception ex) { Logger.LogInfo((object)ex.ToString()); } if (text == null) { Logger.LogInfo((object)"CanSenseTargetPrefix: unable to determine type"); return true; } if (IsAffected(text)) { __result = false; return false; } return true; } public static bool IsAffected(string type) { foreach (string g_affectedType in g_affectedTypes) { if (type.StartsWith(g_affectedType)) { return true; } } return false; } } internal class SE_GreydwarfCloak { internal class SE_Greydwarf : StatusEffect { public override void UpdateStatusEffect(float dt) { ((StatusEffect)this).UpdateStatusEffect(dt); } public override bool IsDone() { return ((StatusEffect)this).IsDone(); } } } } namespace GreydwarfCloak.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { resourceMan = new ResourceManager("GreydwarfCloak.Properties.Resources", typeof(Resources).Assembly); } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal Resources() { } } }