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 Ceifadora Runica v0.5.1
plugins/FoiceSangue.dll
Decompiled a week agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyMetadata("AI_Assisted_Creation", "This assembly was created with the assistance of Generative AI (code generation).")] [assembly: AssemblyMetadata("AI_Model_Vendor", "Anthropic (Claude)")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PandheryaFoice { [BepInPlugin("pandherya.foicesangue", "Ceifadora Runica (Pandherya)", "0.5.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [SynchronizationMode(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string GUID = "pandherya.foicesangue"; public const string ID = "ScytheRunicaPandherya"; public const string ItemName = "Ceifadora Rúnica"; internal static ConfigEntry<string> BaseItem; internal static ConfigEntry<float> DamageMult; internal static ConfigEntry<float> Brightness; internal static ConfigEntry<float> Metallic; internal static ConfigEntry<float> Smoothness; internal static ConfigEntry<float> Length; internal static ConfigEntry<float> Spin; internal static ConfigEntry<float> Tilt; internal static ConfigEntry<float> Slide; internal static ConfigEntry<float> OffX; internal static ConfigEntry<float> OffZ; internal static ConfigEntry<bool> Flip; internal static ConfigEntry<int> VampHits; internal static ConfigEntry<float> VampHeal; internal static ConfigEntry<float> PullForce; internal static ManualLogSource Log; internal static Material Mat; internal static Mesh ModelMesh; internal static ConfigurationManagerAttributes Admin() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown return new ConfigurationManagerAttributes { IsAdminOnly = true }; } private void Awake() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Expected O, but got Unknown //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Expected O, but got Unknown //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Expected O, but got Unknown //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Expected O, but got Unknown //IL_04fb: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; BaseItem = ((BaseUnityPlugin)this).Config.Bind<string>("Base", "ArmaBase", "Battleaxe", new ConfigDescription("Arma vanilla usada como base (golpes, animações, habilidade). Ex.: Battleaxe, BattleaxeCrystal, AtgeirIron. Só muda ao reiniciar o jogo.", (AcceptableValueBase)null, new object[1] { Admin() })); DamageMult = ((BaseUnityPlugin)this).Config.Bind<float>("Combate", "MultiplicadorDano", 1f, new ConfigDescription("Multiplica o dano da arma base (1 = igual). Só muda ao reiniciar o jogo.", (AcceptableValueBase)null, new object[1] { Admin() })); VampHits = ((BaseUnityPlugin)this).Config.Bind<int>("Poderes", "VampirismoGolpes", 6, new ConfigDescription("A cada quantos golpes que acertam a foice cura você (0 = desliga).", (AcceptableValueBase)null, new object[1] { Admin() })); VampHeal = ((BaseUnityPlugin)this).Config.Bind<float>("Poderes", "VampirismoCura", 15f, new ConfigDescription("Quanto de vida cada vampirismo cura.", (AcceptableValueBase)null, new object[1] { Admin() })); PullForce = ((BaseUnityPlugin)this).Config.Bind<float>("Poderes", "ForcaPuxao", 60f, new ConfigDescription("Força com que o ataque secundário puxa o alvo para perto (0 = desliga, volta a empurrar).", (AcceptableValueBase)null, new object[1] { Admin() })); Length = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "Comprimento", 2.1f, new ConfigDescription("Tamanho total da foice em metros. Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Slide = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "DeslizarNoCabo", 0f, new ConfigDescription("Move a foice ao longo do cabo (m). Positivo = mão mais perto da ponta de baixo. Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Spin = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "GiroNoCabo", 0f, new ConfigDescription("Gira a foice em volta do cabo (graus) para acertar o lado da lâmina. Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Tilt = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "Inclinacao", 0f, new ConfigDescription("Inclina a foice para frente/trás (graus). Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Flip = ((BaseUnityPlugin)this).Config.Bind<bool>("Modelo", "InverterCabo", false, new ConfigDescription("Vira a foice de ponta-cabeça (se a lâmina aparecer embaixo). Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); OffX = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "AjusteX", 0f, new ConfigDescription("Ajuste fino da posição (m). Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); OffZ = ((BaseUnityPlugin)this).Config.Bind<float>("Modelo", "AjusteZ", 0f, new ConfigDescription("Ajuste fino da posição (m). Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Brightness = ((BaseUnityPlugin)this).Config.Bind<float>("Visual", "Brilho", 1.15f, new ConfigDescription("Clareia (>1) ou escurece (<1) a textura. Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Metallic = ((BaseUnityPlugin)this).Config.Bind<float>("Visual", "Metalico", 0.1f, new ConfigDescription("Quanto parece metal (0 a 1). Alto deixa escura no Valheim. Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Smoothness = ((BaseUnityPlugin)this).Config.Bind<float>("Visual", "Polimento", 0.35f, new ConfigDescription("Reflexo da superfície (0 fosco, 1 espelhado). Muda na hora.", (AcceptableValueBase)null, new object[1] { Admin() })); Length.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; Spin.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; Tilt.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; Slide.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; OffX.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; OffZ.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; Flip.SettingChanged += delegate { FoiceModelo.RefreshAll(); }; Brightness.SettingChanged += delegate { ApplyLook(); }; Metallic.SettingChanged += delegate { ApplyLook(); }; Smoothness.SettingChanged += delegate { ApplyLook(); }; ConfigReload.Watch((BaseUnityPlugin)(object)this, ((BaseUnityPlugin)this).Config, "pandherya.foicesangue"); new Harmony("pandherya.foicesangue").PatchAll(typeof(Plugin).Assembly); PrefabManager.OnVanillaPrefabsAvailable += AddContent; } private unsafe void AddContent() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= AddContent; try { string text = BaseItem.Value.Trim(); if ((Object)(object)PrefabManager.Instance.GetPrefab(text) == (Object)null) { Log.LogWarning((object)("Arma base '" + text + "' não existe; usando Battleaxe.")); text = "Battleaxe"; } ItemConfig val = new ItemConfig { Name = "Ceifadora Rúnica", Description = "Floki gravou runas nessa lâmina para ela cortar mais fundo. Ou para ela parar de sussurrar à noite — ele não lembra qual dos dois. O crânio de corvo no topo era de um corvo que roubou o pão de Floki. Floki não perdoa. O cabo é feito de vértebras de gente que também roubou o pão de Floki. Floki realmente não perdoa.\n<color=#C02020>A cada alguns golpes devolve sangue ao portador. O golpe secundário puxa a vítima.</color>", CraftingStation = "forge", MinStationLevel = 1 }; val.AddRequirement(new RequirementConfig("BoneFragments", 20, 10, true)); val.AddRequirement(new RequirementConfig("Iron", 10, 5, true)); val.AddRequirement(new RequirementConfig("Feathers", 10, 5, true)); CustomItem val2 = new CustomItem("ScytheRunicaPandherya", text, val); GameObject itemPrefab = val2.ItemPrefab; ModelMesh = LoadMesh("scythe.mesh.gz"); Texture2D val3 = LoadTex("scythe_albedo.png"); Renderer val4 = null; Renderer[] componentsInChildren = itemPrefab.GetComponentsInChildren<Renderer>(true); foreach (Renderer val5 in componentsInChildren) { if (!(val5 is ParticleSystemRenderer) && (Object)(object)val5.sharedMaterial != (Object)null) { val4 = val5; break; } } Mat = (((Object)(object)val4 != (Object)null) ? new Material(val4.sharedMaterial) : new Material(Shader.Find("Standard"))); ((Object)Mat).name = "foice_runica"; string[] texturePropertyNames = Mat.GetTexturePropertyNames(); foreach (string text2 in texturePropertyNames) { string text3 = text2.ToLowerInvariant(); if (text3 == "_maintex") { Mat.SetTexture(text2, (Texture)(object)val3); } else if (text3.Contains("bump") || text3.Contains("normal") || text3.Contains("metal") || text3.Contains("detail") || text3.Contains("emission") || text3.Contains("occlusion") || text3.Contains("gloss")) { Mat.SetTexture(text2, (Texture)null); } } Mat.DisableKeyword("_METALLICGLOSSMAP"); Mat.DisableKeyword("_NORMALMAP"); Mat.DisableKeyword("_EMISSION"); if (Mat.HasProperty("_EmissionColor")) { Mat.SetColor("_EmissionColor", Color.black); } ApplyLook(); Transform val6 = FindChild(itemPrefab.transform, "attach") ?? itemPrefab.transform; MeasureBase(val6, out var shaft, out var side, out var len); componentsInChildren = ((Component)val6).GetComponentsInChildren<Renderer>(true); foreach (Renderer val7 in componentsInChildren) { if (!(val7 is ParticleSystemRenderer)) { val7.enabled = false; } } GameObject val8 = new GameObject("foice_modelo"); val8.transform.SetParent(val6, false); val8.layer = ((Component)val6).gameObject.layer; val8.AddComponent<MeshFilter>().sharedMesh = ModelMesh; ((Renderer)val8.AddComponent<MeshRenderer>()).sharedMaterial = Mat; FoiceModelo foiceModelo = val8.AddComponent<FoiceModelo>(); foiceModelo.Shaft = shaft; foiceModelo.Side = side; foiceModelo.Apply(); ManualLogSource log = Log; string[] obj = new string[9] { "Base ", text, ": cabo ", null, null, null, null, null, null }; Vector3 val9 = shaft; obj[3] = ((object)(*(Vector3*)(&val9))/*cast due to .constrained prefix*/).ToString(); obj[4] = ", lado "; val9 = side; obj[5] = ((object)(*(Vector3*)(&val9))/*cast due to .constrained prefix*/).ToString(); obj[6] = ", comprimento "; obj[7] = len.ToString("0.00"); obj[8] = " m"; log.LogInfo((object)string.Concat(obj)); SharedData shared = val2.ItemDrop.m_itemData.m_shared; float value = DamageMult.Value; if (Math.Abs(value - 1f) > 0.001f) { ((DamageTypes)(ref shared.m_damages)).Modify(value); ((DamageTypes)(ref shared.m_damagesPerLevel)).Modify(value); } Texture2D val10 = LoadTex("scythe_icon.png"); shared.m_icons = (Sprite[])(object)new Sprite[1] { Sprite.Create(val10, new Rect(0f, 0f, (float)((Texture)val10).width, (float)((Texture)val10).height), new Vector2(0.5f, 0.5f), 100f) }; ItemManager.Instance.AddItem(val2); Log.LogInfo((object)("Foice Ceifadora Rúnica registrada (base " + text + ").")); } catch (Exception ex) { Log.LogError((object)("Falha ao criar a foice: " + ex)); } } private static Transform FindChild(Transform t, string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown foreach (Transform item in t) { Transform val = item; if (((Object)val).name == name) { return val; } } return null; } private static void MeasureBase(Transform attach, out Vector3 shaft, out Vector3 side, out float len) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) bool flag = false; Bounds val = default(Bounds); ((Bounds)(ref val))..ctor(Vector3.zero, Vector3.zero); Matrix4x4 worldToLocalMatrix = attach.worldToLocalMatrix; MeshFilter[] componentsInChildren = ((Component)attach).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val2 in componentsInChildren) { if ((Object)(object)val2.sharedMesh == (Object)null) { continue; } Bounds bounds = val2.sharedMesh.bounds; Matrix4x4 val3 = worldToLocalMatrix * ((Component)val2).transform.localToWorldMatrix; for (int j = 0; j < 8; j++) { Vector3 val4 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1)))); Vector3 val5 = ((Matrix4x4)(ref val3)).MultiplyPoint3x4(val4); if (!flag) { ((Bounds)(ref val))..ctor(val5, Vector3.zero); flag = true; } else { ((Bounds)(ref val)).Encapsulate(val5); } } } if (!flag) { shaft = Vector3.forward; side = Vector3.right; len = 1.5f; return; } Vector3 size = ((Bounds)(ref val)).size; int num = ((!(size.x >= size.y) || !(size.x >= size.z)) ? ((size.y >= size.z) ? 1 : 2) : 0); int num2 = -1; float num3 = -1f; for (int k = 0; k < 3; k++) { if (k != num && ((Vector3)(ref size))[k] > num3) { num3 = ((Vector3)(ref size))[k]; num2 = k; } } shaft = Vector3.zero; Vector3 center = ((Bounds)(ref val)).center; ((Vector3)(ref shaft))[num] = ((((Vector3)(ref center))[num] < 0f) ? (-1f) : 1f); side = Vector3.zero; int num4 = num2; center = ((Bounds)(ref val)).center; ((Vector3)(ref side))[num4] = ((((Vector3)(ref center))[num2] < 0f) ? (-1f) : 1f); len = ((Vector3)(ref size))[num]; } internal static void ApplyLook() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Mat == (Object)null)) { float num = Mathf.Clamp(Brightness.Value, 0.1f, 3f); if (Mat.HasProperty("_Color")) { Mat.SetColor("_Color", new Color(num, num, num, 1f)); } if (Mat.HasProperty("_Metallic")) { Mat.SetFloat("_Metallic", Mathf.Clamp01(Metallic.Value)); } if (Mat.HasProperty("_Glossiness")) { Mat.SetFloat("_Glossiness", Mathf.Clamp01(Smoothness.Value)); } if (Mat.HasProperty("_GlossMapScale")) { Mat.SetFloat("_GlossMapScale", Mathf.Clamp01(Smoothness.Value)); } } } private static byte[] Resource(string name) { using Stream stream = typeof(Plugin).Assembly.GetManifestResourceStream(name); if (stream == null) { throw new Exception("recurso não encontrado: " + name); } MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); return memoryStream.ToArray(); } private static Texture2D LoadTex(string name) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true); ImageConversion.LoadImage(val, Resource(name), false); ((Object)val).name = name; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).anisoLevel = 4; return val; } private static Mesh LoadMesh(string name) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown byte[] buffer; using (GZipStream gZipStream = new GZipStream(new MemoryStream(Resource(name)), CompressionMode.Decompress)) { using MemoryStream memoryStream = new MemoryStream(); gZipStream.CopyTo(memoryStream); buffer = memoryStream.ToArray(); } using BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer)); if (new string(binaryReader.ReadChars(4)) != "FOIC") { throw new Exception("malha inválida"); } int num = binaryReader.ReadInt32(); Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector2[] array3 = (Vector2[])(object)new Vector2[num]; for (int i = 0; i < num; i++) { array[i] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int j = 0; j < num; j++) { array2[j] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); } for (int k = 0; k < num; k++) { array3[k] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); } int num2 = binaryReader.ReadInt32(); int[] array4 = new int[num2]; for (int l = 0; l < num2; l++) { array4[l] = binaryReader.ReadInt32(); } Mesh val = new Mesh { name = "foice_runica", vertices = array, normals = array2, uv = array3, triangles = array4 }; val.RecalculateBounds(); val.RecalculateTangents(); return val; } } public class FoiceModelo : MonoBehaviour { public Vector3 Shaft = Vector3.forward; public Vector3 Side = Vector3.right; private static readonly List<FoiceModelo> All = new List<FoiceModelo>(); private void OnEnable() { All.Add(this); Apply(); } private void OnDisable() { All.Remove(this); } internal static void RefreshAll() { foreach (FoiceModelo item in All) { if ((Object)(object)item != (Object)null) { item.Apply(); } } } public void Apply() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (Plugin.Flip.Value ? (-Shaft) : Shaft); Vector3 val2 = Vector3.Cross(Side, val); if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = Vector3.Cross(Vector3.right, val); } Quaternion val3 = Quaternion.LookRotation(val2, val); val3 *= Quaternion.Euler(Plugin.Tilt.Value, Plugin.Spin.Value, 0f); float num = Mathf.Max(0.2f, Plugin.Length.Value); ((Component)this).transform.localRotation = val3; ((Component)this).transform.localScale = new Vector3(num, num, num); ((Component)this).transform.localPosition = val3 * new Vector3(0f, 0f - Plugin.Slide.Value, 0f) + new Vector3(Plugin.OffX.Value, 0f, Plugin.OffZ.Value); } } [HarmonyPatch(typeof(Character), "Damage")] internal static class Poderes { private static int _hits; private static readonly FieldRef<Humanoid, bool> IsSecondary = AccessTools.FieldRefAccess<Humanoid, bool>("m_currentAttackIsSecondary"); private static void Prefix(Character __instance, HitData hit) { try { if (hit == null) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || (Object)(object)hit.GetAttacker() != (Object)(object)localPlayer || (Object)(object)__instance == (Object)(object)localPlayer) { return; } ItemData currentWeapon = ((Humanoid)localPlayer).GetCurrentWeapon(); if (currentWeapon != null && !((Object)(object)currentWeapon.m_dropPrefab == (Object)null) && !(((Object)currentWeapon.m_dropPrefab).name != "ScytheRunicaPandherya")) { if (IsSecondary.Invoke((Humanoid)(object)localPlayer) && Plugin.PullForce.Value > 0f) { hit.m_pushForce = 0f - Plugin.PullForce.Value; } int value = Plugin.VampHits.Value; if (value > 0 && ++_hits >= value) { _hits = 0; ((Character)localPlayer).Heal(Plugin.VampHeal.Value, true); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Poderes: " + ex.Message)); } } } internal class ConfigReload : MonoBehaviour { private ConfigFile _cfg; private volatile bool _dirty; private float _at; internal static void Watch(BaseUnityPlugin plugin, ConfigFile cfg, string guid) { ConfigReload r = ((Component)plugin).gameObject.AddComponent<ConfigReload>(); r._cfg = cfg; try { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, guid + ".cfg"); fileSystemWatcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite; fileSystemWatcher.Changed += delegate { r._dirty = true; }; fileSystemWatcher.Created += delegate { r._dirty = true; }; fileSystemWatcher.Renamed += delegate { r._dirty = true; }; fileSystemWatcher.EnableRaisingEvents = true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Sem recarga automática do cfg: " + ex.Message)); } } private void Update() { if (_dirty) { _dirty = false; _at = Time.time + 0.3f; } if (_at > 0f && Time.time >= _at) { _at = 0f; try { _cfg.Reload(); Plugin.Log.LogInfo((object)"Config recarregada."); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Falha ao recarregar cfg: " + ex.Message)); } } } } }