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 Allfather v2.9.2
Allfather.dll
Decompiled 3 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.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Splatform; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Rendering; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace Allfather; public static class ArmorSets { public class Set { public string Name; public string Helmet; public string Chest; public string Legs; public string Cape; public Color Glow; public Set(string name, string helmet, string chest, string legs, string cape, Color glow) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Name = name; Helmet = helmet; Chest = chest; Legs = legs; Cape = cape; Glow = glow; } } public static readonly List<Set> All = new List<Set> { new Set("the Allfather's Raiment", string.Empty, "ArmorDeepNorthHeavyChest", "ArmorDeepNorthHeavylegs", "CapeOdin", new Color(1f, 0.88f, 0.6f)), new Set("the Flametal of Muspelheim", "HelmetFlametal", "ArmorFlametalChest", "ArmorFlametalLegs", "CapeAsh", new Color(1f, 0.55f, 0.2f)), new Set("the Hide of Fenrir", "HelmetFenring", "ArmorFenringChest", "ArmorFenringLegs", "CapeWolf", new Color(0.75f, 0.2f, 0.2f)), new Set("the Seer's Robes", "HelmetMage", "ArmorMageChest", "ArmorMageLegs", "CapeOdin", new Color(0.55f, 0.6f, 1f)), new Set("the Carapace of Mist", "HelmetCarapace", "ArmorCarapaceChest", "ArmorCarapaceLegs", "CapeFeather", new Color(0.6f, 0.95f, 1f)), new Set("the Ashen Sorcerer", "HelmetMage_Ashlands", "ArmorMageChest_Ashlands", "ArmorMageLegs_Ashlands", "CapeAsksvin", new Color(0.95f, 0.4f, 1f)), new Set("the Wolf Lord of the Mountain", "HelmetDrake", "ArmorWolfChest", "ArmorWolfLegs", "CapeWolf", new Color(0.85f, 0.95f, 1f)), new Set("the Roots of Yggdrasil", "HelmetRoot", "ArmorRootChest", "ArmorRootLegs", "CapeFeather", new Color(0.5f, 1f, 0.35f)), new Set("the Iron Jarl", "HelmetIron", "ArmorIronChest", "ArmorIronLegs", "CapeOdin", new Color(0.9f, 0.9f, 0.95f)), new Set("the Warlord of the Plains", "HelmetPadded", "ArmorPaddedCuirass", "ArmorPaddedGreaves", "CapeLox", new Color(1f, 0.95f, 0.75f)) }; private static Set _custom; public static Set Civilian; public static Set Current { get { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.RotateArmor.Value) { if (_custom == null) { _custom = new Set(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, All[0].Glow); } _custom.Helmet = Plugin.ArmorHelmet.Value; _custom.Chest = Plugin.ArmorChest.Value; _custom.Legs = Plugin.ArmorLegs.Value; _custom.Cape = Plugin.ArmorCape.Value; return _custom; } return All[Mathf.Abs(Plugin.ArmorSetIndex.Value) % All.Count]; } } public static Set Advance() { if (!Plugin.RotateArmor.Value) { return Current; } for (int i = 0; i < All.Count; i++) { Plugin.ArmorSetIndex.Value = (Mathf.Abs(Plugin.ArmorSetIndex.Value) + 1) % All.Count; if (Exists(Current.Chest) && IsOn(Plugin.ArmorSetIndex.Value)) { break; } } return Current; } public static bool IsOn(int index) { string[] source = (Plugin.ArmorSetsOff.Value ?? string.Empty).Split(','); return !source.Contains(index.ToString()); } public static void SetOn(int index, bool on) { HashSet<string> hashSet = new HashSet<string>(from x in (Plugin.ArmorSetsOff.Value ?? string.Empty).Split(',') where x.Trim() != string.Empty select x); if (on) { hashSet.Remove(index.ToString()); } else { hashSet.Add(index.ToString()); } if (hashSet.Count >= All.Count) { hashSet.Remove("0"); } Plugin.ArmorSetsOff.Value = string.Join(",", hashSet.ToArray()); } public static bool Exists(string item) { return !string.IsNullOrEmpty(item) && (Object)(object)ObjectDB.instance != (Object)null && (Object)(object)ObjectDB.instance.GetItemPrefab(item) != (Object)null; } public static Set NewCivilian() { //IL_007a: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) Random r = new Random(); List<Set> list = new List<Set>(); string[] capes = new string[6] { "CapeDeerHide", "CapeTrollHide", "CapeWolf", "CapeLox", "CapeLinen", string.Empty }; Func<string> func = () => capes[r.Next(capes.Length)]; list.Add(new Set("a hunter's leathers", string.Empty, "ArmorLeatherChest", "ArmorLeatherLegs", "CapeDeerHide", Color.white)); list.Add(new Set("a wolf-hunter's leathers", string.Empty, "ArmorLeatherChest", "ArmorLeatherLegs", "CapeWolf", Color.white)); list.Add(new Set("a ranger's troll-hide", "HelmetTrollLeather", "ArmorTrollLeatherChest", "ArmorTrollLeatherLegs", "CapeTrollHide", Color.white)); list.Add(new Set("a ranger's troll-hide", string.Empty, "ArmorTrollLeatherChest", "ArmorTrollLeatherLegs", func(), Color.white)); list.Add(new Set("a woodsman's gear", string.Empty, "ArmorTrollLeatherChest", "ArmorLeatherLegs", "CapeDeerHide", Color.white)); for (int num = 0; num < 3; num++) { list.Add(new Set("a wanderer's tunic", string.Empty, "ArmorTunic" + r.Next(1, 11), (r.Next(2) != 0) ? "ArmorTrollLeatherLegs" : "ArmorLeatherLegs", func(), Color.white)); } list.Add(new Set("a lox-rider's furs", string.Empty, "ArmorLeatherChest", "ArmorTrollLeatherLegs", "CapeLox", Color.white)); List<Set> list2 = list.Where((Set s2) => Exists(s2.Chest)).ToList(); Civilian = ((list2.Count <= 0) ? new Set("a hunter's leathers", string.Empty, "ArmorLeatherChest", "ArmorLeatherLegs", "CapeDeerHide", Color.white) : list2[r.Next(list2.Count)]); return Civilian; } public static void Wear(VisEquipment ve, Set s, bool bare) { if (Exists(s.Helmet)) { ve.SetHelmetItem(StringExtensionMethods.GetStableHashCode(s.Helmet)); } else if (bare) { ve.SetHelmetItem(0); } if (Exists(s.Chest)) { ve.SetChestItem(StringExtensionMethods.GetStableHashCode(s.Chest)); } if (Exists(s.Legs)) { ve.SetLegItem(StringExtensionMethods.GetStableHashCode(s.Legs)); } if (Exists(s.Cape)) { ve.SetShoulderItem(StringExtensionMethods.GetStableHashCode(s.Cape), 0, 1); } else if (bare) { ve.SetShoulderItem(0, 0, 1); } } } public static class Armory { public const string Mark = "allfather_divine"; public const string Plain = "allfather_plain"; private static bool _busy; private static float _next; public static bool IsDivine(ItemData item) { return item != null && item.m_customData != null && item.m_customData.ContainsKey("allfather_divine"); } public static bool IsPlain(ItemData item) { return item != null && item.m_customData != null && item.m_customData.ContainsKey("allfather_plain"); } public static void Summon(Player p, Slot slot) { if (!_busy && !((Object)(object)p == (Object)null)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(SummonRun(p, slot)); } } private static IEnumerator SummonRun(Player p, Slot slot) { _busy = true; bool quiet = Plugin.Disguised; FlightPose.ReachUp(0.4f); ParticleSystem motes = Ascension.Particles(Vector3.zero, null, 0f, 0.5f, 2f, -1.2f, 0.35f, 0.1f, (Color)((!quiet) ? Fx.SpectralColor : new Color(0.8f, 0.75f, 0.6f)), Color.white, 0f); float t = 0f; float rise = 0.24000001f; while (t < rise && (Object)(object)p != (Object)null) { t += Time.deltaTime; ((Component)motes).transform.position = Combat.Hand(p) + Vector3.up * 0.2f; motes.Emit(quiet ? 1 : 3); yield return null; } Object.Destroy((Object)(object)((Component)motes).gameObject, 0.8f); if ((Object)(object)p == (Object)null || ((Character)p).IsDead()) { _busy = false; yield break; } try { RemoveAll(p); } catch { } Grant(p, slot, quiet); yield return (object)new WaitForSeconds(0.15f); _busy = false; } private static void Grant(Player p, Slot slot, bool quiet) { //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: 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_022d: 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_023e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_0274: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = ((Humanoid)p).GetInventory(); if (inventory == null) { return; } GameObject val = ((!((Object)(object)ObjectDB.instance != (Object)null)) ? null : ObjectDB.instance.GetItemPrefab(slot.Weapon)); if ((Object)(object)val == (Object)null) { ((Character)p).Message((MessageType)2, slot.Weapon + " not found", 0, (Sprite)null, false); return; } int num = Mathf.Max(1, val.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality); ItemData val2 = inventory.AddItem(slot.Weapon, 1, num, 0, 0L, "Odin", false, false); if (val2 == null) { ((Character)p).Message((MessageType)2, "Your hands are full (inventory is full)", 0, (Sprite)null, false); return; } if (val2.m_customData == null) { val2.m_customData = new Dictionary<string, string>(); } val2.m_customData["allfather_divine"] = "1"; if (quiet) { val2.m_customData["allfather_plain"] = "1"; } val2.m_durability = val2.GetMaxDurability(); ((Humanoid)p).EquipItem(val2, true); if (slot.Extra != null) { string[] extra = slot.Extra; foreach (string text in extra) { string[] array = text.Split(':'); int num2 = ((array.Length <= 1) ? 1 : int.Parse(array[1])); if (num2 <= 1) { Give(p, inventory, array[0], "ShieldBlackmetal"); } else { Ammo(inventory, array[0], num2); } } } Vector3 val3 = Combat.Hand(p); if (quiet) { ParticleSystem val4 = Ascension.Particles(val3, null, 0f, 0.3f, 0f, 0.8f, 0.4f, 0.1f, new Color(0.9f, 0.85f, 0.7f), Color.white, -0.2f); val4.Emit(30); Object.Destroy((Object)(object)((Component)val4).gameObject, 1f); ((Character)p).Message((MessageType)1, slot.Name, 0, (Sprite)null, false); } else { Fx.Bolt(val3 + Vector3.up * 60f, val3, 0.7f, Fx.BoltColor, 0.3f); Fx.Flash(val3, Fx.SpectralColor, 8f, 12f, 0.4f); Fx.SpawnNamed(Fx.RedBurstFx ?? Fx.LightningHitFx, val3); Fx.SpawnNamed(Fx.ThunderSfx, val3); ((Character)p).Message((MessageType)1, slot.Name + " answers your call", 0, (Sprite)null, false); } } private static void Give(Player p, Inventory inv, params string[] names) { foreach (string text in names) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(text); if ((Object)(object)itemPrefab == (Object)null) { continue; } int num = Mathf.Max(1, itemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality); ItemData val = inv.AddItem(text, 1, num, 0, 0L, "Odin", false, false); if (val != null) { if (val.m_customData == null) { val.m_customData = new Dictionary<string, string>(); } val.m_customData["allfather_divine"] = "1"; if (Plugin.Disguised) { val.m_customData["allfather_plain"] = "1"; } ((Humanoid)p).EquipItem(val, true); } break; } } private static void Ammo(Inventory inv, string name, int count) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(name); if ((Object)(object)itemPrefab == (Object)null) { return; } int num = Mathf.Max(1, itemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxStackSize); while (count > 0) { ItemData val = inv.AddItem(name, Mathf.Min(num, count), 1, 0, 0L, "Odin", false, false); if (val == null) { break; } if (val.m_customData == null) { val.m_customData = new Dictionary<string, string>(); } val.m_customData["allfather_divine"] = "1"; count -= Mathf.Min(num, count); } } public static void RemoveAll(Player p) { Inventory val = ((!((Object)(object)p != (Object)null)) ? null : ((Humanoid)p).GetInventory()); if (val == null) { return; } if (val.GetAllItems().Any(IsDivine)) { Vanish(p); } foreach (ItemData item in val.GetAllItems().ToList()) { if (IsDivine(item)) { if (((Humanoid)p).IsItemEquiped(item)) { ((Humanoid)p).UnequipItem(item, false); } val.RemoveItem(item); } } } public static void Tick(Player p) { if (Time.time < _next) { return; } _next = Time.time + 1f; Inventory inventory = ((Humanoid)p).GetInventory(); if (inventory == null) { return; } foreach (ItemData allItem in inventory.GetAllItems()) { if (IsDivine(allItem)) { allItem.m_durability = allItem.GetMaxDurability(); } } } private static void Vanish(Player p) { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0053: 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) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = Combat.Hand(p); bool disguised = Plugin.Disguised; Color val = (Color)((!disguised) ? Fx.SpectralColor : new Color(0.85f, 0.8f, 0.65f)); ParticleSystem val2 = Ascension.Particles(pos, null, 0f, 0.5f, 1.5f, 0.6f, 1.1f, 0.14f, val, Color.white, -0.5f); val2.Emit((!disguised) ? 160 : 40); Object.Destroy((Object)(object)((Component)val2).gameObject, 2f); if (!disguised) { Fx.Flash(pos, val, 4f, 6f, 0.35f); Fx.SpawnNamed(Fx.PoofFx, pos); } } } public static class Ascension { private static readonly MethodInfo SetupVis = AccessTools.Method(typeof(Humanoid), "SetupVisEquipment", (Type[])null, (Type[])null); private static readonly FieldInfo F_Vis = AccessTools.Field(typeof(Humanoid), "m_visEquipment"); public static bool Hidden; private static readonly List<Renderer> _hidden = new List<Renderer>(); private static GameObject _aura; private static Material _overlay; private static Texture2D _soft; private static readonly List<GameObject> _eyes = new List<GameObject>(); private static Mesh _ball; public static GameObject Aura => _aura; public static Material Overlay { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_003f: 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) if ((Object)(object)_overlay == (Object)null) { _overlay = new Material(Fx.AddShader); Color val = default(Color); ((Color)(ref val))..ctor(0.12f, 0.3f, 0.6f, 1f); _overlay.color = val; if (_overlay.HasProperty("_TintColor")) { _overlay.SetColor("_TintColor", val); } ((Object)_overlay).name = "Allfather_ethereal"; } return _overlay; } } public static Material SoftMat(Color c) { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00ea: 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) //IL_001d: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_soft == (Object)null) { int num = 32; Texture2D val = new Texture2D(num, num, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; _soft = val; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j + 0.5f) / (float)num * 2f - 1f; float num3 = ((float)i + 0.5f) / (float)num * 2f - 1f; float num4 = Mathf.Clamp01(1f - Mathf.Sqrt(num2 * num2 + num3 * num3)); num4 *= num4; _soft.SetPixel(j, i, new Color(1f, 1f, 1f, num4)); } } _soft.Apply(); } Material val2 = new Material(Fx.AddShader); val2.mainTexture = (Texture)(object)_soft; val2.color = c; if (val2.HasProperty("_TintColor")) { val2.SetColor("_TintColor", c); } return val2; } public static ParticleSystem Particles(Vector3 pos, Transform parent, float rate, float radius, float orbital, float radial, float life, float size, Color a, Color b, float gravity) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003b: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a5: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_014c: 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) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_022d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Allfather_particles"); if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, false); val.transform.localPosition = pos; } else { val.transform.position = pos; } ParticleSystem val2 = val.AddComponent<ParticleSystem>(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(life * 0.6f, life); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.2f, 1.5f); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.4f, size); ((MainModule)(ref main)).startColor = new MinMaxGradient(a, b); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = ((!Plugin.LightEffects.Value) ? 1200 : 400); if (Plugin.LightEffects.Value) { rate *= 0.4f; } ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(gravity); EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(rate); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = radius; VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalY = MinMaxCurve.op_Implicit(orbital); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).radial = MinMaxCurve.op_Implicit(radial); ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.15f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>(); ((Renderer)component).material = SoftMat(Color.white); ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; val2.Play(); return val2; } public static void Begin(Player p) { if (Plugin.AscensionEffect.Value) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(Sequence(p)); } else { Reveal(p); } } private static void Hide(Player p) { _hidden.Clear(); GameObject visual = ((Character)p).GetVisual(); if ((Object)(object)visual == (Object)null) { return; } Renderer[] componentsInChildren = visual.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (val.enabled) { val.enabled = false; _hidden.Add(val); } } Hidden = true; } private static void Unhide() { foreach (Renderer item in _hidden) { if ((Object)(object)item != (Object)null) { item.enabled = true; } } _hidden.Clear(); Hidden = false; } private static IEnumerator Sequence(Player p) { Vector3 pos = ((Component)p).transform.position; Fx.SpawnNamed(Fx.OdinFx, pos + Vector3.up); Hide(p); ParticleSystem storm = Particles(((Character)p).GetCenterPoint(), null, 600f, 1.4f, 5f, -0.6f, 1.2f, 0.35f, new Color(0.6f, 0.85f, 1f), new Color(1f, 1f, 1f), -0.4f); ParticleSystem column = Particles(pos + Vector3.up * 0.1f, null, 250f, 0.6f, 2f, 0.2f, 2f, 0.25f, new Color(0.4f, 0.6f, 1f), new Color(0.9f, 0.95f, 1f), -2.5f); Fx.Flash(pos + Vector3.up, Fx.BoltColor, 6f, 20f, 1f); float t = 0f; Vector3 val = default(Vector3); while (t < 0.7f && (Object)(object)p != (Object)null) { Vector3 c = ((Character)p).GetCenterPoint(); ((Vector3)(ref val))..ctor(Random.Range(-1f, 1f), Random.Range(0.4f, 1f), Random.Range(-1f, 1f)); Vector3 from = c + ((Vector3)(ref val)).normalized * Random.Range(10f, 25f); Fx.Bolt(from, c, 0.25f + t * 0.15f, Fx.BoltColor, 0.15f); if (Random.value < 0.35f) { Fx.SpawnNamed(Fx.ThunderSfx, c); } ((Component)storm).transform.position = c; float wait = Mathf.Lerp(0.07f, 0.03f, t / 0.7f); t += wait; yield return (object)new WaitForSeconds(wait); } if ((Object)(object)p == (Object)null) { yield break; } Vector3 at = ((Component)p).transform.position; Fx.Bolt(at + Vector3.up * 90f, at, 1.6f, Color.white, 0.4f); Fx.Bolt(at + Vector3.up * 90f, at, 1f, Fx.BoltColor, 0.5f); Fx.Flash(at + Vector3.up, Color.white, 14f, 40f, 0.8f); Fx.Ring(at, 18f, Fx.BoltColor, 0.7f, 1.2f); Fx.SpawnNamed(Fx.StrikeFx ?? Fx.LightningHitFx, at); Fx.SpawnNamed(Fx.OdinFx, at + Vector3.up); Fx.SpawnNamed(Fx.ThunderSfx, at); Fx.Shake(at, 5f); List<Character> list = new List<Character>(); Character.GetCharactersInRange(at, 12f, list); foreach (Character item in list) { if (Combat.IsFoe(item, p)) { Vector3 val2 = ((Component)item).transform.position - at; val2.y = 0f; HitData val3 = Combat.Hit(p, item.GetCenterPoint(), ((Vector3)(ref val2)).normalized + Vector3.up); val3.m_damage.m_lightning = 150f; val3.m_pushForce = 150f; val3.m_staggerMultiplier = 5f; Combat.Damage(item, val3); } } StopParticles(storm); StopParticles(column); Reveal(p); Unhide(); } private static void StopParticles(ParticleSystem ps) { if (!((Object)(object)ps == (Object)null)) { ps.Stop(true, (ParticleSystemStopBehavior)1); Object.Destroy((Object)(object)((Component)ps).gameObject, 3f); } } private static void Reveal(Player p) { Refresh(p); Eyes(p, on: true); Recolor(p); } public static void Recolor(Player p) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_007e: 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) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null) && Plugin.Mantle && !Hidden) { if ((Object)(object)_aura != (Object)null) { Object.Destroy((Object)(object)_aura); } Color glow = ArmorSets.Current.Glow; ParticleSystem val = Particles(new Vector3(0f, 1.2f, 0f), ((Component)p).transform, 30f, 0.75f, 0.8f, 0.05f, 1.6f, 0.14f, glow, Color.Lerp(glow, Color.white, 0.8f), -0.2f); _aura = ((Component)val).gameObject; Light val2 = _aura.AddComponent<Light>(); val2.color = Color.Lerp(glow, Color.white, 0.3f); val2.intensity = 1.6f; val2.range = 6f; val2.shadows = (LightShadows)0; } } public static void Eyes(Player p, bool on) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_026f: 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_0285: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Expected O, but got Unknown //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject eye in _eyes) { if ((Object)(object)eye != (Object)null) { Object.Destroy((Object)(object)eye); } } _eyes.Clear(); if (!on || (Object)(object)p == (Object)null) { return; } if ((Object)(object)_ball == (Object)null) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); _ball = val.GetComponent<MeshFilter>().sharedMesh; Object.Destroy((Object)(object)val); } CharacterAnimEvent componentInChildren = ((Component)p).GetComponentInChildren<CharacterAnimEvent>(); List<Transform> list = new List<Transform>(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.m_eyes != null) { list.AddRange(componentInChildren.m_eyes.Where((Transform t) => (Object)(object)t != (Object)null)); } if (list.Count == 0 && (Object)(object)((Character)p).GetVisual() != (Object)null) { list.AddRange(from t in ((Character)p).GetVisual().GetComponentsInChildren<Transform>() where ((Object)t).name.ToLower().Contains("eye") select t); } Material sharedMaterial = Fx.Mat(new Color(1f, 1f, 1f, 1f)); foreach (Transform item in list.Take(2)) { GameObject val2 = new GameObject("Allfather_eye"); val2.transform.SetParent(item, false); val2.transform.position = item.position + ((Component)p).transform.forward * 0.035f; val2.transform.localScale = Vector3.one * (0.028f / Mathf.Max(0.01f, item.lossyScale.x)); val2.AddComponent<MeshFilter>().sharedMesh = _ball; MeshRenderer val3 = val2.AddComponent<MeshRenderer>(); ((Renderer)val3).sharedMaterial = sharedMaterial; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ParticleSystem val4 = Particles(Vector3.zero, val2.transform, 6f, 0.01f, 0f, 0f, 0.4f, 0.08f, Color.white, new Color(0.8f, 0.9f, 1f), 0f); MainModule main = val4.main; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); _eyes.Add(val2); } if (list.Count > 0) { GameObject val5 = new GameObject("Allfather_eyelight"); val5.transform.SetParent(list[0], false); val5.transform.position = list[0].position + ((Component)p).transform.forward * 0.15f; Light val6 = val5.AddComponent<Light>(); val6.color = Color.white; val6.intensity = 0.8f; val6.range = 1.5f; val6.shadows = (LightShadows)0; _eyes.Add(val5); } } public static void SetEyesVisible(bool v) { foreach (GameObject eye in _eyes) { if ((Object)(object)eye != (Object)null && eye.activeSelf != v) { eye.SetActive(v); } } } public static void End(Player p) { Eyes(p, on: false); Unhide(); if ((Object)(object)_aura != (Object)null) { Object.Destroy((Object)(object)_aura); } _aura = null; Refresh(p); StripOverlay(p); } public static void Refresh(Player p) { if ((Object)(object)p == (Object)null || SetupVis == null || F_Vis == null) { return; } try { SetupVis.Invoke(p, new object[2] { F_Vis.GetValue(p), false }); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Armor: " + ex.Message)); } } public static void LateTick(Player p) { if ((Object)(object)p == (Object)null || !Plugin.Mantle || !Hidden) { return; } Renderer[] componentsInChildren = ((Character)p).GetVisual().GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (val.enabled) { val.enabled = false; _hidden.Add(val); } } } private static void StripOverlay(Player p) { GameObject val = ((!((Object)(object)p != (Object)null)) ? null : ((Character)p).GetVisual()); if ((Object)(object)val == (Object)null) { return; } Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren) { Material[] sharedMaterials = val2.sharedMaterials; if (Array.IndexOf(sharedMaterials, _overlay) < 0) { continue; } List<Material> list = new List<Material>(); Material[] array = sharedMaterials; foreach (Material val3 in array) { if ((Object)(object)val3 != (Object)(object)_overlay) { list.Add(val3); } } val2.sharedMaterials = list.ToArray(); } } } public static class Beast { public class Atk { public string Anim; public DamageTypes Dmg; public float Range = 2f; public float Angle = 90f; public float HitTime = 0.4f; public float Cooldown = 0.9f; public float Total; public GameObject Projectile; public float ProjVel = 30f; public int Projectiles = 1; public ItemData Item; public bool Area; public readonly List<EffectList> Start = new List<EffectList>(); public readonly List<EffectList> Trigger = new List<EffectList>(); public readonly List<EffectList> Hit = new List<EffectList>(); } private static readonly List<Atk> _melee = new List<Atk>(); private static readonly List<Atk> _special = new List<Atk>(); private static EffectList _alert; private static EffectList _idle; private static EffectList _hurt; private static EffectList _jump; private static List<GameObject[]> _stepRun = new List<GameObject[]>(); private static List<GameObject[]> _stepWalk = new List<GameObject[]>(); private static float _busyUntil; private static float _nextIdle; private static float _nextStep; private static float _nextHurt; private static int _cycle; private static Animator _anim; public static bool HasAttacks => _melee.Count + _special.Count > 0; public static bool Busy => Time.time < _busyUntil; public static void Learn(GameObject pf, Animator anim, HashSet<string> parms, List<string> triggers, List<GameObject> loadout) { //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Invalid comparison between Unknown and I4 //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Invalid comparison between Unknown and I4 _melee.Clear(); _special.Clear(); _stepRun = new List<GameObject[]>(); _stepWalk = new List<GameObject[]>(); _anim = anim; _cycle = 0; _busyUntil = 0f; BaseAI component = pf.GetComponent<BaseAI>(); _alert = ((!((Object)(object)component != (Object)null)) ? null : component.m_alertedEffects); _idle = ((!((Object)(object)component != (Object)null)) ? null : component.m_idleSound); Character component2 = pf.GetComponent<Character>(); _hurt = ((!((Object)(object)component2 != (Object)null)) ? null : component2.m_hitEffects); _jump = ((!((Object)(object)component2 != (Object)null)) ? null : component2.m_jumpEffects); _nextIdle = Time.time + Random.Range(5f, 10f); FootStep componentInChildren = pf.GetComponentInChildren<FootStep>(true); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.m_effects != null) { foreach (StepEffect effect in componentInChildren.m_effects) { if (effect != null && effect.m_effectPrefabs != null && effect.m_effectPrefabs.Length != 0 && ((effect.m_material & 0xC1) != 0 || (int)effect.m_material == 16383)) { if ((effect.m_motionType & 3) != 0) { _stepRun.Add(effect.m_effectPrefabs); } if ((effect.m_motionType & 0x40) != 0) { _stepWalk.Add(effect.m_effectPrefabs); } } } } if (_stepWalk.Count == 0) { _stepWalk = _stepRun; } if (_stepRun.Count == 0) { _stepRun = _stepWalk; } AnimationClip[] clips = (AnimationClip[])((!((Object)(object)anim != (Object)null) || !((Object)(object)anim.runtimeAnimatorController != (Object)null)) ? ((Array)new AnimationClip[0]) : ((Array)anim.runtimeAnimatorController.animationClips)); List<GameObject> list = loadout ?? new List<GameObject>(); HashSet<string> hashSet = new HashSet<string>(); foreach (GameObject item2 in list) { ItemDrop val = ((!((Object)(object)item2 != (Object)null)) ? null : item2.GetComponent<ItemDrop>()); if ((Object)(object)val == (Object)null) { continue; } SharedData shared = val.m_itemData.m_shared; Attack[] array = (Attack[])(object)new Attack[2] { shared.m_attack, shared.m_secondaryAttack }; foreach (Attack val2 in array) { if (val2 == null || string.IsNullOrEmpty(val2.m_attackAnimation) || !parms.Contains(val2.m_attackAnimation)) { continue; } string item = val2.m_attackAnimation + "|" + ((!((Object)(object)val2.m_attackProjectile != (Object)null)) ? string.Empty : ((Object)val2.m_attackProjectile).name); if (hashSet.Add(item)) { Atk atk = new Atk(); atk.Anim = val2.m_attackAnimation; atk.Dmg = shared.m_damages; atk.Total = ((DamageTypes)(ref shared.m_damages)).GetTotalDamage(); atk.Range = ((!(val2.m_attackRange > 0.1f)) ? 2f : val2.m_attackRange); atk.Angle = ((!(val2.m_attackAngle > 1f)) ? 90f : val2.m_attackAngle); atk.Projectile = val2.m_attackProjectile; atk.ProjVel = Mathf.Max(15f, val2.m_projectileVel); atk.Projectiles = Mathf.Clamp(val2.m_projectiles, 1, 8); atk.Area = (int)val2.m_attackType == 4; atk.Item = val.m_itemData.Clone(); Atk atk2 = atk; atk2.Item.m_dropPrefab = item2; if (val2.m_startEffect != null) { atk2.Start.Add(val2.m_startEffect); } if (shared.m_startEffect != null) { atk2.Start.Add(shared.m_startEffect); } if (val2.m_triggerEffect != null) { atk2.Trigger.Add(val2.m_triggerEffect); } if (shared.m_triggerEffect != null) { atk2.Trigger.Add(shared.m_triggerEffect); } if (shared.m_hitEffect != null) { atk2.Hit.Add(shared.m_hitEffect); } Timing(atk2, clips); if ((Object)(object)atk2.Projectile != (Object)null || atk2.Area) { _special.Add(atk2); } else { _melee.Add(atk2); } } } } if (_melee.Count + _special.Count == 0) { foreach (string trigger in triggers) { string text = trigger.ToLower(); if (text.Contains("attack") || text.Contains("bite") || text.Contains("claw") || text.Contains("slam") || text.Contains("punch") || text.Contains("stomp") || text.Contains("swing") || text.Contains("smash")) { Atk atk = new Atk(); atk.Anim = trigger; atk.Total = 50f; Atk atk3 = atk; atk3.Dmg.m_slash = 30f; atk3.Dmg.m_blunt = 20f; Timing(atk3, clips); _melee.Add(atk3); } } } if (_special.Count == 0 && _melee.Count > 1) { _special.Add(_melee.OrderByDescending((Atk m) => m.Total).First()); } if (_melee.Count == 0 && _special.Count > 0) { _melee.AddRange(_special); } Plugin.Log.LogInfo((object)("Beast " + ((Object)pf).name + ": attacks=" + string.Join(", ", _melee.Select((Atk m) => m.Anim + "@" + m.HitTime.ToString("0.00") + "s").ToArray()) + " special=" + string.Join(", ", _special.Select((Atk m) => m.Anim + (((Object)(object)m.Projectile != (Object)null) ? ("(" + ((Object)m.Projectile).name + ")") : ((!m.Area) ? string.Empty : "(area)"))).ToArray()) + " steps=" + _stepRun.Count + " sounds=" + (_alert != null && _alert.HasEffects()) + "/" + (_idle != null && _idle.HasEffects()) + "/" + (_hurt != null && _hurt.HasEffects()))); } private static void Timing(Atk k, AnimationClip[] clips) { string a = k.Anim.ToLower().Replace("_", string.Empty); AnimationClip val = ((IEnumerable<AnimationClip>)clips).FirstOrDefault((Func<AnimationClip, bool>)((AnimationClip c) => (Object)(object)c != (Object)null && ((Object)c).name.ToLower().Replace("_", string.Empty).EndsWith(a))) ?? ((IEnumerable<AnimationClip>)clips).FirstOrDefault((Func<AnimationClip, bool>)((AnimationClip c) => (Object)(object)c != (Object)null && ((Object)c).name.ToLower().Replace("_", string.Empty).Contains(a))); if (!((Object)(object)val == (Object)null)) { AnimationEvent val2 = ((IEnumerable<AnimationEvent>)val.events).FirstOrDefault((Func<AnimationEvent, bool>)((AnimationEvent e) => e.functionName == "OnAttackTrigger" || e.functionName == "Hit")); if (val2 != null) { k.HitTime = Mathf.Clamp(val2.time, 0.1f, 2f); } k.Cooldown = Mathf.Clamp(val.length * 0.85f, 0.35f, 3f); } } private static void Play(EffectList fx, Vector3 at, Transform parent) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_003d: Unknown result type (might be due to invalid IL or missing references) if (fx == null || !fx.HasEffects()) { return; } ZNetView.m_forceDisableInit = true; try { fx.Create(at, (!((Object)(object)parent != (Object)null)) ? Quaternion.identity : parent.rotation, parent, 1f, -1, ZDOID.None); } catch { } finally { ZNetView.m_forceDisableInit = false; } } private static void PlayAll(List<EffectList> list, Vector3 at, Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) foreach (EffectList item in list) { Play(item, at, parent); } } public static void Roar(Player p) { //IL_0017: 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) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p != (Object)null) { Play(_alert, ((Component)p).transform.position + Vector3.up, ((Component)p).transform); } } public static void Hurt(Player p) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p != (Object)null && Time.time > _nextHurt) { _nextHurt = Time.time + 0.5f; Play(_hurt, ((Character)p).GetCenterPoint(), null); } } public static void Jumped(Player p) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p != (Object)null) { Play(_jump, ((Component)p).transform.position, null); } } public static void Ambient(Player p, Vector3 vel, bool ground, float scale) { //IL_003f: 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_0049: 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) if (Hide.Invisible) { return; } if (Time.time > _nextIdle) { _nextIdle = Time.time + Random.Range(8f, 18f); Play(_idle, ((Component)p).transform.position + Vector3.up, ((Component)p).transform); } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(vel.x, vel.z); float magnitude = ((Vector2)(ref val)).magnitude; if (!ground || magnitude < 0.8f || Time.time < _nextStep) { return; } List<GameObject[]> list = ((!(magnitude > 5f)) ? _stepWalk : _stepRun); if (list.Count != 0) { float num = Mathf.Clamp(1.1f * Mathf.Max(0.6f, scale * 1.2f), 0.6f, 4f); _nextStep = Time.time + Mathf.Clamp(num / magnitude, 0.18f, 1.2f); GameObject[] array = list[Random.Range(0, list.Count)]; GameObject[] array2 = array; foreach (GameObject prefab in array2) { Fx.SpawnBrief(prefab, ((Component)p).transform.position); } } } public static void Attack(Player p, bool special, FormDef form) { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p == (Object)null || Busy) { return; } List<Atk> list = ((!special || _special.Count <= 0) ? _melee : _special); if (list.Count != 0) { Atk atk = ((list != _melee) ? list[Random.Range(0, list.Count)] : list[_cycle++ % list.Count]); float num = Mathf.Max(1f, Plugin.AttackSpeed.Value * 0.6f); _busyUntil = Time.time + atk.Cooldown / num; if ((Object)(object)_anim != (Object)null && !string.IsNullOrEmpty(atk.Anim)) { _anim.speed = num; _anim.SetTrigger(atk.Anim); } PlayAll(atk.Start, ((Component)p).transform.position + Vector3.up, ((Component)p).transform); ((MonoBehaviour)Plugin.Instance).StartCoroutine(Land(p, atk, special, form, atk.HitTime / num)); } } private static IEnumerator Land(Player p, Atk k, bool special, FormDef form, float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)p == (Object)null || !Shapeshift.Active) { yield break; } if ((Object)(object)_anim != (Object)null) { _anim.speed = 1f; } float sc = Mathf.Max(0.4f, form.Scale); Vector3 fwd = ((Component)p).transform.forward; PlayAll(k.Trigger, ((Component)p).transform.position + fwd * sc + Vector3.up, null); float mult = Mathf.Max(0.1f, Plugin.BeastDamage.Value) * ((!special) ? 1f : 1.5f); if ((Object)(object)k.Projectile != (Object)null) { Combat.Aim(p, 80f, out var point, out var _); Vector3 val = ((Character)p).GetCenterPoint() + fwd * (0.8f + sc * 0.6f) + Vector3.up * 0.4f * sc; for (int i = 0; i < k.Projectiles; i++) { Vector3 val2 = point - val; Vector3 val3 = ((Vector3)(ref val2)).normalized; if (k.Projectiles > 1) { val3 = Quaternion.Euler(Random.Range(-4f, 4f), Random.Range(-8f, 8f), 0f) * val3; } HitData val4 = Combat.Hit(p, val, val3); val4.m_damage = k.Dmg; ((DamageTypes)(ref val4.m_damage)).Modify(mult); if (OdinCall.Blessed) { val4.ApplyModifier(2f); } val4.ApplyModifier(Mathf.Max(0f, Plugin.PowerDamage.Value)); GameObject val5 = Object.Instantiate<GameObject>(k.Projectile, val, Quaternion.LookRotation(val3)); IProjectile component = val5.GetComponent<IProjectile>(); if (component != null) { component.Setup((Character)(object)p, val3 * k.ProjVel, 10f, val4, k.Item, (ItemData)null); } } yield break; } float reach = k.Range * sc + 1.2f; float arc = ((!k.Area && !special) ? Mathf.Max(70f, k.Angle) : 360f); Vector3 origin = ((Component)p).transform.position + Vector3.up * Mathf.Min(1.2f, 0.6f * sc + 0.4f); List<Character> near = new List<Character>(); Character.GetCharactersInRange(origin, reach + 4f, near); bool landed = false; foreach (Character item in near) { if (!Combat.IsFoe(item, p)) { continue; } Vector3 val6 = ((Component)item).transform.position - ((Component)p).transform.position; val6.y = 0f; float num = Mathf.Max(0f, ((Vector3)(ref val6)).magnitude - item.GetRadius()); if (!(num > reach) && (!(arc < 360f) || !(((Vector3)(ref val6)).sqrMagnitude > 0.01f) || !(Vector3.Angle(fwd, val6) > arc * 0.5f))) { HitData val7 = Combat.Hit(p, item.GetCenterPoint(), (!(((Vector3)(ref val6)).sqrMagnitude > 0.01f)) ? fwd : val6); val7.m_damage = k.Dmg; ((DamageTypes)(ref val7.m_damage)).Modify(mult); val7.m_pushForce = 40f * ((!special) ? 1f : 2f); val7.m_staggerMultiplier = ((!special) ? 1.5f : 4f); val7.m_skill = (SkillType)11; val7.m_blockable = true; Combat.Damage(item, val7); if (!landed) { landed = true; PlayAll(k.Hit, item.GetCenterPoint(), null); } } } if (special && (k.Area || form.Damage >= 3f)) { Fx.SpawnNamed(Fx.DustFx, ((Component)p).transform.position + fwd * sc); Fx.Shake(((Component)p).transform.position, 1.5f + sc); Fx.Ring(((Component)p).transform.position, reach, new Color(0.6f, 0.5f, 0.35f), 0.4f, 0.4f); } Combat.SmashObjects(p, ((Component)p).transform.position + fwd * reach * 0.6f + Vector3.up, Mathf.Max(1f, reach * 0.5f), k.Total * mult * 0.5f); } } public static class Blink { private static readonly FieldInfo F_Body = AccessTools.Field(typeof(Character), "m_body"); private static float _invincibleUntil; private static float _next; private static readonly Color Light = new Color(0.65f, 0.85f, 1f, 1f); public static bool Invincible => Time.time < _invincibleUntil; public static bool Use(Player p, Vector3 dodgeDir) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_006f: 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_009b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_028f: 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_0156: 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) if (Time.time < _next) { return true; } _next = Time.time + 0.25f; Vector3 val = dodgeDir; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = -((Component)p).transform.forward; val.y = 0f; } ((Vector3)(ref val)).Normalize(); Vector3 position = ((Component)p).transform.position; Vector3 val2 = position + Vector3.up * 1f; float num = Mathf.Max(2f, Plugin.BlinkDistance.Value); RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(val2, 0.4f, val, ref val3, num, Combat.SolidMask, (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val3)).distance - 0.5f); } if (num < 0.8f) { return false; } Vector3 val4 = position + val * num; if (Physics.Raycast(val4 + Vector3.up * 2.5f, Vector3.down, ref val3, 8f, Combat.SolidMask, (QueryTriggerInteraction)1)) { val4.y = ((RaycastHit)(ref val3)).point.y + 0.05f; } try { if (p.m_dodgeEffects != null) { ZNetView.m_forceDisableInit = true; try { p.m_dodgeEffects.Create(position, ((Component)p).transform.rotation, (Transform)null, 1f, -1, ZDOID.None); } finally { ZNetView.m_forceDisableInit = false; } } } catch { } Fx.SpawnNamed(Fx.LightningHitFx, position + Vector3.up); Burst(position + Vector3.up, 160, 2.5f); Fx.Bolt(val2, val4 + Vector3.up, 0.12f, Light, 0.12f); Fx.Flash(position + Vector3.up, Light, 3f, 8f, 0.25f); Fx.SpawnNamed(Fx.TeleportFx ?? Fx.PoofFx, position + Vector3.up); object? value = F_Body.GetValue(p); Rigidbody val5 = (Rigidbody)((value is Rigidbody) ? value : null); Vector3 val6 = ((!((Object)(object)val5 != (Object)null)) ? Vector3.zero : val5.linearVelocity); ((Component)p).transform.position = val4; if ((Object)(object)val5 != (Object)null) { val5.position = val4; val5.linearVelocity = new Vector3(val6.x, Mathf.Max(0f, val6.y), val6.z); } _invincibleUntil = Time.time + 0.35f; Burst(val4 + Vector3.up, 120, -2f); Fx.Flash(val4 + Vector3.up, Light, 3f, 8f, 0.25f); return true; } private static void Burst(Vector3 at, int count, float radial) { //IL_0000: 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) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) ParticleSystem val = Ascension.Particles(at, null, 0f, 0.6f, 0f, radial, 0.45f, 0.18f, Light, Color.white, -0.1f); ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).radius = ((!(radial < 0f)) ? 0.5f : 1.6f); val.Emit((!Plugin.LightEffects.Value) ? count : (count / 3)); Object.Destroy((Object)(object)((Component)val).gameObject, 1.2f); } } [HarmonyPatch(typeof(Player), "Dodge")] internal static class Patch_Blink { private static bool Prefix(Player __instance, Vector3 dodgeDir) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || !Plugin.Mantle || Plugin.InForm || Plugin.Flying || !Plugin.BlinkOn.Value) { return true; } if (((Character)__instance).IsEncumbered() || ((Character)__instance).InWater() || ((Character)__instance).IsAttached()) { return true; } try { return !Blink.Use(__instance, dodgeDir); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Blink: " + ex.Message)); return true; } } } public static class ChargedJump { public static bool Suppress; private static float _press = -1f; private static float _crackle; private static ParticleSystem _ps; private static Light _light; private const float TapTime = 0.25f; private const float FullTime = 1.5f; private static bool Moving() { return ZInput.GetButton("Forward") || ZInput.GetButton("Backward") || ZInput.GetButton("Left") || ZInput.GetButton("Right"); } public static void Tick(Player p, bool ui) { bool flag = Plugin.Mantle && !Plugin.InForm && !Plugin.Flying && !ui && !Plugin.WheelOpen && !((Character)p).IsAttached() && ((Character)p).IsOnGround() && !((Character)p).InWater(); Suppress = flag && !Moving(); if (!flag) { if (_press > 0f && !Plugin.Flying) { Release(p, charged: false); } return; } if (Suppress && ZInput.GetButtonDown("Jump")) { _press = Time.time; } if (_press < 0f) { return; } float num = Time.time - _press; if (Moving()) { Release(p, charged: false); } else if (ZInput.GetButton("Jump")) { if (num > 0.25f) { Charge(p, Mathf.Clamp01((num - 0.25f) / 1.25f)); } } else { Release(p, num > 0.25f); } } private static void Charge(Player p, float k) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0046: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_0269: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; bool active = Shapeshift.Active; bool flag = !active && FlightLook.Dark; if ((Object)(object)_ps == (Object)null && flag) { _ps = FlightLook.Mist(new Vector3(0f, 0.3f, 0f), ((Component)p).transform, 20f, 1.4f, -0.6f, 1.2f, 1.2f, -0.1f); } if ((Object)(object)_ps == (Object)null) { _ps = Ascension.Particles(new Vector3(0f, 0.3f, 0f), ((Component)p).transform, 140f, 1.6f, 4f, -2.5f, 0.6f, 0.25f, (Color)((!active) ? FlightLook.Soft : new Color(0.5f, 0.42f, 0.32f)), (Color)((!active) ? Color.white : new Color(0.7f, 0.62f, 0.5f)), -0.6f); if (!active) { _light = ((Component)_ps).gameObject.AddComponent<Light>(); _light.color = FlightLook.Main; _light.range = 6f; _light.shadows = (LightShadows)0; } } EmissionModule emission = _ps.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((!flag) ? (60f + 300f * k) : (15f + 45f * k)); if ((Object)(object)_light != (Object)null) { _light.intensity = 1f + 6f * k; } _crackle -= Time.deltaTime; if (!active && !flag && _crackle <= 0f) { _crackle = Mathf.Lerp(0.25f, 0.05f, k); Vector3 a = position + Vector3.up * 0.1f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(-1f, 1f), 0.05f, Random.Range(-1f, 1f)); Fx.Bolt(a, position + ((Vector3)(ref val)).normalized * (1f + 2f * k), 0.08f + 0.1f * k, FlightLook.Main, 0.12f); } if (k >= 1f && (Object)(object)_light != (Object)null) { _light.intensity = 7f + Mathf.Sin(Time.time * 30f) * 2f; } } private static void Clear() { if ((Object)(object)_ps != (Object)null) { ((Component)_ps).transform.SetParent((Transform)null); _ps.Stop(true, (ParticleSystemStopBehavior)1); Object.Destroy((Object)(object)((Component)_ps).gameObject, 1.5f); } _ps = null; _light = null; } private static void Release(Player p, bool charged) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) float num = ((!(_press > 0f)) ? 0f : (Time.time - _press)); _press = -1f; Clear(); if (!charged) { if (((Character)p).IsOnGround()) { ((Character)p).Jump(false); } return; } float num2 = Mathf.Clamp01((num - 0.25f) / 1.25f); float speed = Mathf.Lerp(18f, Plugin.ChargedJumpSpeed.Value, num2); Flight.Rocket(p, speed); Vector3 position = ((Component)p).transform.position; Fx.SpawnNamed(Fx.DustFx, position); if (Plugin.TakeoffBlast.Value) { Fx.Shake(position, 1.5f + 3f * num2); } if (Plugin.TakeoffBlast.Value) { if (!Shapeshift.Active && FlightLook.Dark) { FlightLook.MistBurst(position + Vector3.up * 0.2f, 5f + 8f * num2, 80 + (int)(80f * num2), 6f + 6f * num2); Fx.SpawnNamed(FlightLook.Sound, position); } else if (!Shapeshift.Active) { Fx.Ring(position, 4f + 10f * num2, FlightLook.Main, 0.5f, 0.8f + num2); Fx.Flash(position + Vector3.up, FlightLook.Main, 6f + 8f * num2, 20f, 0.4f); Fx.Bolt(position, position + Vector3.up * (20f + 40f * num2), 0.4f + 0.6f * num2, Color.white, 0.3f); Fx.SpawnNamed(FlightLook.Sound, position); } } if (Plugin.TakeoffBlast.Value) { ParticleSystem val = Ascension.Particles(position + Vector3.up * 0.2f, null, 0f, 0.8f, 0f, 10f, 0.8f, 0.6f, new Color(0.45f, 0.4f, 0.32f), new Color(0.7f, 0.65f, 0.55f), 0.5f); val.Emit(150 + (int)(250f * num2)); Object.Destroy((Object)(object)((Component)val).gameObject, 2f); } ((Character)p).Message((MessageType)1, "Flying: camera steers. Space up, Ctrl down, Shift for full speed. Double-tap Space to drop.", 0, (Sprite)null, false); } } public enum HealthMode { Mortal, CannotDie, Invulnerable } public static class ConfigMenu { public static bool Open; private static int _tab; private static Vector2 _scroll; private static readonly string[] Tabs = new string[6] { "Survival", "Movement", "Combat", "Powers", "Look", "World" }; private static GUIStyle _win; private static GUIStyle _tabOn; private static GUIStyle _tabOff; private static GUIStyle _label; private static GUIStyle _small; private static GUIStyle _head; private static GUIStyle _btn; private static GUIStyle _btnOn; private static GUIStyle _val; private static Texture2D _bg; private static Texture2D _row; private static Texture2D _gold; private static Texture2D _dark; private static float _scale = 1f; private static bool _confirmReset; private static GUIStyle _track; private static GUIStyle _thumb; private static GUIStyle _vbar; private static GUIStyle _vthumb; private static Texture2D _rule; private static GUIStyle _rowStyle; public static void Toggle() { Open = !Open; if (Open) { ((BaseUnityPlugin)Plugin.Instance).Config.SaveOnConfigSet = false; _confirmReset = false; } else { ((BaseUnityPlugin)Plugin.Instance).Config.Save(); ((BaseUnityPlugin)Plugin.Instance).Config.SaveOnConfigSet = true; } } private static Texture2D Tex(Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_000b: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, c); val.Apply(); ((Object)val).hideFlags = (HideFlags)61; return val; } private static GUIStyle Btn(Texture2D normal, Texture2D hover, Color text, Color hoverText, Font font, int size, int h) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0098: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) GUIStyle val = new GUIStyle(GUI.skin.button); val.fontSize = size; val.fixedHeight = h; val.border = new RectOffset(4, 4, 4, 4); val.padding = new RectOffset(10, 10, 4, 4); val.alignment = (TextAnchor)4; GUIStyle val2 = val; val2.normal.background = normal; val2.hover.background = hover; val2.active.background = hover; val2.focused.background = normal; val2.onNormal.background = normal; val2.onHover.background = hover; GUIStyleState normal2 = val2.normal; Color textColor = text; val2.focused.textColor = textColor; normal2.textColor = textColor; GUIStyleState hover2 = val2.hover; textColor = hoverText; val2.active.textColor = textColor; hover2.textColor = textColor; Theme.Apply(val2, font); return val2; } private static void Styles() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0298: 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_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Expected O, but got Unknown //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Expected O, but got Unknown //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_0403: 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) //IL_042d: Expected O, but got Unknown //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Expected O, but got Unknown //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected O, but got Unknown //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Expected O, but got Unknown //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Expected O, but got Unknown //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Expected O, but got Unknown //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Expected O, but got Unknown //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Expected O, but got Unknown //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) if (_win == null || !((Object)(object)_bg != (Object)null)) { _bg = Theme.Frame(Theme.Panel, Theme.Bronze, 3); _row = Theme.Frame(new Color(0.13f, 0.1f, 0.075f, 0.75f), new Color(0.3f, 0.22f, 0.13f, 0.9f), 1); _gold = Theme.Frame(new Color(0.38f, 0.24f, 0.09f, 1f), Theme.Orange, 2); _dark = Theme.Frame(new Color(0.16f, 0.125f, 0.09f, 1f), new Color(0.38f, 0.28f, 0.16f, 1f), 2); Texture2D hover = Theme.Frame(new Color(0.24f, 0.18f, 0.11f, 1f), Theme.Amber, 2); Color bronze = Theme.Bronze; float r = bronze.r; Color bronze2 = Theme.Bronze; float g = bronze2.g; Color bronze3 = Theme.Bronze; _rule = Theme.Rule(new Color(r, g, bronze3.b, 0.9f)); GUIStyle val = new GUIStyle(GUI.skin.window); val.padding = new RectOffset(22, 22, 56, 18); val.border = new RectOffset(6, 6, 6, 6); val.fontSize = 26; val.alignment = (TextAnchor)1; val.contentOffset = new Vector2(0f, 10f); _win = val; _win.normal.background = _bg; _win.onNormal.background = _bg; _win.focused.background = _bg; _win.onFocused.background = _bg; GUIStyleState normal = _win.normal; Color orange = Theme.Orange; _win.onFocused.textColor = orange; orange = orange; _win.focused.textColor = orange; orange = orange; _win.onNormal.textColor = orange; normal.textColor = orange; Theme.Apply(_win, Theme.Title); _tabOff = Btn(_dark, hover, Theme.Muted, Theme.Text, Theme.BodyBold, 16, 36); _tabOn = Btn(_gold, _gold, Theme.Orange, Theme.Orange, Theme.BodyBold, 16, 36); _btn = Btn(_dark, hover, Theme.Text, Theme.Orange, Theme.BodyBold, 14, 28); _btnOn = Btn(_gold, _gold, Theme.Orange, Theme.Orange, Theme.BodyBold, 14, 28); val = new GUIStyle(GUI.skin.label); val.fontSize = 16; val.wordWrap = false; val.alignment = (TextAnchor)3; _label = val; _label.normal.textColor = Theme.Text; Theme.Apply(_label, Theme.Body); val = new GUIStyle(GUI.skin.label); val.fontSize = 13; val.wordWrap = true; val.fontStyle = (FontStyle)2; _small = val; _small.normal.textColor = Theme.Muted; Theme.Apply(_small, Theme.Body); val = new GUIStyle(GUI.skin.label); val.fontSize = 22; val.alignment = (TextAnchor)6; _head = val; _head.normal.textColor = Theme.Orange; Theme.Apply(_head, Theme.Title); val = new GUIStyle(GUI.skin.label); val.fontSize = 15; val.alignment = (TextAnchor)5; _val = val; _val.normal.textColor = Theme.Orange; Theme.Apply(_val, Theme.BodyBold); val = new GUIStyle(GUI.skin.horizontalSlider); val.fixedHeight = 10f; val.margin = new RectOffset(4, 4, 11, 4); val.border = new RectOffset(3, 3, 3, 3); _track = val; _track.normal.background = Theme.Frame(new Color(0.05f, 0.04f, 0.03f, 1f), new Color(0.35f, 0.26f, 0.15f, 1f), 1); val = new GUIStyle(GUI.skin.horizontalSliderThumb); val.fixedHeight = 20f; val.fixedWidth = 14f; val.margin = new RectOffset(0, 0, -5, 0); val.border = new RectOffset(3, 3, 3, 3); _thumb = val; GUIStyleState normal2 = _thumb.normal; Texture2D val2 = Theme.Frame(Theme.Amber, new Color(0.35f, 0.2f, 0.06f, 1f), 2); _thumb.active.background = val2; val2 = val2; _thumb.hover.background = val2; normal2.background = val2; val = new GUIStyle(GUI.skin.verticalScrollbar); val.fixedWidth = 10f; val.border = new RectOffset(2, 2, 2, 2); _vbar = val; _vbar.normal.background = Theme.Solid(new Color(0.05f, 0.04f, 0.03f, 0.8f)); val = new GUIStyle(GUI.skin.verticalScrollbarThumb); val.fixedWidth = 10f; val.border = new RectOffset(2, 2, 2, 2); _vthumb = val; GUIStyleState normal3 = _vthumb.normal; val2 = Theme.Frame(new Color(0.45f, 0.32f, 0.17f, 1f), Theme.Bronze, 1); _vthumb.active.background = val2; val2 = val2; _vthumb.hover.background = val2; normal3.background = val2; } } public static void Draw() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown if (Open) { Styles(); _scale = Mathf.Max(0.6f, (float)Screen.height / 1080f); Matrix4x4 matrix = GUI.matrix; GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(_scale, _scale, 1f)); float num = 760f; float num2 = 820f; float num3 = (float)Screen.width / _scale; float num4 = (float)Screen.height / _scale; Rect val = default(Rect); ((Rect)(ref val))..ctor((num3 - num) * 0.5f, Mathf.Max(10f, (num4 - num2) * 0.5f), num, Mathf.Min(num2, num4 - 20f)); GUI.Window(3354, val, new WindowFunction(Window), "The Allfather", _win); GUI.matrix = matrix; } } private static void Window(int id) { //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00c0: 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_004c: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); for (int i = 0; i < Tabs.Length; i++) { if (GUILayout.Button(Tabs[i], (i != _tab) ? _tabOff : _tabOn, Array.Empty<GUILayoutOption>())) { _tab = i; _scroll = Vector2.zero; } } GUILayout.EndHorizontal(); GUILayout.Space(8f); GUIStyle verticalScrollbar = GUI.skin.verticalScrollbar; GUIStyle verticalScrollbarThumb = GUI.skin.verticalScrollbarThumb; GUI.skin.verticalScrollbar = _vbar; GUI.skin.verticalScrollbarThumb = _vthumb; _scroll = GUILayout.BeginScrollView(_scroll, false, false, GUIStyle.none, _vbar, Array.Empty<GUILayoutOption>()); try { switch (_tab) { case 0: Survival(); break; case 1: Movement(); break; case 2: Combat(); break; case 3: Powers(); break; case 4: Look(); break; case 5: World(); break; } } catch (Exception ex) { GUILayout.Label("Error: " + ex.Message, _small, Array.Empty<GUILayoutOption>()); } GUILayout.EndScrollView(); GUI.skin.verticalScrollbar = verticalScrollbar; GUI.skin.verticalScrollbarThumb = verticalScrollbarThumb; GUILayout.Space(6f); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(string.Concat("Changes apply at once and are saved when you close. ", Plugin.MenuKey.Value, " to close."), _small, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (!_confirmReset) { if (GUILayout.Button("Reset all to defaults", _btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(190f) })) { _confirmReset = true; } } else { if (GUILayout.Button("Yes, reset everything", _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(190f) })) { ResetAll(); _confirmReset = false; } if (GUILayout.Button("Cancel", _btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) })) { _confirmReset = false; } } if (GUILayout.Button("Close", _btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) })) { Toggle(); } GUILayout.EndHorizontal(); } private static void Survival() { Note("Everything on this page applies while you are the Allfather."); Head("Health"); Choice<HealthMode>("When you take damage", Plugin.Health, new string[3] { "Mortal", "Can't die", "Invulnerable" }, (Plugin.Health.Value == HealthMode.Mortal) ? "You take damage and can be slain." : ((Plugin.Health.Value != HealthMode.CannotDie) ? "Nothing can hurt you." : "You take damage, but it never takes you below 1 health.")); if (Plugin.Health.Value != HealthMode.Invulnerable) { Slider(Plugin.DamageTakenMultiplier, "Damage you take", 0f, 1f, "0%", 100f, "%"); } Slider(Plugin.GodHealth, "Max health and stamina", 50f, 3000f, "0", 1f, string.Empty); Slider(Plugin.GodRegen, "Health regen per second", 0f, 25f, "0.#", 1f, "%"); Slider(Plugin.GodArmor, "Bonus armor", 0f, 1000f, "0", 1f, string.Empty); Check(Plugin.NoFallDamage, "No fall damage"); Head("Stamina and eitr"); Check(Plugin.InfiniteStamina, "Infinite stamina"); Check(Plugin.InfiniteEitr, "Infinite eitr", "For staffs and magic weapons."); Head("Elements"); Slider(Plugin.ElementalResist, "Fire, cold and poison resistance", 0f, 1f, "0", 100f, "%", "Above 0 you also never freeze, burn or get poisoned."); } private static void Movement() { Head("On foot"); Slider(Plugin.SprintMultiplier, "Sprint speed", 1f, 5f, "0.0", 1f, "x"); Slider(Plugin.SprintJump, "Sprint jump power", 1f, 5f, "0.0", 1f, "x"); Slider(Plugin.ChargedJumpSpeed, "Charged jump launch", 20f, 200f, "0", 1f, " m/s"); Slider(Plugin.CarryWeight, "Carry weight", 300f, 10000f, "0", 1f, string.Empty); Head("Blink (dodge)"); Check(Plugin.BlinkOn, "Dodge is a blink", "You vanish and reappear in the dodge direction, untouchable in between."); Slider(Plugin.BlinkDistance, "Blink distance", 3f, 25f, "0", 1f, " m"); Head("Flight"); Slider(Plugin.FlySpeed, "Flying speed", 5f, 100f, "0", 1f, " m/s"); Slider(Plugin.FlyFastSpeed, "Flying speed with Shift", 20f, 300f, "0", 1f, " m/s"); Slider(Plugin.FlyAccel, "Acceleration", 1f, 20f, "0.0", 1f, string.Empty); Slider(Plugin.DoubleTapWindow, "Double-tap Space window", 0.15f, 0.6f, "0.00", 1f, " s"); Choice<FlightElement>("Flight element", Plugin.FlightFx, new string[5] { "Lightning", "Fire", "Frost", "Nature", "Shadow" }, "Colours your aura, contrails and sonic boom, and what bursts out when you take off and land."); Slider(Plugin.LandingHold, "Superhero landing pose", 0.5f, 5f, "0.0", 1f, " s", "How long you stay down on one knee. Moving gets you up early."); Check(Plugin.TakeoffBlast, "Lightning blast on take-off", "The thunderclap, flash and knock-back when you leave the ground. Off = a quiet take-off."); Check(Plugin.LandingBlast, "Impact on landing", "The shockwave, flash and crater when you dive into the ground. Off = you just land and kneel."); Check(Plugin.FlightAura, "Aura and contrails", "The glow, crackle and trails around you while you fly."); Check(Plugin.SonicBoom, "Sonic boom at full speed", "A flash and thunderclap once each time you hit top speed."); } private static void Combat() { Head("Everything"); Slider(Plugin.PowerDamage, "Damage of all your powers", 0.1f, 10f, "0.0", 1f, "x", "Multiplies every power, the blast and the Judgement."); Slider(Plugin.AttackSpeed, "Weapon swing speed", 1f, 5f, "0.0", 1f, "x"); Slider(Plugin.DivineDamageMultiplier, "Divine Armory weapon damage", 1f, 20f, "0.0", 1f, "x"); Head("Power attack blast (middle mouse)"); Check(Plugin.PowerBlastOn, "Power attack blast", "Off = middle mouse is just your weapon's normal power attack."); Slider(Plugin.PowerBlastRadius, "Blast size", 0f, 50f, "0", 1f, " m"); Slider(Plugin.PowerBlastDamage, "Blast damage", 100f, 10000f, "0", 1f, string.Empty); Check(Plugin.PowerBlastBuildings, "Blast destroys buildings"); Slider(Plugin.PowerBlastCrater, "Blast crater", 0f, 20f, "0", 1f, " m", "Craters are permanent. 0 = none."); Head("Destruction"); Check(Plugin.BuildingDestruction, "Destruction of buildings", "Master switch. Off = your powers, blasts, meteors, landings and divine weapons never damage a building (yours or anyone's). The switches below only matter while this is on."); Check(Plugin.DamageBuildings, "Explosive powers break buildings", "Storm strikes, fireballs, earthquakes, Mjölnir's slam, Gungnir's impact, hard landings and the Judgement. Trees and rocks always break."); Check(Plugin.MeteorBreaksBuildings, "Ragnarök meteor breaks buildings"); Slider(Plugin.CraterRadius, "Meteor crater size", 0f, 40f, "0", 1f, " m", "0 = no crater."); } private static void Powers() { Head("Lightning"); Slider(Plugin.LightningDamage, "Lightning damage", 10f, 1000f, "0", 1f, string.Empty); IntSlider(Plugin.LightningChains, "Chains to extra enemies", 0, 20); Head("Gungnir and Mjölnir"); Slider(Plugin.GungnirPierce, "Gungnir damage", 50f, 5000f, "0", 1f, string.Empty); Slider(Plugin.GungnirScale, "Gungnir size", 0.5f, 5f, "0.0", 1f, "x"); Slider(Plugin.MjolnirDamage, "Mjölnir damage", 50f, 5000f, "0", 1f, string.Empty); IntSlider(Plugin.MjolnirBounces, "Mjölnir ricochets", 0, 15); Slider(Plugin.MjolnirSmiteRadius, "Mjölnir slam size", 4f, 40f, "0", 1f, " m"); Slider(Plugin.MjolnirScale, "Mjölnir size", 0.5f, 5f, "0.0", 1f, "x"); Head("The Allfather's Judgement (F)"); Slider(Plugin.OdinCooldown, "Cooldown", 0f, 600f, "0", 1f, " s"); Slider(Plugin.OdinBlessing, "Blessing length", 0f, 300f, "0", 1f, " s"); Head("Shapes"); Slider(Plugin.BeastDamage, "Beast attack damage", 0.5f, 10f, "0.0", 1f, "x", "1 = exactly as hard as the real creature."); Head("Huginn & Muninn"); Slider(Plugin.RavenScoutRange, "Scouting range", 30f, 300f, "0", 1f, " m", "Creatures exist only in the loaded area around you (about 150 m)."); Slider(Plugin.RavenScoutTime, "How long marks last", 5f, 180f, "0", 1f, " s"); Head("Draupnir"); Slider(Plugin.DraupnirAmount, "Treasure per use", 0.2f, 10f, "0.0", 1f, "x"); Head("???"); Slider(Plugin.ChallengeTime, "How long Odin keeps your power", 10f, 600f, "0", 1f, " s", "If you are ever foolish enough to challenge him."); Head("Valknut Blast"); Slider(Plugin.ValknutBlastRange, "Reach", 10f, 200f, "0", 1f, " m", "Every enemy within this distance falls."); Head("Trial of Odin"); IntSlider(Plugin.TrialWaves, "Waves", 1, 10, "The last wave brings Valhalla's Champion."); IntSlider(Plugin.TrialSpirits, "Spirits in the first wave", 1, 10, "Each wave brings one more."); Slider(Plugin.TrialToughness, "Spirit toughness", 0.5f, 30f, "0.0", 1f, "x"); Slider(Plugin.TrialStrength, "Spirit strength", 0.5f, 10f, "0.0", 1f, "x"); Slider(Plugin.TrialArena, "Arena size", 10f, 60f, "0", 1f, " m"); Check(Plugin.TrialRewards, "Treasure when you win"); Head("Summons"); Slider(Plugin.SummonLifetime, "How long summons stay", 10f, 1800f, "0", 1f, " s"); IntSlider(Plugin.MaxSummons, "Most summons at once", 1, 40); IntSlider(Plugin.WolfCount, "Geri & Freki: wolves per call", 1, 10); IntSlider(Plugin.EinherjarCount, "Einherjar: warriors per call", 1, 10); Check(Plugin.ValhallaWolves, "Geri & Freki look like Valhalla's warriors", "Off = ordinary wolves."); } private static void Look() { Head("The Allfather"); Slider(Plugin.GodScale, "Body size", 0.5f, 3f, "0.00", 1f, "x"); Check(Plugin.EtherealArmor, "Wear god armor (looks only)"); if (Plugin.EtherealArmor.Value) { Check(Plugin.RotateArmor, "New armor set every transformation"); if (Plugin.RotateArmor.Value) { GUILayout.BeginHorizontal(Row(), Array.Empty<GUILayoutOption>()); GUILayout.Label("Wearing: " + ArmorSets.Current.Name, _label, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (GUILayout.Button("Next set", _btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) })) { ArmorSets.Advance(); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { Ascension.Refresh(localPlayer); Ascension.Recolor(localPlayer); } } GUILayout.EndHorizontal(); Note("Switch off any set that doesn't sit right on you (some armors fit a bigger body badly; a body size of 1.0 helps too)."); for (int i = 0; i < ArmorSets.All.Count; i++) { bool flag = ArmorSets.IsOn(i); GUILayout.BeginHorizontal(Row(), Array.Empty<GUILayoutOption>()); GUILayout.Label(char.ToUpper(ArmorSets.All[i].Name[0]) + ArmorSets.All[i].Name.Substring(1), _label, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (GUILayout.Button("On", (!flag) ? _btn : _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { ArmorSets.SetOn(i, on: true); } if (GUILayout.Button("Off", flag ? _btn : _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { ArmorSets.SetOn(i, on: false); } GUILayout.EndHorizontal(); } } } Check(Plugin.CivilianClothes, "Ordinary clothes in Mortal Guise", "A random outfit each time: tunics, dresses, rags, leathers, hats."); Check(Plugin.GlowingEyes, "Glowing white eyes"); Check(Plugin.AscensionEffect, "Lightning when you transform"); Check(Plugin.Wisdom, "A word of Odin's wisdom when you transform"); Head("Huginn"); Check(Plugin.CompanionRavenOn, "Huginn the raven follows you"); Slider(Plugin.RavenSize, "Huginn's size", 0.2f, 2f, "0.0", 1f, "x"); Head("Performance"); Check(Plugin.LightEffects, "Lighter effects", "Fewer particles, flashes and spawned effects. Turn on if busy places (swamps, big fights) get slow."); Head("Screen"); Check(Plugin.ShowHud, "Show the current powers at the bottom"); Slider(Plugin.UiScale, "Wheel size", 0.5f, 2f, "0.0", 1f, "x"); Slider(Plugin.WheelSensitivity, "Wheel mouse sensitivity", 0.5f, 15f, "0.0", 1f, string.Empty); } private static void World() { Head("Building and crafting"); Note("While you are the Allfather every crafting recipe, building piece and planting recipe is known, and you can craft anything anywhere, no workbench or forge needed."); Check(Plugin.FreeBuild, "Free building and crafting", "Nothing costs materials while you are the Allfather."); Head("Earthshaping"); Slider(Plugin.ShapeRadius, "Brush size", 1f, 12f, "0.0", 1f, " m"); Slider(Plugin.ShapeStrength, "Strength", 0.05f, 3f, "0.00", 1f, " m"); Head("Inventory"); IntSlider(Plugin.InventoryRows, "Inventory rows", 4, 9, "Rows only ever grow, so nothing is dropped. Applies when you transform."); } private static GUIStyle Row() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown if (_rowStyle == null) { GUIStyle val = new GUIStyle(); val.padding = new RectOffset(12, 12, 7, 7); val.margin = new RectOffset(0, 4, 3, 3); val.border = new RectOffset(3, 3, 3, 3); _rowStyle = val; _rowStyle.normal.background = _row; } return _rowStyle; } private static void Head(string t) { //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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GUILayout.Space(12f); GUILayout.Label(t, _head, Array.Empty<GUILayoutOption>()); Rect rect = GUILayoutUtility.GetRect(1f, 2f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUI.DrawTexture(rect, (Texture)(object)_rule); GUILayout.Space(4f); } private static void Note(string desc) { if (!string.IsNullOrEmpty(desc)) { GUILayout.Label(desc, _small, Array.Empty<GUILayoutOption>()); } } private static void Check(ConfigEntry<bool> e, string label, string desc = null) { GUILayout.BeginVertical(Row(), Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(label, _label, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (GUILayout.Button("On", (!e.Value) ? _btn : _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { e.Value = true; } if (GUILayout.Button("Off", e.Value ? _btn : _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { e.Value = false; } GUILayout.EndHorizontal(); Note(desc); GUILayout.EndVertical(); } private static void Choice<T>(string label, ConfigEntry<T> e, string[] names, string desc) where T : struct { GUILayout.BeginVertical(Row(), Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(label, _label, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); T[] array = (T[])Enum.GetValues(typeof(T)); for (int i = 0; i < array.Length && i < names.Length; i++) { if (GUILayout.Button(names[i], (!EqualityComparer<T>.Default.Equals(e.Value, array[i])) ? _btn : _btnOn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width((float)((names.Length <= 3) ? 110 : 84)) })) { e.Value = array[i]; } } GUILayout.EndHorizontal(); Note(desc); GUILayout.EndVertical(); } private static void Slider(ConfigEntry<float> e, string label, float min, float max, string fmt, float show = 1f, string unit = "", string desc = null) { GUILayout.BeginVertical(Row(), Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(label, _label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }); float num = GUILayout.HorizontalSlider(Mathf.Clamp(e.Value, min, max), min, max, _track, _thumb, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) }); GUILayout.Space(8f); GUILayout.Label((e.Value * show).ToString(fmt) + unit, _val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }); GUILayout.EndHorizontal(); Note(desc); GUILayout.EndVertical(); if (Mathf.Abs(num - Mathf.Clamp(e.Value, min, max)) > 1E-05f) { float num2 = (max - min) / 200f; float num3 = Mathf.Pow(10f, Mathf.Floor(Mathf.Log10(Mathf.Max(0.0001f, num2)))); num = Mathf.Round(num / num3) * num3; e.Value = Mathf.Clamp(num, min, max); } } private static void IntSlider(ConfigEntry<int> e, stri