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 GodsOath v1.2.0
JuramentoDioses.dll
Decompiled 9 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using JuramentoDioses.Clases; using JuramentoDioses.Comandos; using JuramentoDioses.Configuracion; using JuramentoDioses.Efectos; using JuramentoDioses.Estados; using JuramentoDioses.Habilidades; using JuramentoDioses.Habilidades.Freyja; using JuramentoDioses.Habilidades.Loki; using JuramentoDioses.Habilidades.Njord; using JuramentoDioses.Habilidades.Odin; using JuramentoDioses.Habilidades.Skadi; using JuramentoDioses.Habilidades.Surtr; using JuramentoDioses.Habilidades.Thor; using JuramentoDioses.UI; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("JuramentoDioses")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyInformationalVersion("1.2.0+cc3ebd74627c6dea5e52dedec377cb4f5abc23ac")] [assembly: AssemblyProduct("JuramentoDioses")] [assembly: AssemblyTitle("JuramentoDioses")] [assembly: AssemblyVersion("1.2.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 JuramentoDioses { public static class Idioma { private static string _idiomaJuego; private static float _comprobado = -10f; public static bool EsEspanol { get { string text = ConfigJuramento.IdiomaMod?.Value ?? "Auto"; if (text == "Español") { return true; } if (text == "English") { return false; } if (Time.realtimeSinceStartup - _comprobado > 1f) { _comprobado = Time.realtimeSinceStartup; _idiomaJuego = ((Localization.instance != null) ? Localization.instance.GetSelectedLanguage() : null); } if (_idiomaJuego != null) { return _idiomaJuego.StartsWith("Spanish"); } return false; } } public static string T(string espanol, string ingles) { if (!EsEspanol) { return ingles; } return espanol; } } [BepInPlugin("juramentodioses.valheim", "Gods' Oath", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { public const string PluginGUID = "juramentodioses.valheim"; public const string PluginName = "Gods' Oath"; public const string PluginVersion = "1.2.0"; private readonly Harmony _harmony = new Harmony("juramentodioses.valheim"); public static Plugin Instance { get; private set; } private void Awake() { Instance = this; ConfigJuramento.Inicializar(((BaseUnityPlugin)this).Config); ConfigJuramento.Migrar(((BaseUnityPlugin)this).Config); Devocion.Registrar(); Recursos.CargarEfectosPropios(); EstadosJuramento.Registrar(); Traducciones.Enviar(); ItemManager.OnItemsRegistered += EstadosJuramento.RefrescarIconos; RegistroHabilidades.Inicializar(); GestorHabilidades.Inicializar(); FavorDivino.Inicializar(); CommandManager instance = CommandManager.Instance; instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoInfo()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoArmas()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoClase()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoFavor()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoCooldown()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoDesbloquear()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoEstado()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoPrefabs()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoProbarEfecto()); instance.AddConsoleCommand((ConsoleCommand)(object)new ComandoInspeccionar()); _harmony.PatchAll(); Registro.Info("Gods' Oath 1.2.0 cargado correctamente."); } private void Update() { LibroDioses.Actualizar(); SombraLoki.Actualizar(); JaulaRunica.Actualizar(); GestorHabilidades.Actualizar(); } private void OnDestroy() { _harmony.UnpatchSelf(); } } internal static class Recursos { private static readonly Dictionary<string, Sprite> _cache = new Dictionary<string, Sprite>(); private static readonly Dictionary<string, string[]> _fuentesJuego = new Dictionary<string, string[]> { ["clase_thor"] = new string[2] { "item:SledgeIron", "item:SledgeStagbreaker" }, ["clase_skadi"] = new string[3] { "item:BowDraugrFang", "item:BowFineWood", "item:Bow" }, ["clase_freyja"] = new string[1] { "item:Dandelion" }, ["clase_surtr"] = new string[1] { "item:SurtlingCore" }, ["thor_golpe"] = new string[2] { "se:GP_Eikthyr", "item:TrophyEikthyr" }, ["thor_carga"] = new string[2] { "item:Thunderstone", "item:StaffLightning" }, ["thor_ira"] = new string[2] { "item:StaffLightning", "item:Thunderstone" }, ["skadi_flecha"] = new string[1] { "item:ArrowFrost" }, ["skadi_trampa"] = new string[1] { "item:FreezeGland" }, ["skadi_ventisca"] = new string[3] { "item:StaffIceShards", "se:GP_Moder", "item:TrophyDragonQueen" }, ["freyja_luz"] = new string[2] { "item:MeadHealthMajor", "item:MeadHealthMedium" }, ["freyja_egida"] = new string[2] { "item:StaffShield", "item:ShieldSilver" }, ["freyja_bendicion"] = new string[2] { "item:CapeFeather", "se:GP_Bonemass" }, ["surtr_bola"] = new string[2] { "item:StaffFireball", "item:ArrowFire" }, ["surtr_embestida"] = new string[2] { "item:TrophySurtling", "item:SurtlingCore" }, ["surtr_lluvia"] = new string[2] { "se:GP_Yagluth", "item:TrophyGoblinKing" }, ["estado_electrificado"] = new string[1] { "se:Lightning" }, ["estado_congelado"] = new string[2] { "se:Frost", "se:Freezing" }, ["estado_ralentizado"] = new string[2] { "se:Cold", "se:Frost" }, ["estado_inspiracion"] = new string[1] { "se:Rested" }, ["clase_odin"] = new string[1] { "item:GreydwarfEye" }, ["odin_proyectil"] = new string[2] { "item:StaffLightning", "item:GreydwarfEye" }, ["odin_gungnir"] = new string[3] { "item:SpearCarapace", "item:SpearElderbark", "item:SpearBronze" }, ["odin_ocaso"] = new string[3] { "se:GP_Fader", "se:GP_Queen", "item:Wishbone" }, ["estado_marcado"] = new string[2] { "item:Wishbone", "item:GreydwarfEye" } }; private static readonly HashSet<string> _deDisenador = new HashSet<string> { "clase_thor", "clase_skadi", "clase_freyja", "clase_surtr", "thor_golpe", "thor_carga", "thor_ira", "skadi_flecha", "skadi_trampa", "skadi_ventisca", "freyja_luz", "freyja_egida", "freyja_bendicion", "surtr_bola", "surtr_embestida", "surtr_lluvia", "estado_electrificado", "estado_congelado", "estado_ralentizado", "estado_inspiracion", "clase_odin", "odin_proyectil", "odin_gungnir", "odin_ocaso", "estado_marcado", "clase_loki", "loki_paso", "loki_senuelo", "loki_rostros", "estado_envenenado", "estado_oculto", "clase_njord", "njord_arpon", "njord_oleada", "njord_furia", "estado_mojado", "estado_viento" }; private static readonly Dictionary<string, Sprite> _cacheJuego = new Dictionary<string, Sprite>(); private static readonly HashSet<string> _sinIconoJuego = new HashSet<string>(); private static ObjectDB _dbCacheada; private static AssetBundle _bundleEfectos; public static Sprite Blanco => IconoPropio("blanco"); public static Sprite Icono(string nombre) { if (_deDisenador.Contains(nombre)) { return IconoPropio(nombre); } if (ConfigJuramento.UsarIconosDelJuego != null && ConfigJuramento.UsarIconosDelJuego.Value) { Sprite val = IconoJuego(nombre); if ((Object)(object)val != (Object)null) { return val; } } return IconoPropio(nombre); } private static Sprite IconoJuego(string nombre) { ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null || !_fuentesJuego.TryGetValue(nombre, out var value)) { return null; } if ((Object)(object)_dbCacheada != (Object)(object)instance) { _cacheJuego.Clear(); _sinIconoJuego.Clear(); _dbCacheada = instance; } if (_cacheJuego.TryGetValue(nombre, out var value2) && (Object)(object)value2 != (Object)null) { return value2; } if (_sinIconoJuego.Contains(nombre)) { return null; } if (instance.m_items == null || instance.m_items.Count == 0) { return null; } string[] array = value; foreach (string text in array) { Sprite val = null; if (text.StartsWith("item:")) { GameObject itemPrefab = instance.GetItemPrefab(text.Substring(5)); ItemDrop val2 = (((Object)(object)itemPrefab != (Object)null) ? itemPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)val2 != (Object)null && val2.m_itemData?.m_shared?.m_icons != null && val2.m_itemData.m_shared.m_icons.Length != 0) { val = val2.m_itemData.GetIcon(); } } else if (text.StartsWith("se:")) { string text2 = text.Substring(3); foreach (StatusEffect statusEffect in instance.m_StatusEffects) { if ((Object)(object)statusEffect != (Object)null && ((Object)statusEffect).name == text2 && (Object)(object)statusEffect.m_icon != (Object)null) { val = statusEffect.m_icon; break; } } } if ((Object)(object)val != (Object)null) { _cacheJuego[nombre] = val; return val; } } _sinIconoJuego.Add(nombre); Registro.Depurar("Sin icono del juego para '" + nombre + "': se usa el PNG del mod."); return null; } public static Sprite IconoPropio(string nombre) { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown if (_cache.TryGetValue(nombre, out var value)) { return value; } Sprite val = null; string text = "JuramentoDioses.Recursos.Iconos." + nombre + ".png"; using (Stream stream = typeof(Recursos).Assembly.GetManifestResourceStream(text)) { if (stream == null) { Registro.Aviso("No se encuentra el icono incrustado '" + text + "'."); } else { byte[] array; using (MemoryStream memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); array = memoryStream.ToArray(); } Texture2D val2 = AssetUtils.LoadImage(array); try { Texture2D val3 = new Texture2D(((Texture)val2).width, ((Texture)val2).height, (TextureFormat)4, true); val3.SetPixels32(val2.GetPixels32()); val3.Apply(true, false); Object.Destroy((Object)(object)val2); val2 = val3; } catch (Exception ex) { Registro.Aviso("No se pudieron generar mipmaps para '" + nombre + "': " + ex.Message); } ((Texture)val2).filterMode = (FilterMode)2; ((Texture)val2).wrapMode = (TextureWrapMode)1; val = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val).name = "JD_" + nombre; } } _cache[nombre] = val; return val; } public static Sprite IconoClase(ClaseDios clase) { return (Sprite)(clase switch { ClaseDios.Thor => Icono("clase_thor"), ClaseDios.Skadi => Icono("clase_skadi"), ClaseDios.Freyja => Icono("clase_freyja"), ClaseDios.Surtr => Icono("clase_surtr"), ClaseDios.Odin => Icono("clase_odin"), ClaseDios.Loki => Icono("clase_loki"), ClaseDios.Njord => Icono("clase_njord"), _ => null, }); } public static void CargarEfectosPropios() { try { Assembly assembly = typeof(Recursos).Assembly; string text = null; string[] manifestResourceNames = assembly.GetManifestResourceNames(); foreach (string text2 in manifestResourceNames) { if (text2.EndsWith(".Bundles.godsoath", StringComparison.OrdinalIgnoreCase)) { text = text2; } } if (text == null) { Registro.Info("Sin efectos de Unity (bundle 'godsoath'): se usan los efectos del juego."); return; } byte[] array; using (Stream stream = assembly.GetManifestResourceStream(text)) { using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); array = memoryStream.ToArray(); } AssetBundle val = AssetBundle.LoadFromMemory(array); if ((Object)(object)val == (Object)null) { Registro.Aviso("No se pudo abrir el bundle de efectos 'godsoath'."); return; } _bundleEfectos = val; Propio(val, "JD_OlaNjord", new ComportamientoEfecto { Velocidad = () => ConfigJuramento.OleadaVelocidad.Value, PegadoAlSuelo = true, Aplastar = true }); Propio(val, "JD_RunaProyectil", new ComportamientoEfecto { Velocidad = () => ConfigJuramento.ProyectilVelocidad.Value, Giro = 360f, SobreSuelo = 0.9f }); Propio(val, "JD_RemolinoNjord", new ComportamientoEfecto { Giro = 140f }); Propio(val, "JD_GeiserNjord", new ComportamientoEfecto { Giro = 220f }); Propio(val, "JD_RayoThor", new ComportamientoEfecto { Rayo = true }); Propio(val, "JD_QuemaduraRayo", new ComportamientoEfecto()); Propio(val, "JD_CirculoRunico", new ComportamientoEfecto { Giro = 30f }); Propio(val, "JD_RunaMarcado", new ComportamientoEfecto { SobreCabeza = true }); Material val2 = val.LoadAsset<Material>("JD_Sombra"); if ((Object)(object)val2 != (Object)null) { SombraLoki.MaterialSombra = val2; Registro.Info("Efecto de Unity cargado: JD_Sombra (aspecto de sombra de Loki)"); } else { Registro.Aviso("El bundle de efectos no contiene el material JD_Sombra."); } } catch (Exception ex) { Registro.Aviso("No se pudieron cargar los efectos de Unity: " + ex.Message); } } private static void Propio(AssetBundle bundle, string nombre, ComportamientoEfecto comportamiento) { GameObject val = bundle.LoadAsset<GameObject>(nombre); if ((Object)(object)val == (Object)null) { Registro.Aviso("El bundle de efectos no contiene " + nombre + ": se usarán los efectos del juego."); return; } Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren) { Material[] sharedMaterials = val2.sharedMaterials; foreach (Material val3 in sharedMaterials) { if ((Object)(object)val3 != (Object)null && ((Object)(object)val3.shader == (Object)null || !val3.shader.isSupported)) { string[] obj = new string[6] { nombre, "/", ((Object)val2).name, ": el shader '", null, null }; Shader shader = val3.shader; obj[4] = ((shader != null) ? ((Object)shader).name : null); obj[5] = "' no funciona en este equipo."; Registro.Aviso(string.Concat(obj)); } } } CatalogoEfectos.RegistrarPropio(val, comportamiento); Registro.Info("Efecto de Unity cargado: " + nombre); } } internal static class Registro { public static void Info(string msg) { Logger.LogInfo((object)msg); } public static void Aviso(string msg) { Logger.LogWarning((object)msg); } public static void Error(string msg) { Logger.LogError((object)msg); } public static void Depurar(string msg) { if (ConfigJuramento.ModoDepuracion != null && ConfigJuramento.ModoDepuracion.Value) { Logger.LogInfo((object)("[Depuración] " + msg)); } } } public static class Traducciones { private static readonly Dictionary<string, string> _es = new Dictionary<string, string>(); private static readonly Dictionary<string, string> _en = new Dictionary<string, string>(); private static bool _enviado; public static string Token(string clave, string espanol, string ingles) { _es[clave] = espanol; _en[clave] = ingles; if (_enviado) { Enviar(); } return "$" + clave; } public static void Enviar() { _enviado = true; CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); string text = "English"; localization.AddTranslation(ref text, new Dictionary<string, string>(_en)); text = "Spanish"; localization.AddTranslation(ref text, new Dictionary<string, string>(_es)); } } } namespace JuramentoDioses.UI { public class HudHabilidades : MonoBehaviour { private class Ranura { public Image Icono; public Image Cooldown; public Text Tecla; public Text Tiempo; } private const float TamRanura = 64f; private const float Separacion = 8f; private const float TamClase = 52f; private static readonly Color ColorFavor = new Color(1f, 0.8f, 0.3f); private readonly Ranura[] _ranuras = new Ranura[3]; private GameObject _contenido; private Image _iconoClase; private Image _favorRelleno; private Text _favorTexto; private RectTransform _rt; public static void Crear(Hud hud) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)hud == (Object)null) && !((Object)(object)hud.m_rootObject == (Object)null)) { GameObject val = new GameObject("JD_HudHabilidades", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(hud.m_rootObject.transform, false); val.AddComponent<HudHabilidades>().Construir(); } } private void Construir() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00b2: 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) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) _rt = (RectTransform)((Component)this).transform; RectTransform rt = _rt; RectTransform rt2 = _rt; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0f); rt2.anchorMax = val; rt.anchorMin = val; _rt.pivot = new Vector2(0.5f, 0f); _rt.sizeDelta = new Vector2(340f, 100f); _contenido = new GameObject("Contenido", new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)_contenido.transform; ((Transform)val2).SetParent(((Component)this).transform, false); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val = (val2.offsetMin = (val2.offsetMax = Vector2.zero)); float num = 208f; float num2 = 30f - num / 2f - 12f - 26f; CrearImagen((Transform)(object)val2, "FondoClase", new Vector2(num2, 50f), new Vector2(58f, 58f), Recursos.Blanco, new Color(0f, 0f, 0f, 0.5f), abajo: true); _iconoClase = CrearImagen((Transform)(object)val2, "IconoClase", new Vector2(num2, 50f), new Vector2(52f, 52f), null, Color.white, abajo: true, mantenerProporcion: true); for (int i = 0; i < 3; i++) { float num3 = 30f + (float)(i - 1) * 72f; Transform transform = ((Component)CrearImagen((Transform)(object)val2, "Ranura" + (i + 1), new Vector2(num3, 50f), new Vector2(70f, 70f), Recursos.Blanco, new Color(0f, 0f, 0f, 0.55f), abajo: true)).transform; Ranura ranura = new Ranura(); ranura.Icono = CrearImagen(transform, "Icono", Vector2.zero, new Vector2(64f, 64f), null, Color.white, abajo: false, mantenerProporcion: true); ranura.Cooldown = CrearImagen(transform, "Cooldown", Vector2.zero, new Vector2(64f, 64f), Recursos.Blanco, new Color(0f, 0f, 0f, 0.7f)); ranura.Cooldown.type = (Type)3; ranura.Cooldown.fillMethod = (FillMethod)4; ranura.Cooldown.fillOrigin = 2; ranura.Cooldown.fillClockwise = false; ranura.Cooldown.fillAmount = 0f; ranura.Tecla = CrearTexto(transform, "Tecla", new Vector2(-18f, 20f), new Vector2(30f, 22f), 16, (TextAnchor)0); ranura.Tiempo = CrearTexto(transform, "Tiempo", Vector2.zero, new Vector2(64f, 64f), 24, (TextAnchor)4); _ranuras[i] = ranura; } float num4 = num2 - 26f - 3f; float num5 = 30f + num / 2f + 3f; float num6 = num5 - num4; Image val4 = CrearImagen((Transform)(object)val2, "FondoFavor", new Vector2((num4 + num5) / 2f, 9f), new Vector2(num6, 16f), Recursos.Blanco, new Color(0f, 0f, 0f, 0.6f), abajo: true); _favorRelleno = CrearImagen(((Component)val4).transform, "Favor", Vector2.zero, new Vector2(num6 - 4f, 12f), Recursos.Blanco, ColorFavor); _favorRelleno.type = (Type)3; _favorRelleno.fillMethod = (FillMethod)0; _favorRelleno.fillOrigin = 0; _favorRelleno.fillAmount = 0f; _favorTexto = CrearTexto(((Component)val4).transform, "FavorTexto", Vector2.zero, new Vector2(num6, 16f), 12, (TextAnchor)4); _contenido.SetActive(false); } private void Update() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; ClaseDios claseDios = (((Object)(object)localPlayer != (Object)null) ? GestorClases.Obtener(localPlayer) : ClaseDios.Ninguna); bool flag = claseDios != ClaseDios.Ninguna; if (_contenido.activeSelf != flag) { _contenido.SetActive(flag); } if (!flag) { return; } _rt.anchoredPosition = new Vector2(ConfigJuramento.HudPosicionX.Value, ConfigJuramento.HudPosicionY.Value); float value = ConfigJuramento.HudEscala.Value; if (!Mathf.Approximately(((Transform)_rt).localScale.x, value)) { ((Transform)_rt).localScale = new Vector3(value, value, 1f); } _iconoClase.sprite = Recursos.IconoClase(claseDios); for (int i = 0; i < 3; i++) { RanuraHabilidad ranura = (RanuraHabilidad)i; Ranura ranura2 = _ranuras[i]; Habilidad habilidad = RegistroHabilidades.Obtener(claseDios, ranura); EstadoRanura estadoRanura = GestorHabilidades.Estado(localPlayer, habilidad); ((Behaviour)ranura2.Icono).enabled = habilidad != null; ranura2.Icono.sprite = habilidad?.Icono; switch (estadoRanura) { case EstadoRanura.Bloqueada: ((Graphic)ranura2.Icono).color = new Color(0.25f, 0.25f, 0.25f, 1f); break; case EstadoRanura.SinRecursos: ((Graphic)ranura2.Icono).color = new Color(0.55f, 0.55f, 0.6f, 1f); break; default: ((Graphic)ranura2.Icono).color = Color.white; break; } float num = GestorHabilidades.CooldownRestante(habilidad); ranura2.Cooldown.fillAmount = GestorHabilidades.FraccionCooldown(habilidad); ranura2.Tiempo.text = ((estadoRanura == EstadoRanura.Bloqueada) ? ("<size=14>" + Idioma.T("Bloq.", "Lock") + "</size>") : ((num > 0f) ? Mathf.CeilToInt(num).ToString() : "")); ranura2.Tecla.text = GestorHabilidades.NombreTecla(ranura); } float num2 = FavorDivino.Obtener(localPlayer); float num3 = num2 / 100f; _favorTexto.text = ((num3 >= 0.999f) ? Idioma.T("Favor divino ¡listo!", "Divine Favor ready!") : $"{Mathf.FloorToInt(num2)} / {100f:0}"); _favorRelleno.fillAmount = num3; ((Graphic)_favorRelleno).color = ((num3 >= 0.999f) ? Color.Lerp(ColorFavor, Color.white, (Mathf.Sin(Time.time * 6f) + 1f) * 0.25f) : ColorFavor); } private static Image CrearImagen(Transform padre, string nombre, Vector2 posicion, Vector2 tam, Sprite sprite, Color color, bool abajo = false, bool mantenerProporcion = false) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_004e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(nombre, new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(padre, false); RectTransform val2 = (RectTransform)val.transform; Vector2 anchorMin = (val2.anchorMax = (abajo ? new Vector2(0.5f, 0f) : new Vector2(0.5f, 0.5f))); val2.anchorMin = anchorMin; val2.pivot = new Vector2(0.5f, 0.5f); val2.anchoredPosition = posicion; val2.sizeDelta = tam; Image component = val.GetComponent<Image>(); component.sprite = sprite; ((Graphic)component).color = color; ((Graphic)component).raycastTarget = false; component.preserveAspect = mantenerProporcion; return component; } private static Text CrearTexto(Transform padre, string nombre, Vector2 posicion, Vector2 tam, int tamFuente, TextAnchor alineacion) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0073: 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_007a: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(nombre, new Type[2] { typeof(RectTransform), typeof(Text) }); val.transform.SetParent(padre, false); RectTransform val2 = (RectTransform)val.transform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0.5f, 0.5f); val2.anchoredPosition = posicion; val2.sizeDelta = tam; Text component = val.GetComponent<Text>(); component.font = Fuente(); component.fontSize = tamFuente; component.alignment = alineacion; ((Graphic)component).color = Color.white; ((Graphic)component).raycastTarget = false; component.supportRichText = true; component.horizontalOverflow = (HorizontalWrapMode)1; component.verticalOverflow = (VerticalWrapMode)1; Outline obj = val.AddComponent<Outline>(); ((Shadow)obj).effectColor = new Color(0f, 0f, 0f, 0.9f); ((Shadow)obj).effectDistance = new Vector2(1.5f, -1.5f); return component; } private static Font Fuente() { GUIManager instance = GUIManager.Instance; if (instance != null && (Object)(object)instance.AveriaSerifBold != (Object)null) { return instance.AveriaSerifBold; } return Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf"); } } public static class LibroDioses { [HarmonyPatch(typeof(Menu), "Update")] private static class PatchEscape { private static bool Prefix() { if (!Abierto || !ZInput.GetKeyDown((KeyCode)27, false)) { return true; } Cerrar(); return false; } } [CompilerGenerated] private static class <>O { public static UnityAction <0>__Cerrar; } private const float Ancho = 980f; private const float Alto = 820f; private static readonly Color Naranja = new Color(1f, 0.63f, 0.24f); private static readonly Color Gris = new Color(0.78f, 0.78f, 0.78f); private static readonly ClaseDios[] Orden = new ClaseDios[8] { ClaseDios.Ninguna, ClaseDios.Thor, ClaseDios.Skadi, ClaseDios.Freyja, ClaseDios.Surtr, ClaseDios.Odin, ClaseDios.Loki, ClaseDios.Njord }; private static GameObject _panel; private static Transform _contenido; private static readonly Dictionary<ClaseDios, Button> _pestanas = new Dictionary<ClaseDios, Button>(); private static ClaseDios _seleccionada = ClaseDios.Ninguna; private static float _ultimaPulsacion = -10f; private static bool _construidoEnEspanol; public static bool Abierto { get { if ((Object)(object)_panel != (Object)null) { return _panel.activeSelf; } return false; } } public static void Actualizar() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { if (Abierto) { Cerrar(); } } else if ((ZInput.GetButtonDown("JD_LibroDioses") || ZInput.GetKeyDown(ConfigJuramento.TeclaLibro.Value, false)) && Time.time - _ultimaPulsacion > 0.2f) { _ultimaPulsacion = Time.time; Registro.Depurar($"Tecla del Libro pulsada (abierto: {Abierto})."); if (Abierto) { Cerrar(); } else if (!OtraInterfazAbierta()) { Abrir(GestorClases.Obtener(Player.m_localPlayer)); } } } public static void Abrir(ClaseDios clase) { if (GUIManager.Instance != null && !((Object)(object)GUIManager.CustomGUIFront == (Object)null)) { if ((Object)(object)_panel != (Object)null && _construidoEnEspanol != Idioma.EsEspanol) { Object.Destroy((Object)(object)_panel); _panel = null; } if ((Object)(object)_panel == (Object)null) { Construir(); } _seleccionada = clase; Rellenar(); _panel.SetActive(true); GUIManager.BlockInput(true); } } public static void Cerrar() { if (!((Object)(object)_panel == (Object)null) && _panel.activeSelf) { _panel.SetActive(false); GUIManager.BlockInput(false); } } private static bool OtraInterfazAbierta() { if (!InventoryGui.IsVisible() && !Menu.IsVisible() && !Minimap.IsOpen() && !Console.IsVisible() && !TextInput.IsVisible() && !StoreGui.IsVisible()) { if ((Object)(object)Chat.instance != (Object)null) { return Chat.instance.HasFocus(); } return false; } return true; } private static void Construir() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown _construidoEnEspanol = Idioma.EsEspanol; GUIManager instance = GUIManager.Instance; _panel = instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, 980f, 820f, false); ((Object)_panel).name = "JD_LibroDioses"; Texto(_panel.transform, Idioma.T("Libro de los Dioses", "Book of the Gods"), new Vector2(0f, -38f), new Vector2(600f, 40f), 30, Naranja, (TextAnchor)4); _pestanas.Clear(); for (int i = 0; i < Orden.Length; i++) { ClaseDios clase = Orden[i]; string text = ((clase == ClaseDios.Ninguna) ? Idioma.T("Guía", "Guide") : CatalogoClases.Obtener(clase).Dios); float num = 920f / (float)Orden.Length; Button component = instance.CreateButton(text, _panel.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(((float)i - (float)(Orden.Length - 1) / 2f) * num, -88f), num - 14f, 36f).GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener((UnityAction)delegate { _seleccionada = clase; Rellenar(); }); _pestanas[clase] = component; } ButtonClickedEvent onClick = instance.CreateButton(Idioma.T("Cerrar", "Close"), _panel.transform, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 36f), 160f, 36f).GetComponent<Button>().onClick; object obj = <>O.<0>__Cerrar; if (obj == null) { UnityAction val = Cerrar; <>O.<0>__Cerrar = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); RectTransform val2 = (RectTransform)new GameObject("Contenido", new Type[1] { typeof(RectTransform) }).transform; ((Transform)val2).SetParent(_panel.transform, false); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 1f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0.5f, 1f); val2.anchoredPosition = new Vector2(0f, -118f); val2.sizeDelta = new Vector2(920f, 630f); _contenido = (Transform)val2; _panel.SetActive(false); } private static void Rellenar() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) foreach (Transform item in _contenido) { Object.Destroy((Object)(object)((Component)item).gameObject); } foreach (KeyValuePair<ClaseDios, Button> pestana in _pestanas) { ((Selectable)pestana.Value).interactable = pestana.Key != _seleccionada; } if (_seleccionada == ClaseDios.Ninguna) { RellenarGuia(); } else { RellenarClase(); } } private static void RellenarGuia() { //IL_003e: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) float num = 920f; ClaseDios claseDios = GestorClases.Obtener(Player.m_localPlayer); Texto(_contenido, "<color=#ffa03c>" + Idioma.T("Cómo empezar", "Getting started") + "</color>", new Vector2(0f, -14f), new Vector2(num, 34f), 26, Color.white, (TextAnchor)4); string contenido = ((claseDios == ClaseDios.Ninguna) ? Idioma.T("Todavía no has jurado lealtad a ningún dios.", "You haven't sworn an oath to any god yet.") : Idioma.T("Has jurado lealtad a <b>" + CatalogoClases.Obtener(claseDios).Dios + "</b> (" + CatalogoClases.Obtener(claseDios).NombreColoreado + ").", "You have sworn an oath to <b>" + CatalogoClases.Obtener(claseDios).Dios + "</b> (" + CatalogoClases.Obtener(claseDios).NombreColoreado + ").")); Texto(_contenido, contenido, new Vector2(0f, -44f), new Vector2(num, 24f), 16, Gris, (TextAnchor)4); StringBuilder stringBuilder = new StringBuilder(); ClaseDios[] orden = Orden; foreach (ClaseDios claseDios2 in orden) { if (claseDios2 != ClaseDios.Ninguna) { DefinicionClase definicionClase = CatalogoClases.Obtener(claseDios2); stringBuilder.Append((stringBuilder.Length > 0) ? " · " : "").Append(definicionClase.Dios + ": <b>" + CatalogoClases.NombreVisibleOfrenda(definicionClase) + "</b>"); } } string text = GestorHabilidades.NombreTecla(RanuraHabilidad.Primera); string text2 = GestorHabilidades.NombreTecla(RanuraHabilidad.Segunda); string text3 = GestorHabilidades.NombreTecla(RanuraHabilidad.Definitiva); string text4 = GestorHabilidades.NombreJefe(GestorHabilidades.ClaveDesbloqueo(RanuraHabilidad.Segunda)); string text5 = GestorHabilidades.NombreJefe(GestorHabilidades.ClaveDesbloqueo(RanuraHabilidad.Definitiva)); (string, string)[] obj = ((!Idioma.EsEspanol) ? new(string, string)[6] { ("1. Swear an oath to a god", "Go to any boss summoning altar (like Eikthyr's) and offer the item of the god you want. Offering another god's item changes your class.\n<size=16>" + stringBuilder?.ToString() + "</size>"), ("2. Wield your god's weapon", "Each god only lends you their power while you wield a certain type of weapon (shown on their tab). Without it, your abilities can't be used."), ("3. Your abilities", "<b>[" + text + "]</b> and <b>[" + text2 + "]</b> are your two abilities: they cost stamina and have a cooldown. <b>[" + text3 + "]</b> is your ultimate. You get the first one when you swear your oath; the second unlocks after defeating " + text4 + " and the ultimate after defeating " + text5 + "."), ("4. Divine Favor (the bar below your abilities)", "It fills as you fight: hitting, blocking, finishing off enemies and using your abilities in combat. With a full bar you can cast your ultimate [" + text3 + "]; no favor is gained while it lasts."), ("5. Devotion", "A new skill that rises as you use your powers. The higher it is, the more damage they deal."), ("6. Play together: combos", "<b>Electrified</b> (Thor) + <b>Frozen</b> (Skadi) = Shatter. <b>Wet</b> (Njord) + Electrified = chain discharge; Wet + Slowed (Skadi) = instant freeze. <b>Marked</b> (Odin): the whole group deals more damage to it. <b>Confused</b> (Loki): it loses its target. Freyja's <b>Aegis</b>, when it breaks, releases the element of the protected ally's class.") } : new(string, string)[6] { ("1. Jura lealtad a un dios", "Ve a cualquier altar de invocación de jefe (como el de Eikthyr) y ofrece el objeto del dios que quieras. Si ofreces el de otro dios, cambias de clase.\n<size=16>" + stringBuilder?.ToString() + "</size>"), ("2. Lleva el arma de tu dios", "Cada dios solo te presta su poder con un tipo de arma equipada (lo verás en su pestaña). Sin ella, las habilidades no se pueden usar."), ("3. Tus habilidades", "<b>[" + text + "]</b> y <b>[" + text2 + "]</b> son tus dos habilidades: gastan estamina y tienen un tiempo de espera. <b>[" + text3 + "]</b> es la definitiva. La primera la tienes desde que juras; la segunda se desbloquea al derrotar a " + text4 + " y la definitiva al derrotar a " + text5 + "."), ("4. Favor divino (la barra bajo tus habilidades)", "Se llena luchando: golpeando, bloqueando, rematando enemigos y usando tus habilidades en combate. Con la barra llena puedes lanzar la definitiva [" + text3 + "]; mientras dura no se gana favor."), ("5. Devoción", "Es una habilidad nueva que sube a medida que usas tus poderes. Cuanto más alta, más daño hacen."), ("6. Jugad juntos: los combos", "<b>Electrificado</b> (Thor) + <b>Congelado</b> (Skadi) = Estallido. <b>Mojado</b> (Njörðr) + Electrificado = descarga en cadena; Mojado + Ralentizado (Skadi) = congelado al instante. <b>Marcado</b> (Odín): todo el grupo le hace más daño. <b>Confundido</b> (Loki): pierde su objetivo. La <b>Égida</b> de Freyja, al romperse, suelta el elemento de la clase del aliado protegido.") }); float num2 = -78f; (string, string)[] array = obj; for (int i = 0; i < array.Length; i++) { (string, string) tuple = array[i]; string item = tuple.Item1; string item2 = tuple.Item2; Text texto = Texto(_contenido, "<color=#ffa03c><b>" + item + "</b></color>\n" + item2, new Vector2(30f, num2), new Vector2(num - 60f, 90f), 18, Color.white, (TextAnchor)0, izquierda: true); num2 -= AltoTexto(texto, 40f) + 12f; } } private static void RellenarClase() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; DefinicionClase definicionClase = CatalogoClases.Obtener(_seleccionada); ClaseDios claseDios = GestorClases.Obtener(localPlayer); float num = 920f; Imagen(_contenido, Recursos.IconoClase(_seleccionada), new Vector2(40f, -40f), 68f); Texto(_contenido, definicionClase.NombreColoreado + " <size=18><color=#c8c8c8>· " + definicionClase.Dios + " · " + definicionClase.Rol + "</color></size>", new Vector2(84f, -14f), new Vector2(num - 100f, 34f), 26, Color.white, (TextAnchor)3, izquierda: true); string contenido = ((claseDios == _seleccionada) ? ("<color=#8fe08f>" + Idioma.T("Es tu juramento actual", "This is your current oath") + "</color>") : Idioma.T("Ofrenda: <b>" + CatalogoClases.NombreVisibleOfrenda(definicionClase) + "</b> en un altar de jefe", "Offering: <b>" + CatalogoClases.NombreVisibleOfrenda(definicionClase) + "</b> at a boss altar")); Texto(_contenido, contenido, new Vector2(84f, -44f), new Vector2(num - 100f, 24f), 16, Gris, (TextAnchor)3, izquierda: true); Texto(_contenido, Idioma.T("Arma necesaria: ", "Required weapon: ") + "<color=#ffffff><b>" + ArmasClase.Descripcion(_seleccionada) + "</b></color>", new Vector2(84f, -68f), new Vector2(num - 100f, 24f), 16, Gris, (TextAnchor)3, izquierda: true); float num2 = -100f; RanuraHabilidad[] array = new RanuraHabilidad[3] { RanuraHabilidad.Primera, RanuraHabilidad.Segunda, RanuraHabilidad.Definitiva }; foreach (RanuraHabilidad ranura in array) { Habilidad habilidad = RegistroHabilidades.Obtener(_seleccionada, ranura); if (habilidad != null) { num2 -= Mathf.Max(84f, Ficha(habilidad, num2, num)) + 10f; } } if (_seleccionada == ClaseDios.Freyja) { Imagen(_contenido, Recursos.Icono("freyja_egida"), new Vector2(40f, num2 - 30f), 52f); Texto(_contenido, Idioma.T("<color=#ffa03c><b>Represalia de la Valquiria</b></color> <size=14><color=#c8c8c8>(pasiva, siempre activa)</color></size>\nAl bloquear un golpe con el escudo sueltas un destello de luz que daña y empuja a los enemigos cercanos.", "<color=#ffa03c><b>Valkyrie's Retaliation</b></color> <size=14><color=#c8c8c8>(passive, always active)</color></size>\nBlocking a hit with your shield releases a flash of light that damages and pushes back nearby enemies."), new Vector2(84f, num2 - 8f), new Vector2(num - 100f, 60f), 18, Color.white, (TextAnchor)0, izquierda: true); num2 -= 72f; } Texto(_contenido, "<color=#ffa03c><b>" + Idioma.T("Cómo se juega", "How to play") + "</b></color>\n" + Consejos(_seleccionada), new Vector2(30f, num2 - 6f), new Vector2(num - 40f, 110f), 17, Gris, (TextAnchor)0, izquierda: true); } private static string Consejos(ClaseDios clase) { return clase switch { ClaseDios.Thor => Idioma.T("Lucha en primera línea. Tus rayos dejan a los enemigos <b>Electrificados</b>: si Skadi los congela estallan (Estallido), y si Njörðr los ha mojado el rayo salta en cadena a los de alrededor.", "Fight on the front line. Your lightning leaves enemies <b>Electrified</b>: if Skadi freezes them they Shatter, and if Njord has soaked them the lightning chains to those around them."), ClaseDios.Skadi => Idioma.T("Mantén la distancia y controla: congelas y ralentizas. Necesitas munición (flechas o virotes). Congelar a un Electrificado (Thor) provoca un Estallido, y ralentizar a un Mojado (Njörðr) lo congela al instante.", "Keep your distance and control the fight: you freeze and slow. You need ammo (arrows or bolts). Freezing an Electrified enemy (Thor) causes a Shatter, and slowing a Wet one (Njord) freezes it instantly."), ClaseDios.Freyja => Idioma.T("Sostén al grupo: la Luz cura y potencia las habilidades de tus aliados, y la Égida protege a quien apuntes. Al romperse, la Égida suelta el elemento de la clase del aliado protegido (rayo de Thor, hielo de Skadi, fuego de Surtr…). Lleva siempre escudo: también bloqueando ayudas.", "Keep the group alive: Light heals and empowers your allies' abilities, and Aegis protects whoever you aim at. When it breaks, Aegis releases the element of the protected ally's class (Thor's lightning, Skadi's ice, Surtr's fire...). Always carry a shield: blocking helps too."), ClaseDios.Surtr => Idioma.T("Mete fuego por todas partes: tus ataques queman a los enemigos durante unos segundos. Entra con la Embestida, remata con la Bola de Fuego y, en la definitiva, los meteoros caen mientras tú pegas más fuerte.", "Set everything on fire: your attacks burn enemies for a few seconds. Go in with the Charge, finish with the Fireball and, during your ultimate, meteors fall while you hit harder."), ClaseDios.Odin => Idioma.T("Ataca desde lejos. Gungnir deja a los enemigos <b>Marcados</b>: todo el grupo les hace más daño. El Ocaso Rúnico encierra a los enemigos en su círculo (no pueden salir hasta la explosión final), ideal para las áreas de tus aliados. Tu magia hace daño extra a los no-muertos.", "Attack from afar. Gungnir leaves enemies <b>Marked</b>: the whole group deals more damage to them. Runic Twilight traps enemies in its circle (they can't escape until the final blast), perfect for your allies' area attacks. Your magic deals extra damage to the undead."), ClaseDios.Loki => Idioma.T("Golpea desde las sombras: mientras estás oculto los enemigos no te ven, y el primer golpe al salir hace mucho más daño. Los enemigos <b>Confundidos</b> pierden su objetivo, útil para quitarle presión a un aliado. Tu veneno sigue haciendo daño con el tiempo.", "Strike from the shadows: while hidden, enemies can't see you, and your first hit when you come out deals much more damage. <b>Confused</b> enemies lose their target, useful to take pressure off an ally. Your poison keeps dealing damage over time."), ClaseDios.Njord => Idioma.T("Controla el campo con agua: tus golpes dejan a los enemigos <b>Mojados</b>. Mojado + Electrificado (Thor) = descarga en cadena; Mojado + Ralentizado (Skadi) = congelado al instante. En barco, tu definitiva te da viento a favor.", "Control the battlefield with water: your hits leave enemies <b>Wet</b>. Wet + Electrified (Thor) = chain discharge; Wet + Slowed (Skadi) = instant freeze. On a ship, your ultimate gives you favorable wind."), _ => "", }; } private static float Ficha(Habilidad habilidad, float y, float ancho) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) bool num = GestorHabilidades.EstaDesbloqueada(habilidad.Ranura); string text = GestorHabilidades.NombreTecla(habilidad.Ranura); string text2 = (habilidad.EsDefinitiva ? Idioma.T("Definitiva", "Ultimate") : (Idioma.T("Habilidad ", "Ability ") + ((habilidad.Ranura == RanuraHabilidad.Primera) ? "1" : "2"))); Image val = Imagen(_contenido, habilidad.Icono, new Vector2(40f, y - 38f), 68f); if (!num) { ((Graphic)val).color = new Color(0.45f, 0.45f, 0.45f, 1f); } string text3 = (habilidad.EsDefinitiva ? Idioma.T("Necesita el favor divino lleno", "Needs full Divine Favor") : Idioma.T(Num(habilidad.CosteEstamina) + " de estamina · espera " + Num(habilidad.Cooldown) + " s", Num(habilidad.CosteEstamina) + " stamina · " + Num(habilidad.Cooldown) + " s cooldown")); string text4 = (num ? ("<color=#8fe08f>" + Idioma.T("Desbloqueada", "Unlocked") + "</color>") : ("<color=#e08f8f>" + Idioma.T("Se desbloquea al derrotar a ", "Unlocked by defeating ") + GestorHabilidades.NombreJefe(GestorHabilidades.ClaveDesbloqueo(habilidad.Ranura)) + "</color>")); return AltoTexto(Texto(_contenido, "<color=#ffa03c><b>" + habilidad.Nombre + "</b></color> <size=15><color=#c8c8c8>[" + text + "] · " + text2 + " · " + text3 + " · </color>" + text4 + "</size>\n" + habilidad.Descripcion, new Vector2(84f, y - 8f), new Vector2(ancho - 100f, 90f), 18, Color.white, (TextAnchor)0, izquierda: true), 60f) + 8f; } private static float AltoTexto(Text texto, float minimo) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0024: Unknown result type (might be due to invalid IL or missing references) RectTransform val = (RectTransform)((Component)texto).transform; float num = Mathf.Max(minimo, texto.preferredHeight); val.sizeDelta = new Vector2(val.sizeDelta.x, num); return num; } private static string Num(float valor) { return valor.ToString("0.##", Idioma.EsEspanol ? CultureInfo.GetCultureInfo("es-ES") : CultureInfo.InvariantCulture); } private static Text Texto(Transform padre, string contenido, Vector2 posicion, Vector2 tam, int tamFuente, Color color, TextAnchor alineacion, bool izquierda = false) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0053: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_012d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Texto", new Type[2] { typeof(RectTransform), typeof(Text) }); val.transform.SetParent(padre, false); RectTransform val2 = (RectTransform)val.transform; Vector2 anchorMin = (val2.anchorMax = (izquierda ? new Vector2(0f, 1f) : new Vector2(0.5f, 1f))); val2.anchorMin = anchorMin; val2.pivot = (izquierda ? new Vector2(0f, 1f) : new Vector2(0.5f, 0.5f)); val2.anchoredPosition = posicion; val2.sizeDelta = tam; Text component = val.GetComponent<Text>(); component.text = contenido; component.font = GUIManager.Instance.AveriaSerifBold; component.fontSize = tamFuente; ((Graphic)component).color = color; component.alignment = alineacion; component.supportRichText = true; component.horizontalOverflow = (HorizontalWrapMode)0; component.verticalOverflow = (VerticalWrapMode)1; ((Graphic)component).raycastTarget = false; Outline obj = val.AddComponent<Outline>(); ((Shadow)obj).effectColor = new Color(0f, 0f, 0f, 0.8f); ((Shadow)obj).effectDistance = new Vector2(1f, -1f); return component; } private static Image Imagen(Transform padre, Sprite sprite, Vector2 centro, float tam) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Icono", new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(padre, false); RectTransform val2 = (RectTransform)val.transform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0.5f, 0.5f); val2.anchoredPosition = centro; val2.sizeDelta = new Vector2(tam, tam); Image component = val.GetComponent<Image>(); component.sprite = sprite; component.preserveAspect = true; ((Graphic)component).raycastTarget = false; return component; } } } namespace JuramentoDioses.Parches { [HarmonyPatch] internal static class PatchCongeladoIA { private static readonly FieldRef<BaseAI, Character> _personaje = AccessTools.FieldRefAccess<BaseAI, Character>("m_character"); private static readonly FieldRef<MonsterAI, Character> _objetivo = AccessTools.FieldRefAccess<MonsterAI, Character>("m_targetCreature"); private static IEnumerable<MethodBase> TargetMethods() { yield return AccessTools.Method(typeof(MonsterAI), "UpdateAI", (Type[])null, (Type[])null); yield return AccessTools.Method(typeof(AnimalAI), "UpdateAI", (Type[])null, (Type[])null); } private static bool Prefix(BaseAI __instance, ref bool __result) { Character val = _personaje.Invoke(__instance); if ((Object)(object)val == (Object)null || val.IsBoss()) { return true; } if (EstadosJuramento.Tiene(val, EstadosJuramento.Confundido)) { MonsterAI val2 = (MonsterAI)(object)((__instance is MonsterAI) ? __instance : null); if (val2 != null) { _objetivo.Invoke(val2) = null; } __result = false; return false; } if (!EstadosJuramento.Tiene(val, EstadosJuramento.Congelado)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(SEMan), "Internal_AddStatusEffect")] internal static class PatchCombosAlAnadirEstado { private static readonly FieldRef<SEMan, Character> _personaje = AccessTools.FieldRefAccess<SEMan, Character>("m_character"); private static void Postfix(SEMan __instance, int nameHash, StatusEffect __result) { if (!((Object)(object)__result == (Object)null)) { Combos.AlAnadirEstado(_personaje.Invoke(__instance), nameHash); } } } [HarmonyPatch(typeof(Character), "SetHealth")] internal static class PatchBendicionVidaMinima { private static void Prefix(Character __instance, ref float health) { if (__instance.IsPlayer()) { float health2 = __instance.GetHealth(); if (health < health2 && EstadosJuramento.Tiene(__instance, EstadosJuramento.Bendicion)) { health = health2; } } } } [HarmonyPatch(typeof(Game), "Start")] internal static class PatchGameStart { private static void Postfix() { EfectosRed.RegistrarRpc(); ClimaTemporal.RegistrarRpc(); SombraLoki.RegistrarRpc(); JaulaRunica.RegistrarRpc(); } } [HarmonyPatch(typeof(Hud), "Awake")] internal static class PatchHudAwake { private static void Postfix(Hud __instance) { HudHabilidades.Crear(__instance); } } [HarmonyPatch(typeof(Character), "Damage")] internal static class PatchFavorAlGolpear { private static readonly HashSet<int> _rematados = new HashSet<int>(); private static void Prefix(Character __instance, HitData hit) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || hit == null || (Object)(object)__instance == (Object)null || (Object)(object)__instance == (Object)(object)localPlayer || !Objetivos.EsEnemigo(__instance) || (Object)(object)hit.GetAttacker() != (Object)(object)localPlayer) { return; } bool flag = hit.m_ranged && (Object)(object)EstadosJuramento.Congelado != (Object)null && hit.m_statusEffectHash == EstadosJuramento.Congelado.NameHash(); if (flag) { FlechaGlacial.AlImpactar(localPlayer, __instance, hit.m_point); } bool flag2 = ContextoHabilidad.Activo || flag; float num = (flag2 ? ConfigJuramento.FavorPorGolpeHabilidad.Value : ConfigJuramento.FavorPorGolpe.Value); if (num > 0f) { FavorDivino.SumarPorGolpe(localPlayer, __instance, flag2, num); } if (__instance.IsDead() || !(hit.GetTotalDamage() >= __instance.GetHealth())) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (_rematados.Add(instanceID)) { if (_rematados.Count > 512) { _rematados.Clear(); } FavorDivino.Sumar(localPlayer, ConfigJuramento.FavorPorMuerte.Value); } } } [HarmonyPatch(typeof(Player), "OnDeath")] internal static class PatchFavorAlMorir { private static void Postfix(Player __instance) { if ((Object)(object)__instance == (Object)(object)Player.m_localPlayer) { FavorDivino.Establecer(__instance, 0f); } } } [HarmonyPatch(typeof(Humanoid), "BlockAttack")] internal static class PatchRepresaliaAlBloquear { private static float _ultimoBloqueo; private static void Postfix(Humanoid __instance, bool __result) { if (!__result) { return; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer)) { if (Time.time - _ultimoBloqueo > 0.5f) { _ultimoBloqueo = Time.time; FavorDivino.Sumar(val, ConfigJuramento.FavorPorBloqueo.Value); } if (GestorClases.Obtener(val) == ClaseDios.Freyja) { RepresaliaValquiria.AlBloquear(val); } } } } [HarmonyPatch(typeof(Character), "Damage")] [HarmonyPriority(800)] internal static class PatchSinDanioEntreJugadores { private static bool Prefix(Character __instance, HitData hit) { if (!ConfigJuramento.SinDanioEntreJugadores.Value || hit == null) { return true; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if ((Object)(object)val == (Object)null) { return true; } Character attacker = hit.GetAttacker(); Player val2 = (Player)(object)((attacker is Player) ? attacker : null); if ((Object)(object)val2 == (Object)null) { return true; } if ((Object)(object)val2 == (Object)(object)val) { return false; } if (!((Character)val).IsPVPEnabled() || !((Character)val2).IsPVPEnabled()) { return false; } return true; } } [HarmonyPatch(typeof(Character), "Damage")] internal static class PatchGolpeSombrio { [HarmonyPriority(600)] private static void Prefix(Character __instance, HitData hit) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_012e: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || hit == null || (Object)(object)__instance == (Object)null || (Object)(object)__instance == (Object)(object)localPlayer || (Object)(object)hit.GetAttacker() != (Object)(object)localPlayer || !Objetivos.EsEnemigo(__instance)) { return; } DamageTypes damage = hit.m_damage; if (!(((DamageTypes)(ref damage)).GetTotalPhysicalDamage() > 0f) && !(damage.m_fire > 0f) && !(damage.m_frost > 0f) && !(damage.m_lightning > 0f) && !(damage.m_spirit > 0f)) { return; } if (EstadosJuramento.Tiene((Character)(object)localPlayer, EstadosJuramento.GolpeSombrio)) { float num = GolpeSombrio.Bonus; if (__instance.IsBoss()) { num *= ConfigJuramento.JefesBonusDanio.Value; } hit.ApplyModifier(1f + num); GolpeSombrio.Bonus = 0f; GolpeSombrio.UltimoGolpe = Time.time; ((Character)localPlayer).Message((MessageType)2, string.Format("<color=#b48cff>{0}</color> ×{1:0.#}", Idioma.T("¡Golpe Sombrío!", "Shadow Strike!"), 1f + num), 0, (Sprite)null, false); if (num >= 2f) { EfectosRed.Reproducir("fx_FallenValkyrie_projectile_explosion", __instance.GetCenterPoint(), Quaternion.identity, 1.2f); Camara.Temblor(__instance.GetCenterPoint(), 1.2f); } Registro.Depurar($"Golpe Sombrío ×{1f + num:0.##} → {hit.GetTotalDamage():0} de daño"); EfectosRed.Reproducir("sfx_ghost_attack", __instance.GetCenterPoint()); EstadosJuramento.Quitar((Character)(object)localPlayer, EstadosJuramento.GolpeSombrio); EfectosRed.Reproducir("fx_BonemawSerpent_Spit_Hit", __instance.GetCenterPoint(), Quaternion.identity, 1.5f); EfectosRed.Reproducir("fx_DvergerMage_Mistile_die", __instance.GetCenterPoint()); } if (EstadosJuramento.Tiene((Character)(object)localPlayer, EstadosJuramento.Oculto)) { EstadosJuramento.Quitar((Character)(object)localPlayer, EstadosJuramento.Oculto); } } } [HarmonyPatch(typeof(Player), "GetStealthFactor")] internal static class PatchSigiloOculto { internal static bool JefeMirando; private static void Postfix(Player __instance, ref float __result) { if ((!JefeMirando || !ConfigJuramento.JefesVenOcultos.Value) && SE_JD_Oculto.EstaOculto(__instance)) { __result = 0f; } } } [HarmonyPatch] internal static class PatchJefeMirando { private static readonly FieldRef<BaseAI, Character> _personaje = AccessTools.FieldRefAccess<BaseAI, Character>("m_character"); private static IEnumerable<MethodBase> TargetMethods() { yield return AccessTools.Method(typeof(BaseAI), "CanSenseTarget", new Type[2] { typeof(Character), typeof(bool) }, (Type[])null); yield return AccessTools.Method(typeof(BaseAI), "CanSeeTarget", new Type[1] { typeof(Character) }, (Type[])null); } private static void Prefix(BaseAI __instance, out bool __state) { __state = PatchSigiloOculto.JefeMirando; Character val = _personaje.Invoke(__instance); PatchSigiloOculto.JefeMirando = (Object)(object)val != (Object)null && val.IsBoss(); } private static void Postfix(bool __state) { PatchSigiloOculto.JefeMirando = __state; } } [HarmonyPatch(typeof(OfferingBowl), "UseItem")] internal static class PatchOfferingBowlUseItem { private static bool Prefix(OfferingBowl __instance, Humanoid user, ItemData item, ref bool __result) { Player val = (Player)(object)((user is Player) ? user : null); if ((Object)(object)val == (Object)null || (Object)(object)val != (Object)(object)Player.m_localPlayer) { return true; } if (!Ofrenda.EsAltarDeJefe(__instance)) { return true; } if (Ofrenda.IntentarOfrenda(val, item, __instance)) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(OfferingBowl), "GetHoverText")] internal static class PatchOfferingBowlHover { private static void Postfix(OfferingBowl __instance, ref string __result) { if (!((Object)(object)Player.m_localPlayer == (Object)null) && Ofrenda.EsAltarDeJefe(__instance)) { __result += Ofrenda.TextoHover(Player.m_localPlayer); } } } } namespace JuramentoDioses.Habilidades { public static class Combate { private static readonly FieldRef<Character, ZSyncAnimation> _zanim = AccessTools.FieldRefAccess<Character, ZSyncAnimation>("m_zanim"); private static readonly FieldRef<Character, Rigidbody> _cuerpo = AccessTools.FieldRefAccess<Character, Rigidbody>("m_body"); private static int _mascaraSuelo = -1; public static int MascaraSuelo { get { if (_mascaraSuelo == -1) { _mascaraSuelo = LayerMask.GetMask(new string[6] { "Default", "static_solid", "Default_small", "piece", "terrain", "vehicle" }); } return _mascaraSuelo; } } public static Rigidbody Cuerpo(Character c) { return _cuerpo.Invoke(c); } public static ZSyncAnimation Animacion(Character c) { if (!((Object)(object)c != (Object)null)) { return null; } return _zanim.Invoke(c); } public static bool LlevaArco(Player jugador) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 ItemData currentWeapon = ((Humanoid)jugador).GetCurrentWeapon(); if (currentWeapon != null) { return (int)currentWeapon.m_shared.m_skillType == 8; } return false; } public static ItemData BuscarFlecha(Player jugador) { ItemData ammoItem = ((Humanoid)jugador).GetAmmoItem(); if (ammoItem != null && ammoItem.m_stack > 0) { return ammoItem; } ItemData currentWeapon = ((Humanoid)jugador).GetCurrentWeapon(); if (currentWeapon == null || string.IsNullOrEmpty(currentWeapon.m_shared.m_ammoType)) { return null; } return ((Humanoid)jugador).GetInventory().GetAmmoItem(currentWeapon.m_shared.m_ammoType, (string)null); } public static float DanioArco(Player jugador) { //IL_0019: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) ItemData currentWeapon = ((Humanoid)jugador).GetCurrentWeapon(); ItemData val = BuscarFlecha(jugador); float num; DamageTypes damage; if (currentWeapon == null) { num = 0f; } else { damage = currentWeapon.GetDamage(); num = ((DamageTypes)(ref damage)).GetTotalDamage(); } float num2 = num; float num3; if (val == null) { num3 = 0f; } else { damage = val.GetDamage(); num3 = ((DamageTypes)(ref damage)).GetTotalDamage(); } float num4 = num3; float num5 = ((val != null) ? ((num2 + num4) * 0.5f) : num2); return Mathf.Max(5f, num5) * ConfigJuramento.DanioGlobal.Value * Devocion.Factor(jugador); } public static float MultiplicadorHabilidad(Character atacante) { if (!EstadosJuramento.Tiene(atacante, EstadosJuramento.LuzInspiradora)) { return 1f; } return 1f + ConfigJuramento.InspiracionBonus.Value; } public static void GolpeHielo(Player atacante, Character objetivo, float danio, Vector3 direccion, float empuje = 0f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Golpe((Character)(object)atacante, objetivo, direccion, empuje, delegate(HitData hit) { hit.m_damage.m_frost = danio * MultiplicadorHabilidad((Character)(object)atacante); }); } public static void Golpe(Character atacante, Character objetivo, Vector3 direccion, float empuje, Action<HitData> rellenar) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0022: 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_0044: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)objetivo == (Object)null || objetivo.IsDead()) { return; } HitData val = new HitData(); rellenar(val); val.m_point = objetivo.GetCenterPoint(); val.m_dir = ((((Vector3)(ref direccion)).sqrMagnitude > 0.001f) ? ((Vector3)(ref direccion)).normalized : Vector3.forward); val.m_pushForce = empuje; val.m_hitType = (HitType)2; if ((Object)(object)atacante != (Object)null) { Humanoid val2 = (Humanoid)(object)((atacante is Humanoid) ? atacante : null); ItemData val3 = (((Object)(object)val2 != (Object)null) ? val2.GetCurrentWeapon() : null); val.m_skill = (SkillType)((val3 == null) ? 11 : ((int)val3.m_shared.m_skillType)); val.SetAttacker(atacante); } bool activo = ContextoHabilidad.Activo; ContextoHabilidad.Activo = true; try { objetivo.Damage(val); } finally { ContextoHabilidad.Activo = activo; } } public static bool EsArmaCuerpoACuerpo(ItemData arma) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if (arma == null) { return true; } SkillType skillType = arma.m_shared.m_skillType; if (skillType - 8 <= 2 || (int)skillType == 14) { return false; } return true; } public static float DanioArma(Player jugador) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) ItemData currentWeapon = ((Humanoid)jugador).GetCurrentWeapon(); float num; if (currentWeapon != null) { DamageTypes damage = currentWeapon.GetDamage(); num = Mathf.Max(5f, ((DamageTypes)(ref damage)).GetTotalDamage()); } else { num = 10f; } float num2 = num; if (ArmasClase.RequiereEscudo(GestorClases.Obtener(jugador))) { ItemData val = ArmasClase.Escudo(jugador); if (val != null) { num2 = (num2 + Mathf.Max(5f, val.GetBaseBlockPower())) * 0.5f; } } return num2 * ConfigJuramento.DanioGlobal.Value * Devocion.Factor(jugador); } public static void GolpeRayo(Player atacante, Character objetivo, float danio, Vector3 direccion, float empuje = 0f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0036: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)atacante == (Object)null || (Object)(object)objetivo == (Object)null || objetivo.IsDead()) { return; } HitData val = new HitData(); val.m_damage.m_lightning = danio * MultiplicadorHabilidad((Character)(object)atacante); val.m_point = objetivo.GetCenterPoint(); val.m_dir = ((((Vector3)(ref direccion)).sqrMagnitude > 0.001f) ? ((Vector3)(ref direccion)).normalized : ((Component)atacante).transform.forward); val.m_pushForce = empuje; val.m_hitType = (HitType)2; ItemData currentWeapon = ((Humanoid)atacante).GetCurrentWeapon(); val.m_skill = (SkillType)((currentWeapon == null) ? 11 : ((int)currentWeapon.m_shared.m_skillType)); val.SetAttacker((Character)(object)atacante); bool activo = ContextoHabilidad.Activo; ContextoHabilidad.Activo = true; try { objetivo.Damage(val); } finally { ContextoHabilidad.Activo = activo; } } public static void Derribar(Character objetivo, Vector3 direccion) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)objetivo == (Object)null) && !objetivo.IsDead() && !objetivo.IsBoss()) { objetivo.Stagger(direccion); } } public static Vector3 DireccionMirada(Player jugador) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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) Vector3 val = ((Character)jugador).GetLookDir(); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = ((Component)jugador).transform.forward; } return ((Vector3)(ref val)).normalized; } public static void AnimacionAtaqueSecundario(Player jugador) { ItemData currentWeapon = ((Humanoid)jugador).GetCurrentWeapon(); string text = currentWeapon?.m_shared.m_secondaryAttack?.m_attackAnimation; if (string.IsNullOrEmpty(text)) { text = currentWeapon?.m_shared.m_attack?.m_attackAnimation; } if (!string.IsNullOrEmpty(text)) { ZSyncAnimation obj = _zanim.Invoke((Character)(object)jugador); if (obj != null) { obj.SetTrigger(text); } } } public static List<Vector3> Trayecto(Vector3 inicio, Vector3 dir, float distancia, float paso = 0.5f, float subidaMaxima = 1.1f) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_001f: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00ae: Unknown result type (might be due to invalid IL or missing references) dir.y = 0f; if (((Vector3)(ref dir)).sqrMagnitude < 0.0001f) { dir = Vector3.forward; } ((Vector3)(ref dir)).Normalize(); List<Vector3> list = new List<Vector3> { inicio }; Vector3 val = inicio; for (float num = paso; num <= distancia + 0.001f; num += paso) { Vector3 val2 = val + dir * paso; val2.y = AlturaSuelo(val2, val.y + subidaMaxima); if (val2.y - val.y > subidaMaxima || Physics.Linecast(val + Vector3.up * 1.2f, val2 + Vector3.up * 1.2f, MascaraSuelo)) { break; } list.Add(val2); val = val2; } return list; } public static Vector3 PuntoDeTrayecto(List<Vector3> puntos, float fraccion) { //IL_000b: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (puntos == null || puntos.Count == 0) { return Vector3.zero; } if (puntos.Count == 1) { return puntos[0]; } float num = Mathf.Clamp01(fraccion) * (float)(puntos.Count - 1); int num2 = Mathf.Min(puntos.Count - 2, Mathf.FloorToInt(num)); return Vector3.Lerp(puntos[num2], puntos[num2 + 1], num - (float)num2); } public static float AlturaSuelo(Vector3 punto, float referencia) { //IL_0000: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(new Vector3(punto.x, referencia + 2f, punto.z), Vector3.down, ref val, 8f, MascaraSuelo)) { return referencia; } return ((RaycastHit)(ref val)).point.y; } } public static class Combos { private static readonly Dictionary<int, float> _ultimoEstallido = new Dictionary<int, float>(); public static void AlAnadirEstado(Character personaje, int hashEstado) { if (!((Object)(object)personaje == (Object)null) && !personaje.IsPlayer() && !personaje.IsDead()) { CombosMojado(personaje, hashEstado); StatusEffect electrificado = EstadosJuramento.Electrificado; StatusEffect congelado = EstadosJuramento.Congelado; if (!((Object)(object)electrificado == (Object)null) && !((Object)(object)congelado == (Object)null) && (hashEstado == electrificado.NameHash() || hashEstado == congelado.NameHash()) && EstadosJuramento.Tiene(personaje, electrificado) && EstadosJuramento.Tiene(personaje, congelado)) { Estallido(personaje); } } } private static void CombosMojado(Character personaje, int hashEstado) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) StatusEffect mojado = EstadosJuramento.Mojado; if ((Object)(object)mojado == (Object)null) { return; } int num = mojado.NameHash(); int num2 = EstadosJuramento.Electrificado.NameHash(); int num3 = EstadosJuramento.Ralentizado.NameHash(); if ((hashEstado != num && hashEstado != num2 && hashEstado != num3) || !EstadosJuramento.Tiene(personaje, mojado)) { return; } if (EstadosJuramento.Tiene(personaje, EstadosJuramento.Electrificado)) { int instanceID = ((Object)personaje).GetInstanceID(); if (!_ultimoEstallido.TryGetValue(-instanceID, out var value) || !(Time.time - value < ConfigJuramento.EstallidoEnfriamiento.Value)) { _ultimoEstallido[-instanceID] = Time.time; EstadosJuramento.Quitar(personaje, mojado); Descarga(personaje); } } else if (EstadosJuramento.Tiene(personaje, EstadosJuramento.Ralentizado) && !personaje.IsBoss()) { EstadosJuramento.Quitar(personaje, mojado); EstadosJuramento.Aplicar(personaje, EstadosJuramento.Congelado); EfectosRed.Reproducir("vfx_BombBlob_explode_frost", personaje.GetCenterPoint()); } } private static void Descarga(Character origen) { //IL_0042: 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_004d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b4: 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) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) float danio = Mathf.Max(ConfigJuramento.DescargaDanioMinimo.Value, origen.GetMaxHealth() * ConfigJuramento.DescargaPorcentajeVida.Value * (origen.IsBoss() ? 0.25f : 1f)); Vector3 centerPoint = origen.GetCenterPoint(); EfectosRed.Reproducir("fx_lightningstaffprojectile_hit", centerPoint, Quaternion.identity, 1.5f); EfectosRed.Reproducir("fx_WaterImpact_Big", ((Component)origen).transform.position); EfectosRed.Reproducir("sfx_staffthunderblood_thunder", centerPoint); foreach (Character item in new List<Character>(Objetivos.EnemigosEnRadio(centerPoint, ConfigJuramento.DescargaRadio.Value))) { Vector3 centerPoint2 = item.GetCenterPoint(); EfectosRed.Reproducir("fx_lightningstaffprojectile_hit", centerPoint2); Combate.Golpe(null, item, centerPoint2 - centerPoint, 10f, delegate(HitData hit) { hit.m_damage.m_lightning = danio; }); } Registro.Depurar($"Descarga en {((Object)origen).name}: {danio:0} de daño"); } private static void Estallido(Character origen) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) int instanceID = ((Object)origen).GetInstanceID(); if (_ultimoEstallido.TryGetValue(instanceID, out var value) && Time.time - value < ConfigJuramento.EstallidoEnfriamiento.Value) { return; } _ultimoEstallido[instanceID] = Time.time; EstadosJuramento.Quitar(origen, EstadosJuramento.Electrificado); EstadosJuramento.Quitar(origen, EstadosJuramento.Congelado); float num = ConfigJuramento.EstallidoPorcentajeVida.Value * (origen.IsBoss() ? 0.25f : 1f); float danio = Mathf.Max(ConfigJuramento.EstallidoDanioMinimo.Value, origen.GetMaxHealth() * num); Vector3 centerPoint = origen.GetCenterPoint(); EfectosRed.Reproducir("vfx_BombBlob_explode_frost", centerPoint, Quaternion.identity, 1.5f); EfectosRed.Reproducir("fx_JotunWitch_LightningBolt_Explosion", centerPoint); EfectosRed.Reproducir("sfx_dragon_coldball_explode", centerPoint); EfectosRed.Reproducir("sfx_staffthunderblood_thunder", centerPoint); Camara.Temblor(centerPoint, 1.5f); foreach (Character item in new List<Character>(Objetivos.EnemigosEnRadio(centerPoint, ConfigJuramento.EstallidoRadio.Value))) { Vector3 direccion = ((Component)item).transform.position - centerPoint; Combate.Golpe(null, item, direccion, 50f, delegate(HitData hit) { hit.m_damage.m_lightning = danio * 0.5f; hit.m_damage.m_frost = danio * 0.5f; }); Combate.Derribar(item, direccion); } Registro.Depurar($"Estallido en {((Object)origen).name}: {danio:0} de daño"); } public static void EstallidoEgida(Character protegido, float danio) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_006f: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)protegido == (Object)null) { return; } Vector3 centerPoint = protegido.GetCenterPoint(); Player val = (Player)(object)((protegido is Player) ? protegido : null); ClaseDios claseDios = (((Object)(object)val != (Object)null) ? GestorClases.Obtener(val) : ClaseDios.Ninguna); foreach (Character item in new List<Character>(Objetivos.EnemigosEnRadio(centerPoint, ConfigJuramento.EgidaRadioEstallido.Value))) { Vector3 direccion = ((Component)item).transform.position - centerPoint; Combate.Golpe(protegido, item, direccion, 80f, delegate(HitData hit) { hit.m_damage.m_fire = Mathf.Max(10f, danio); }); Combate.Derribar(item, direccion); switch (claseDios) { case ClaseDios.Thor: EstadosJuramento.Aplicar(item, EstadosJuramento.Electrificado); break; case ClaseDios.Skadi: EstadosJuramento.Aplicar(item, EstadosJuramento.Congelado); break; case ClaseDios.Surtr: Combate.Golpe(protegido, item, direccion, 0f, delegate(HitData hit) { hit.m_damage.m_fire = 15f; }); break; case ClaseDios.Odin: EstadosJuramento.Aplicar(item, EstadosJuramento.Marcado); break; case ClaseDios.Njord: EstadosJuramento.Aplicar(item, EstadosJuramento.Mojado); break; case ClaseDios.Loki: Combate.Golpe(protegido, item, direccion, 0f, delegate(HitData hit) { hit.m_damage.m_poison = 20f; }); break; } } EfectosRed.Reproducir("fx_FallenValkyrie_projectile_explosion", centerPoint, Quaternion.identity, 1.5f); Camara.Temblor(centerPoint, 0.8f); } } public static class Devocion { public const string Identificador = "juramentodioses.devocion"; public static SkillType Tipo { get; private set; } public static void Registrar() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) Tipo = SkillManager.Instance.AddSkill(new SkillConfig { Identifier = "juramentodioses.devocion", Name = Traducciones.Token("jd_skill_devocion", "Devoción", "Devotion"), Description = Traducciones.Token("jd_skill_devocion_desc", "Tu fe en los dioses. Sube usando los poderes de tu juramento y hace que golpeen más fuerte.", "Your faith in the gods. It rises as you use the powers of your oath and makes them hit harder."), Icon = Recursos.IconoPropio("devocion"), IncreaseStep = 1f }); } public static float Nivel(Player jugador) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)jugador == (Object)null || (int)Tipo == 0) { return 0f; } return ((Character)jugador).GetSkillFactor(Tipo) * 100f; } public static float Factor(Player jugador) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)jugador == (Object)null || (int)Tipo == 0) { return 1f; } return Mathf.Lerp(ConfigJuramento.DevocionMinimo.Value, ConfigJuramento.DevocionMaximo.Value, ((Character)jugador).GetSkillFactor(Tipo)); } public static void AlUsar(Player jugador, Habilidad habilidad) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)jugador == (Object)null) && habilidad != null && (int)Tipo != 0) { float num = (habilidad.EsDefinitiva ? ConfigJuramento.DevocionPorDefinitiva.Value : ConfigJuramento.DevocionPorHabilidad.Value); if (num > 0f) { ((Character)jugador).RaiseSkill(Tipo, num); } } } } public static class FavorDivino { public const float Maximo = 100f; private const string Clave = "JuramentoDioses.Favor"; private const float EsperaPorEnemigo = 1f; private static float _bloqueadoHasta; private static readonly Dictionary<int, float> _ultimoGolpeHabilidad = new Dictionary<int, float>(); public static void Bloquear(float segundos) { if (segundos > 0f) { _bloqueadoHasta = Mathf.Max(_bloqueadoHasta, Time.time + segundos); } } public static void SumarPorGolpe(Player jugador, Character objetivo, bool deHabilidad, float cantidad) { if (deHabilida