using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ValheimReforged { public enum Eff { None, MaxHealth, MaxStamina, MaxEitr, MoveSpeed, Damage, AbilityPower, HealthRegen, StaminaRegen, EitrRegen, LifeSteal, Cooldown, Crit, Resist, MeleeDamage, RangedDamage, MagicDamage, Execute, Opening, KillHeal, StaminaCost, SwordDamage, KnifeDamage, AxeDamage, ClubDamage, BowDamage, CrossbowDamage, ElementalDamage, BloodDamage, Experience, ArmorBonus, MiningDamage, ChoppingDamage, HarvestYield, FoodDuration, FishingSkill, ElementalResist, AmmoSave, FreeAmmo } public class Ability { public string Id; public string Glyph; public RpgClass Class; public int Col; public int Row; public string Parent; public int MaxRank = 5; public Eff Effect; public float PerRank; public int Cost = 1; public float Power = 1f; public float Cooldown; public Func Cast; public Func Preview; public string Name => L.T("ability." + Id + ".name"); public string Desc { get { if (!Active) { return L.F("ui.per_rank", Stats.Describe(Effect, PerRank)); } return L.T("ability." + Id + ".desc"); } } public string Info { get { string key = "ability." + Id + ".info"; if (!L.Has(key)) { return null; } return L.T(key); } } public bool Active => Cast != null; } public class Buff { public string Id; public string Name; public float Expires; public float Duration; public Dictionary Mods = new Dictionary(); } public static class Buffs { public static readonly List Active = new List(); public static void Add(string id, string name, float duration, params KeyValuePair[] mods) { Active.RemoveAll((Buff b) => b.Id == id); Buff buff = new Buff { Id = id, Name = name, Expires = Time.time + duration, Duration = duration }; for (int num = 0; num < mods.Length; num++) { KeyValuePair keyValuePair = mods[num]; buff.Mods[keyValuePair.Key] = keyValuePair.Value; } Active.Add(buff); } public static KeyValuePair M(Eff e, float v) { return new KeyValuePair(e, v); } public static float Get(Eff e) { float num = 0f; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { float value; if (Active[num2].Expires <= Time.time) { Active.RemoveAt(num2); } else if (Active[num2].Mods.TryGetValue(e, out value)) { num += value; } } return num; } public static void Clear() { Active.Clear(); } } public static class Stats { private static readonly Dictionary Caps = new Dictionary { { Eff.MoveSpeed, 0.6f }, { Eff.Crit, 0.75f }, { Eff.LifeSteal, 0.3f }, { Eff.Cooldown, 0.5f }, { Eff.StaminaCost, 0.6f }, { Eff.Resist, 0.8f }, { Eff.ElementalResist, 0.75f }, { Eff.AmmoSave, 0.75f } }; public static float Get(Eff e) { RpgData data = Plugin.Data; if (data == null || data.Class == RpgClass.None) { return 0f; } float num = Buffs.Get(e) + Talents.Bonus(e); foreach (Ability item in Abilities.For(data.Class)) { if (item.Effect == e) { num += item.PerRank * (float)data.Rank(item.Id); } } if (!Caps.TryGetValue(e, out var value)) { return num; } return Mathf.Min(num, value); } public static float GetPassive(Eff e) { return GetTree(e) + Talents.Bonus(e); } public static float GetTree(Eff e) { RpgData data = Plugin.Data; if (data == null || data.Class == RpgClass.None) { return 0f; } float num = 0f; foreach (Ability item in Abilities.For(data.Class)) { if (item.Effect == e) { num += item.PerRank * (float)data.Rank(item.Id); } } return num; } public static string Describe(Eff e, float amount) { string text; switch (e) { case Eff.None: return ""; case Eff.MaxHealth: case Eff.MaxStamina: case Eff.MaxEitr: case Eff.FishingSkill: text = amount.ToString("0.#"); break; case Eff.HealthRegen: case Eff.StaminaRegen: case Eff.EitrRegen: text = amount.ToString("0.0"); break; default: text = (amount * 100f).ToString("0.#"); break; } return L.F("eff." + e, text); } } public static class Dash { private static Vector3 dir; private static float speed; private static float left; public static void Start(Player p, Vector3 direction, float distance, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) direction.y = 0f; dir = ((Vector3)(ref direction)).normalized; speed = distance / duration; left = duration; } public static void Step(Player p) { //IL_002d: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //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) if (left <= 0f) { return; } float fixedDeltaTime = Time.fixedDeltaTime; left -= fixedDeltaTime; float num = speed * fixedDeltaTime; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)p).transform.position + Vector3.up * 0.9f, dir, ref val, num + 0.5f)) { left = 0f; return; } Rigidbody component = ((Component)p).GetComponent(); if ((Object)(object)component != (Object)null) { component.position += dir * num; return; } Transform transform = ((Component)p).transform; transform.position += dir * num; } } public static class Abilities { public static readonly List All; private static readonly Dictionary> byClass; private static readonly Dictionary ready; private static readonly Dictionary total; private static float CurrentPower; public static List For(RpgClass c) { if (!byClass.TryGetValue(c, out var value)) { return new List(); } return value; } public static Ability Find(string id) { return All.FirstOrDefault((Ability a) => a.Id == id); } public static float CooldownLeft(string id) { if (!ready.TryGetValue(id, out var value)) { return 0f; } return Mathf.Max(0f, value - Time.time); } public static float CooldownTotal(string id) { if (!total.TryGetValue(id, out var value)) { return 1f; } return value; } public static void Cast(Player p, RpgData d, int slot) { string text = d.Slots[slot]; Ability ability = ((text == null) ? null : Find(text)); if (ability == null || !ability.Active) { return; } int num = d.Rank(ability.Id); if (num <= 0) { return; } if (CooldownLeft(ability.Id) > 0f) { ((Character)p).Message((MessageType)1, L.F("msg.cooldown", ability.Name), 0, (Sprite)null, false); return; } CurrentPower = ability.Power; if (ability.Cast(p, num)) { float num2 = ability.Cooldown * (1f - Mathf.Min(0.5f, Stats.Get(Eff.Cooldown))); ready[ability.Id] = Time.time + num2; total[ability.Id] = num2; } } private static float FrenzyTime(int rank) { return 6f + (float)rank; } private static float FrenzyDamage(int rank) { return (0.2f + 0.06f * (float)rank) * CurrentPower; } private static float Scale(int rank, float basis, float perRank) { return (basis + perRank * (float)rank) * (1f + 0.02f * (float)((Plugin.Data == null) ? 1 : Plugin.Data.Level)) * (1f + Stats.Get(Eff.AbilityPower)) * Plugin.AbilityDamage.Value * CurrentPower; } private static void Burst(Player p, Vector3 center, float radius, DamageTypes dmg, float push) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) Character[] array = Character.GetAllCharacters().ToArray(); foreach (Character val in array) { if (!((Object)(object)val == (Object)(object)p) && !val.IsDead() && BaseAI.IsEnemy((Character)(object)p, val) && !(Vector3.Distance(((Component)val).transform.position, center) > radius)) { Strike(p, val, center, dmg, push); } } } private static void Strike(Player p, Character c, Vector3 from, DamageTypes dmg, float push) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown HitData val = new HitData { m_damage = dmg, m_attacker = ((Character)p).GetZDOID(), m_point = c.GetCenterPoint() }; Vector3 val2 = ((Component)c).transform.position - from; val.m_dir = ((Vector3)(ref val2)).normalized; val.m_pushForce = push; HitData val3 = val; c.Damage(val3); } private static Vector3 AimPoint(Player p, float max) { //IL_0021: 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_003f: 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_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_0038: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform : ((Component)p).transform); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val.position, val.forward, ref val2, max)) { return ((RaycastHit)(ref val2)).point; } return val.position + val.forward * max; } private static ItemData FindArrows(Player p, int count) { foreach (ItemData allItem in ((Humanoid)p).GetInventory().GetAllItems()) { if (allItem.m_shared.m_ammoType == "$ammo_arrows" && allItem.m_stack >= count) { return allItem; } } return null; } private static bool Eitr(Player p, float cost) { if (!((Character)p).HaveEitr(cost)) { ((Character)p).Message((MessageType)2, L.T("msg.no_eitr"), 0, (Sprite)null, false); return false; } ((Character)p).UseEitr(cost); return true; } private static float TakeArrows(Player p, int cost) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) ItemData val = FindArrows(p, cost); if (val == null) { ((Character)p).Message((MessageType)2, L.F("msg.need_arrows", cost), 0, (Sprite)null, false); return -1f; } float pierce = val.GetDamage().m_pierce; ((Humanoid)p).GetInventory().RemoveItem(val, cost); return pierce; } private static Ability P(RpgClass cls, string id, int col, int row, string parent, Eff e, float per, string glyph) { Ability obj = new Ability { Id = id, Class = cls, Col = col, Row = row, Parent = parent, Effect = e, PerRank = per, Glyph = glyph }; Add(obj); return obj; } private static Ability A(RpgClass cls, string id, int col, int row, string parent, float cd, string glyph, Func cast) { Ability ability = new Ability { Id = id, Class = cls, Col = col, Row = row, Parent = parent, Cooldown = cd, Glyph = glyph, Cast = cast }; if (row == 4) { ability.MaxRank = 3; } Add(ability); return ability; } private static void Tip(string id, Func preview) { Find(id).Preview = delegate(int r) { float currentPower = CurrentPower; CurrentPower = Find(id).Power; try { return preview(r); } finally { CurrentPower = currentPower; } }; } private static void Add(Ability a) { All.Add(a); if (!byClass.TryGetValue(a.Class, out var value)) { value = (byClass[a.Class] = new List()); } value.Add(a); } static Abilities() { All = new List(); byClass = new Dictionary>(); ready = new Dictionary(); total = new Dictionary(); CurrentPower = 1f; RpgClass cls = RpgClass.Archer; RpgClass cls2 = RpgClass.Mage; RpgClass cls3 = RpgClass.Rogue; P(RpgClass.Warrior, "w_str1", 0, 1, null, Eff.Damage, 0.02f, "sword"); A(RpgClass.Warrior, "w_shock", 0, 2, "w_str1", 18f, "w_shock", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0033: 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) Vfx.Cast("w_shock", ((Component)p).transform.position, ((Component)p).transform.position); Burst(p, ((Component)p).transform.position, 6f, new DamageTypes { m_blunt = Scale(r, 25f, 15f) }, 40f); return true; }); P(RpgClass.Warrior, "w_crit", 0, 3, "w_shock", Eff.Crit, 0.02f, "crit"); P(RpgClass.Warrior, "w_rage", 0, 4, "w_crit", Eff.MeleeDamage, 0.06f, "sword"); P(RpgClass.Warrior, "w_iron", 1, 1, null, Eff.MaxHealth, 10f, "heart"); A(RpgClass.Warrior, "w_wind", 1, 2, "w_iron", 45f, "w_wind", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vfx.Cast("w_wind", ((Component)p).transform.position, ((Component)p).transform.position); ((Character)p).Heal(((Character)p).GetMaxHealth() * (0.15f + 0.05f * (float)r), true); ((Character)p).AddStamina(((Character)p).GetMaxStamina()); return true; }); P(RpgClass.Warrior, "w_regen", 1, 3, "w_wind", Eff.HealthRegen, 0.25f, "w_wind"); P(RpgClass.Warrior, "w_wall", 1, 4, "w_regen", Eff.Resist, 0.05f, "w_iron"); P(RpgClass.Warrior, "w_stam", 2, 1, null, Eff.MaxStamina, 6f, "a_endur"); P(RpgClass.Warrior, "w_cry", 2, 2, "w_stam", Eff.StaminaCost, 0.03f, "r_reflex"); P(RpgClass.Warrior, "w_drain", 2, 3, "w_cry", Eff.LifeSteal, 0.015f, "m_well"); P(RpgClass.Warrior, "w_quake", 2, 4, "w_drain", Eff.Execute, 0.15f, "w_shock"); P(cls, "a_sharp", 0, 1, null, Eff.Damage, 0.02f, "sword"); A(cls, "a_rain", 0, 2, "a_sharp", 22f, "a_rain", delegate(Player p, int r) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) float num = TakeArrows(p, 5); if (num < 0f) { return false; } Vector3 val = AimPoint(p, 40f); Vfx.Cast("a_rain", ((Component)p).transform.position, val); Burst(p, val, 7f, new DamageTypes { m_pierce = Scale(r, 30f, 15f) + num * 2f }, 10f); return true; }); P(cls, "a_crit", 0, 3, "a_rain", Eff.Crit, 0.02f, "crit"); P(cls, "a_volley", 0, 4, "a_crit", Eff.RangedDamage, 0.06f, "a_rain"); P(cls, "a_endur", 1, 1, null, Eff.MaxStamina, 4f, "a_endur"); A(cls, "a_leap", 1, 2, "a_endur", 25f, "a_leap", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vfx.Cast("a_leap", ((Component)p).transform.position, ((Component)p).transform.position); float v = FrenzyDamage(r); Buffs.Add("a_leap", L.T("ability.a_leap.name"), FrenzyTime(r), Buffs.M(Eff.BowDamage, v), Buffs.M(Eff.CrossbowDamage, v), Buffs.M(Eff.FreeAmmo, 1f)); return true; }); P(cls, "a_swift", 1, 3, "a_leap", Eff.MoveSpeed, 0.02f, "r_reflex"); P(cls, "a_focus", 1, 4, "a_swift", Eff.Opening, 0.15f, "crit"); P(cls, "a_vigor", 2, 1, null, Eff.MaxHealth, 6f, "heart"); P(cls, "a_herbs", 2, 2, "a_vigor", Eff.KillHeal, 0.01f, "w_wind"); P(cls, "a_second", 2, 3, "a_herbs", Eff.StaminaRegen, 0.4f, "a_endur"); P(cls, "a_frost", 2, 4, "a_second", Eff.Execute, 0.15f, "snow"); P(cls2, "m_power", 0, 1, null, Eff.AbilityPower, 0.03f, "m_blast"); A(cls2, "m_blast", 0, 2, "m_power", 14f, "m_blast", delegate(Player p, int r) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (!Eitr(p, 25f)) { return false; } Vector3 val = AimPoint(p, 35f); Vfx.Cast("m_blast", ((Component)p).transform.position, val); Burst(p, val, 5f, new DamageTypes { m_lightning = Scale(r, 35f, 20f) }, 20f); return true; }); P(cls2, "m_crit", 0, 3, "m_blast", Eff.Crit, 0.02f, "crit"); P(cls2, "m_storm", 0, 4, "m_crit", Eff.MagicDamage, 0.06f, "m_blast"); P(cls2, "m_arcana", 1, 1, null, Eff.MaxEitr, 8f, "m_arcana"); A(cls2, "m_well", 1, 2, "m_arcana", 40f, "m_well", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vfx.Cast("m_well", ((Component)p).transform.position, ((Component)p).transform.position); ((Character)p).AddEitr(((Character)p).GetMaxEitr() * (0.3f + 0.1f * (float)r)); return true; }); P(cls2, "m_flow", 1, 3, "m_well", Eff.EitrRegen, 0.4f, "m_well"); P(cls2, "m_shield", 1, 4, "m_flow", Eff.Resist, 0.05f, "w_iron"); P(cls2, "m_vit", 2, 1, null, Eff.MaxHealth, 5f, "heart"); P(cls2, "m_frost", 2, 2, "m_vit", Eff.KillHeal, 0.01f, "snow"); P(cls2, "m_cool", 2, 3, "m_frost", Eff.Cooldown, 0.03f, "clock"); P(cls2, "m_meteor", 2, 4, "m_cool", Eff.AbilityPower, 0.08f, "fire"); P(cls3, "r_blade", 0, 1, null, Eff.Damage, 0.02f, "sword"); A(cls3, "r_step", 0, 2, "r_blade", 20f, "r_reflex", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Vfx.Cast("r_step", ((Component)p).transform.position, ((Component)p).transform.position); Buffs.Add("r_step", "Disparada", 5f + (float)r, Buffs.M(Eff.MoveSpeed, 0.2f + 0.05f * (float)r)); return true; }); P(cls3, "r_crit", 0, 3, "r_step", Eff.Crit, 0.03f, "crit"); P(cls3, "r_execute", 0, 4, "r_crit", Eff.Execute, 0.15f, "crit"); P(cls3, "r_reflex", 1, 1, null, Eff.MoveSpeed, 0.02f, "r_reflex"); P(cls3, "r_smoke", 1, 2, "r_reflex", Eff.Resist, 0.03f, "r_venom"); P(cls3, "r_agile", 1, 3, "r_smoke", Eff.StaminaRegen, 0.4f, "a_endur"); P(cls3, "r_shadow", 1, 4, "r_agile", Eff.Opening, 0.15f, "r_step"); P(cls3, "r_vit", 2, 1, null, Eff.MaxHealth, 4f, "heart"); A(cls3, "r_venom", 2, 2, "r_vit", 20f, "r_venom", delegate(Player p, int r) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Vfx.Cast("r_venom", ((Component)p).transform.position, ((Component)p).transform.position); Burst(p, ((Component)p).transform.position, 5f, new DamageTypes { m_poison = Scale(r, 60f, 30f), m_pierce = Scale(r, 15f, 8f) }, 0f); return true; }); P(cls3, "r_leech", 2, 3, "r_venom", Eff.LifeSteal, 0.01f, "m_well"); P(cls3, "r_plague", 2, 4, "r_leech", Eff.AbilityPower, 0.08f, "r_venom"); Tip("w_shock", (int r) => L.F("ability.w_shock.preview", Scale(r, 25f, 15f).ToString("0"))); Tip("w_wind", (int r) => L.F("ability.w_wind.preview", ((0.15f + 0.05f * (float)r) * 100f).ToString("0"))); Tip("a_rain", (int r) => L.F("ability.a_rain.preview", Scale(r, 30f, 15f).ToString("0"))); Tip("a_leap", (int r) => L.F("ability.a_leap.preview", FrenzyTime(r).ToString("0"), Mathf.RoundToInt(FrenzyDamage(r) * 100f))); Tip("m_blast", (int r) => L.F("ability.m_blast.preview", Scale(r, 35f, 20f).ToString("0"))); Tip("m_well", (int r) => L.F("ability.m_well.preview", ((0.3f + 0.1f * (float)r) * 100f).ToString("0"))); Tip("r_step", (int r) => L.F("ability.r_step.preview", ((0.2f + 0.05f * (float)r) * 100f).ToString("0"), 5 + r)); Tip("r_venom", (int r) => L.F("ability.r_venom.preview", Scale(r, 60f, 30f).ToString("0"), Scale(r, 15f, 8f).ToString("0"))); foreach (Ability item in All) { if (!item.Active && item.Row == 4) { item.MaxRank = 3; } } } } public static class Floaters { private class F { public Vector3 Pos; public string Text; public Color Color; public int Size; public float T0; public float Dur; } public static readonly Color CritColor = new Color(1f, 0.82f, 0.25f); public static readonly Color ExecuteColor = new Color(1f, 0.4f, 0.35f); public static readonly Color OpeningColor = new Color(1f, 0.65f, 0.3f); public static readonly Color XpColor = new Color(0.55f, 0.75f, 1f); private static readonly List list = new List(); private static readonly Dictionary lastShown = new Dictionary(); private static GUIStyle style; public static void Add(Vector3 pos, string text, Color color, int size = 18, float dur = 1.2f, string throttleKey = null, float throttle = 0f) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (throttleKey != null) { if (lastShown.TryGetValue(throttleKey, out var value) && Time.time - value < throttle) { return; } lastShown[throttleKey] = Time.time; if (lastShown.Count > 200) { lastShown.Clear(); } } list.Add(new F { Pos = pos, Text = text, Color = color, Size = size, T0 = Time.time, Dur = dur }); if (list.Count > 40) { list.RemoveAt(0); } } public static void Draw(float s) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0092: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_0168: 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_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) if (list.Count == 0) { return; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } if (style == null) { style = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; } Rect val2 = default(Rect); for (int num = list.Count - 1; num >= 0; num--) { F f = list[num]; float num2 = (Time.time - f.T0) / f.Dur; if (num2 >= 1f) { list.RemoveAt(num); } else { Vector3 val = main.WorldToScreenPoint(f.Pos + Vector3.up * (num2 * 1.4f)); if (!(val.z <= 0f)) { float num3 = val.x / s; float num4 = ((float)Screen.height - val.y) / s; float num5 = 1f + 0.35f * Mathf.Clamp01(1f - num2 * 7f); style.fontSize = Mathf.RoundToInt((float)f.Size * num5); float num6 = 1f - num2 * num2; ((Rect)(ref val2))..ctor(num3 - 150f, num4 - 20f, 300f, 40f); style.normal.textColor = new Color(0f, 0f, 0f, 0.85f * num6); GUI.Label(new Rect(((Rect)(ref val2)).x + 1.5f, ((Rect)(ref val2)).y + 1.5f, ((Rect)(ref val2)).width, ((Rect)(ref val2)).height), f.Text, style); style.normal.textColor = new Color(f.Color.r, f.Color.g, f.Color.b, num6); GUI.Label(val2, f.Text, style); } } } } } public static class Icons { private class Canvas { private readonly Color[] px = (Color[])(object)new Color[4096]; private void Plot(int x, int y, Color c, float a) { //IL_0015: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (x >= 0 && y >= 0 && x < 64 && y < 64) { a *= c.a; if (!(a <= 0f)) { int num = y * 64 + x; Color val = px[num]; float num2 = a + val.a * (1f - a); float num3 = 1f / num2; px[num] = new Color((c.r * a + val.r * val.a * (1f - a)) * num3, (c.g * a + val.g * val.a * (1f - a)) * num3, (c.b * a + val.b * val.a * (1f - a)) * num3, num2); } } } public void Disc(float cx, float cy, float r, Color c) { //IL_001d: 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_0037: Unknown result type (might be due to invalid IL or missing references) for (int i = (int)(cy - r - 1f); (float)i <= cy + r + 1f; i++) { for (int j = (int)(cx - r - 1f); (float)j <= cx + r + 1f; j++) { Plot(j, i, c, Mathf.Clamp01(r - Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), new Vector2(cx, cy)) + 0.5f)); } } } public void Ring(float cx, float cy, float r, float th, Color c) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) for (int i = (int)(cy - r - th); (float)i <= cy + r + th; i++) { for (int j = (int)(cx - r - th); (float)j <= cx + r + th; j++) { float num = Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), new Vector2(cx, cy)); Plot(j, i, c, Mathf.Clamp01(th * 0.5f - Mathf.Abs(num - r) + 0.5f)); } } } public void Line(float x0, float y0, float x1, float y1, float th, Color c) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(x0, y0); Vector2 val2 = new Vector2(x1, y1) - val; float sqrMagnitude = ((Vector2)(ref val2)).sqrMagnitude; Vector2 val3 = default(Vector2); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { ((Vector2)(ref val3))..ctor((float)j + 0.5f, (float)i + 0.5f); float num = ((sqrMagnitude > 0f) ? Mathf.Clamp01(Vector2.Dot(val3 - val, val2) / sqrMagnitude) : 0f); float num2 = Vector2.Distance(val3, val + val2 * num); float num3 = Mathf.Clamp01(th * 0.5f - num2 + 0.5f); if (num3 > 0f) { Plot(j, i, c, num3); } } } } public void Tri(float x0, float y0, float x1, float y1, float x2, float y2, Color c) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(x0, y0); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(x1, y1); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(x2, y2); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { Vector2 p = new Vector2((float)j + 0.5f, (float)i + 0.5f); float num = Sign(p, val, val2); float num2 = Sign(p, val2, val3); float num3 = Sign(p, val3, val); bool flag = num < 0f || num2 < 0f || num3 < 0f; bool flag2 = num > 0f || num2 > 0f || num3 > 0f; if (!(flag && flag2)) { Plot(j, i, c, 1f); } } } } private static float Sign(Vector2 p, Vector2 a, Vector2 b) { //IL_0000: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0028: 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) return (p.x - b.x) * (a.y - b.y) - (a.x - b.x) * (p.y - b.y); } public Texture2D ToTexture() { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; val.SetPixels(px); val.Apply(); return val; } } private const int N = 64; private static readonly Dictionary cache = new Dictionary(); public static Color Accent(RpgClass c) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) return (Color)(c switch { RpgClass.Warrior => new Color(0.88f, 0.34f, 0.28f), RpgClass.Archer => new Color(0.4f, 0.76f, 0.38f), RpgClass.Mage => new Color(0.38f, 0.6f, 1f), RpgClass.Rogue => new Color(0.72f, 0.45f, 0.92f), _ => new Color(0.8f, 0.7f, 0.4f), }); } public static Texture2D ForAbility(Ability a) { return Get(a.Glyph, a.Class); } public static Texture2D ForClass(RpgClass c) { return (Texture2D)(c switch { RpgClass.Warrior => Get("w_iron", c), RpgClass.Archer => Get("a_rain", c), RpgClass.Mage => Get("m_arcana", c), _ => Get("r_step", c), }); } private static Texture2D Get(string id, RpgClass cls) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Build(id, Accent(cls)); } public static Texture2D ForGlyph(string glyph, Color accent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Build(glyph, accent); } private static Texture2D Build(string id, Color accent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_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_009c: Unknown result type (might be due to invalid IL or missing references) string key = id + "#" + ColorUtility.ToHtmlStringRGB(accent); if (cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Canvas canvas = new Canvas(); canvas.Disc(32f, 32f, 31f, new Color(accent.r * 0.28f, accent.g * 0.28f, accent.b * 0.28f, 1f)); canvas.Ring(32f, 32f, 29.5f, 3f, accent); Glyph(canvas, id, Color.Lerp(accent, Color.white, 0.75f)); value = canvas.ToTexture(); cache[key] = value; return value; } private static void Glyph(Canvas cv, string id, Color L) { //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b36: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0b96: Unknown result type (might be due to invalid IL or missing references) //IL_0bb6: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_094d: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0bd7: Unknown result type (might be due to invalid IL or missing references) //IL_0bf7: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0772: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: 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_054e: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: 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_0417: Unknown result type (might be due to invalid IL or missing references) if (id == null) { return; } switch (id.Length) { case 7: switch (id[0]) { case 'w': if (id == "w_shock") { cv.Ring(32f, 32f, 13f, 3.5f, L); cv.Ring(32f, 32f, 21f, 2.5f, L); cv.Disc(32f, 32f, 5f, L); } break; case 'a': if (id == "a_endur") { cv.Tri(32f, 48f, 17f, 20f, 47f, 20f, L); cv.Line(20f, 15f, 44f, 15f, 4f, L); } break; case 'm': if (id == "m_blast") { cv.Line(38f, 52f, 26f, 33f, 5f, L); cv.Line(26f, 33f, 38f, 31f, 5f, L); cv.Line(38f, 31f, 26f, 12f, 5f, L); } break; case 'r': if (id == "r_venom") { cv.Disc(24f, 30f, 10f, L); cv.Disc(39f, 30f, 11f, L); cv.Disc(31f, 40f, 10f, L); cv.Disc(31f, 23f, 8f, L); } break; } break; case 6: switch (id[4]) { case 'n': if (id == "w_wind") { cv.Line(32f, 17f, 32f, 47f, 7f, L); cv.Line(17f, 32f, 47f, 32f, 7f, L); } break; case 'o': if (id == "w_iron") { cv.Tri(19f, 44f, 45f, 44f, 32f, 14f, L); cv.Line(19f, 46f, 45f, 46f, 9f, L); } break; case 'i': if (id == "a_rain") { float[] array = new float[3] { -12f, 0f, 12f }; foreach (float num4 in array) { cv.Line(32f + num4 + 6f, 50f, 32f + num4 - 6f, 22f, 3f, L); cv.Tri(32f + num4 - 11f, 27f, 32f + num4 - 1f, 27f, 32f + num4 - 6f, 15f, L); } } break; case 'a': if (id == "a_leap") { cv.Line(12f, 32f, 48f, 32f, 5f, L); cv.Tri(54f, 32f, 42f, 22f, 42f, 42f, L); cv.Line(12f, 32f, 6f, 24f, 4f, L); cv.Line(12f, 32f, 6f, 40f, 4f, L); cv.Line(20f, 32f, 14f, 24f, 4f, L); cv.Line(20f, 32f, 14f, 40f, 4f, L); } break; case 'l': if (id == "m_well") { cv.Disc(32f, 25f, 11f, L); cv.Tri(21.5f, 29f, 42.5f, 29f, 32f, 51f, L); } break; case 'e': if (id == "r_step") { cv.Disc(19f, 32f, 7f, Fade(L, 0.35f)); cv.Disc(32f, 32f, 7.5f, Fade(L, 0.65f)); cv.Disc(45f, 32f, 8f, L); } break; } break; case 8: switch (id[0]) { case 'm': if (id == "m_arcana") { cv.Line(32f, 11f, 32f, 53f, 3f, L); cv.Line(11f, 32f, 53f, 32f, 3f, L); cv.Line(17f, 17f, 47f, 47f, 3f, L); cv.Line(17f, 47f, 47f, 17f, 3f, L); cv.Disc(32f, 32f, 8f, L); } break; case 'r': if (id == "r_reflex") { cv.Line(14f, 41f, 50f, 41f, 4f, L); cv.Line(9f, 32f, 43f, 32f, 4f, L); cv.Line(16f, 23f, 49f, 23f, 4f, L); } break; } break; case 4: switch (id[3]) { case 'r': if (id == "star") { cv.Line(32f, 10f, 32f, 54f, 4f, L); cv.Line(10f, 32f, 54f, 32f, 4f, L); cv.Line(17f, 17f, 47f, 47f, 3f, L); cv.Line(47f, 17f, 17f, 47f, 3f, L); cv.Disc(32f, 32f, 6f, L); } break; case 'k': if (id == "pick") { cv.Line(32f, 10f, 32f, 54f, 5f, L); cv.Line(12f, 42f, 32f, 50f, 5f, L); cv.Line(52f, 42f, 32f, 50f, 5f, L); } break; case 'f': if (id == "leaf") { cv.Disc(32f, 30f, 14f, L); cv.Tri(32f, 52f, 18f, 32f, 46f, 32f, L); cv.Line(32f, 52f, 32f, 60f, 3f, L); } break; case 'l': if (id == "bowl") { cv.Tri(12f, 38f, 52f, 38f, 32f, 16f, L); cv.Line(26f, 46f, 26f, 56f, 3f, L); cv.Line(38f, 46f, 38f, 56f, 3f, L); } break; case 'h': if (id == "fish") { cv.Disc(28f, 32f, 13f, L); cv.Tri(38f, 32f, 54f, 44f, 54f, 20f, L); } break; case 'w': if (id == "snow") { float[] array = new float[3] { 0f, 60f, 120f }; for (int i = 0; i < array.Length; i++) { float num = array[i] * ((float)Math.PI / 180f); float num2 = Mathf.Cos(num) * 19f; float num3 = Mathf.Sin(num) * 19f; cv.Line(32f - num2, 32f - num3, 32f + num2, 32f + num3, 3.5f, L); } } break; case 'e': if (id == "fire") { cv.Disc(32f, 26f, 11f, L); cv.Tri(22f, 31f, 42f, 31f, 32f, 54f, L); } break; case 't': if (id == "crit") { cv.Ring(32f, 32f, 13f, 3f, L); cv.Disc(32f, 32f, 3.5f, L); cv.Line(32f, 9f, 32f, 21f, 3f, L); cv.Line(32f, 43f, 32f, 55f, 3f, L); cv.Line(9f, 32f, 21f, 32f, 3f, L); cv.Line(43f, 32f, 55f, 32f, 3f, L); } break; } break; case 5: switch (id[0]) { case 's': if (id == "sword") { cv.Line(17f, 17f, 46f, 46f, 5f, L); cv.Line(17f, 36f, 36f, 17f, 5f, L); cv.Disc(46f, 46f, 3f, L); } break; case 'c': if (id == "clock") { cv.Ring(32f, 32f, 17f, 3.5f, L); cv.Line(32f, 32f, 32f, 44f, 3f, L); cv.Line(32f, 32f, 41f, 32f, 3f, L); } break; case 'h': if (id == "heart") { cv.Disc(24f, 37f, 9f, L); cv.Disc(40f, 37f, 9f, L); cv.Tri(15.5f, 33f, 48.5f, 33f, 32f, 12f, L); } break; } break; case 3: if (id == "axe") { cv.Line(22f, 12f, 40f, 52f, 5f, L); cv.Tri(38f, 54f, 56f, 42f, 36f, 30f, L); } break; } } private static Color Fade(Color c, float a) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return new Color(c.r, c.g, c.b, a); } } public static class L { private const string Fallback = "English"; private static Dictionary english; private static Dictionary current; private static string lang = ""; private static float nextCheck; private static string PluginDir => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Translations"); private static string UserDir => Path.Combine(Paths.ConfigPath, Path.Combine("ValheimReforged", "Translations")); private static string GameLanguage() { try { return (Localization.instance != null) ? Localization.instance.GetSelectedLanguage() : "English"; } catch { return "English"; } } private static void Ensure() { if (english == null) { english = LoadEmbeddedEnglish(); Overlay(english, Path.Combine(PluginDir, "English.yml")); Overlay(english, Path.Combine(UserDir, "English.yml")); current = english; try { Directory.CreateDirectory(UserDir); } catch { } } if (Time.realtimeSinceStartup < nextCheck) { return; } nextCheck = Time.realtimeSinceStartup + 1f; string text = GameLanguage(); if (text == lang) { return; } lang = text; if (text == "English") { current = english; return; } Dictionary dictionary = new Dictionary(); bool flag = Overlay(dictionary, Path.Combine(PluginDir, text + ".yml")); flag |= Overlay(dictionary, Path.Combine(UserDir, text + ".yml")); if (!flag) { flag = TryRelated(dictionary, text); } current = dictionary; if (flag) { Plugin.Log.LogInfo((object)("Translation loaded: " + text + " (" + dictionary.Count + " entries)")); } else { Plugin.Log.LogInfo((object)("No translation for '" + text + "'; using English. Copy English.yml to " + Path.Combine(UserDir, text + ".yml") + " and translate the values to add it.")); } } private static bool TryRelated(Dictionary into, string g) { int num = g.IndexOf('_'); string text = ((num > 0) ? g.Substring(0, num) : g); string[] array = new string[2] { PluginDir, UserDir }; foreach (string path in array) { try { if (!Directory.Exists(path)) { continue; } string[] files = Directory.GetFiles(path, text + "*.yml"); foreach (string path2 in files) { if (Overlay(into, path2)) { Plugin.Log.LogInfo((object)("Using related translation " + Path.GetFileName(path2) + " for " + g)); return true; } } } catch { } } return false; } private static Dictionary LoadEmbeddedEnglish() { Dictionary dictionary = new Dictionary(); try { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("English.yml"); if (stream != null) { using StreamReader streamReader = new StreamReader(stream, Encoding.UTF8); Parse(streamReader.ReadToEnd(), dictionary); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read embedded English.yml: " + ex.Message)); } return dictionary; } private static bool Overlay(Dictionary into, string path) { try { if (!File.Exists(path)) { return false; } Parse(File.ReadAllText(path, Encoding.UTF8), into); return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read " + path + ": " + ex.Message)); return false; } } private static void Parse(string text, Dictionary into) { string[] array = text.Split(new char[1] { '\n' }); for (int i = 0; i < array.Length; i++) { string text2 = array[i].Trim(new char[1] { '\r' }).Trim(); if (text2.Length != 0 && text2[0] != '#') { int num = text2.IndexOf(':'); if (num > 0) { string key = text2.Substring(0, num).Trim(); string v = text2.Substring(num + 1).Trim(); into[key] = Unquote(v); } } } } private static string Unquote(string v) { if (v.Length >= 2 && v[0] == '"' && v[v.Length - 1] == '"') { StringBuilder stringBuilder = new StringBuilder(); for (int i = 1; i < v.Length - 1; i++) { char c = v[i]; if (c == '\\' && i + 1 < v.Length - 1) { char c2 = v[++i]; stringBuilder.Append(c2 switch { 't' => '\t', 'n' => '\n', _ => c2, }); } else { stringBuilder.Append(c); } } return stringBuilder.ToString(); } if (v.Length >= 2 && v[0] == '\'' && v[v.Length - 1] == '\'') { return v.Substring(1, v.Length - 2).Replace("''", "'"); } return v; } public static bool Has(string key) { Ensure(); if (current == null || !current.ContainsKey(key)) { return english.ContainsKey(key); } return true; } public static string T(string key) { Ensure(); if (current != null && current.TryGetValue(key, out var value)) { return value; } if (english.TryGetValue(key, out value)) { return value; } return key; } public static string F(string key, params object[] args) { string text = T(key); try { return string.Format(text, args); } catch (FormatException) { return text; } } } public interface ISynced { string Key { get; } string Serialize(); void SetServer(string value); void ClearServer(); bool ApplyLocal(string value); } public class SyncedEntry : ISynced { private readonly ConfigEntry local; private readonly string key; private bool hasServer; private T server; public T Value { get { if (!hasServer || !Net.IsRemoteClient) { return local.Value; } return server; } } public string Key => key; public SyncedEntry(ConfigFile cfg, string section, string name, T defaultValue, string description) { local = cfg.Bind(section, name, defaultValue, description + " [synced from the server]"); key = section + "." + name; Net.All.Add(this); local.SettingChanged += delegate { Net.PushToServer(key, Serialize()); }; } public string Serialize() { return Convert.ToString(local.Value, CultureInfo.InvariantCulture); } public void SetServer(string value) { try { server = (T)Convert.ChangeType(value, typeof(T), CultureInfo.InvariantCulture); hasServer = true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Bad synced value for " + key + ": " + ex.Message)); } } public void ClearServer() { hasServer = false; } public bool ApplyLocal(string value) { try { T val = (T)Convert.ChangeType(value, typeof(T), CultureInfo.InvariantCulture); if (!object.Equals(local.Value, val)) { local.Value = val; } return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Bad value for " + key + ": " + ex.Message)); return false; } } } public static class Net { public static readonly List All = new List(); public static ConfigEntry LockConfiguration; public static bool ServerLocked; public static bool IsRemoteClient { get { if ((Object)(object)ZNet.instance != (Object)null) { return !ZNet.instance.IsServer(); } return false; } } public static void Hook(ConfigFile cfg) { cfg.SettingChanged += delegate { if ((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsServer()) { BroadcastConfig(); } }; } public static void BroadcastConfig() { try { foreach (ZNetPeer peer in ZNet.instance.GetPeers()) { if (peer != null && peer.IsReady()) { SendConfig(peer.m_rpc); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not broadcast settings: " + ex.Message)); } } public static void PushToServer(string key, string value) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown try { if (IsRemoteClient && ServerLocked && !((Object)(object)ZNet.instance == (Object)null)) { ZRpc serverRPC = ZNet.instance.GetServerRPC(); if (serverRPC == null) { Plugin.Log.LogWarning((object)("No server connection to send " + key)); return; } Plugin.Log.LogInfo((object)("Sending " + key + " = " + value + " to the server (applied only if you are an admin)")); ZPackage val = new ZPackage(); val.Write(key); val.Write(value); serverRPC.Invoke("VR_SetConfig", new object[1] { val }); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not send setting to the server: " + ex.Message)); } } public static void RPC_SetConfig(ZRpc rpc, ZPackage pkg) { string text = pkg.ReadString(); string text2 = pkg.ReadString(); if ((Object)(object)ZNet.instance == (Object)null || !ZNet.instance.IsServer()) { return; } string hostName = rpc.GetSocket().GetHostName(); if (!ZNet.instance.IsAdmin(hostName)) { Plugin.Log.LogWarning((object)("Rejected setting change " + text + " from non-admin " + hostName)); return; } foreach (ISynced item in All) { if (item.Key == text) { if (item.ApplyLocal(text2)) { Plugin.Log.LogInfo((object)("Admin " + hostName + " changed " + text + " = " + text2)); } break; } } } public static void ClearServer() { foreach (ISynced item in All) { item.ClearServer(); } } public static void SendConfig(ZRpc rpc) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown ZPackage val = new ZPackage(); bool flag = LockConfiguration == null || LockConfiguration.Value; val.Write(flag); val.Write(flag ? All.Count : 0); if (flag) { foreach (ISynced item in All) { val.Write(item.Key); val.Write(item.Serialize()); } } rpc.Invoke("VR_Config", new object[1] { val }); ZPackage val2 = new ZPackage(); val2.Write(flag ? NodeConfig.ServerText() : ""); rpc.Invoke("VR_Nodes", new object[1] { val2 }); } public static void RPC_Nodes(ZRpc rpc, ZPackage pkg) { NodeConfig.SetServer(pkg.ReadString()); } public static void RPC_Config(ZRpc rpc, ZPackage pkg) { bool num = (ServerLocked = pkg.ReadBool()); int num2 = pkg.ReadInt(); if (!num) { ClearServer(); Talents.Dirty = true; Plugin.Log.LogInfo((object)"Server does not lock the configuration; using local settings."); return; } Dictionary dictionary = new Dictionary(); for (int i = 0; i < num2; i++) { dictionary[pkg.ReadString()] = pkg.ReadString(); } foreach (ISynced item in All) { if (dictionary.TryGetValue(item.Key, out var value)) { item.SetServer(value); } } Talents.Dirty = true; Plugin.Log.LogInfo((object)("Server settings received (" + dictionary.Count + " values).")); } public static void RPC_KillXp(long sender, float maxHealth, bool boss, Vector3 pos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) KillRewards.Grant(maxHealth, boss, pos); } } public static class KillRewards { public static void Grant(float maxHealth, bool boss, Vector3 pos) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0099: Unknown result type (might be due to invalid IL or missing references) RpgData data = Plugin.Data; Player localPlayer = Player.m_localPlayer; if (data != null && !((Object)(object)localPlayer == (Object)null) && data.Class != RpgClass.None) { float num = maxHealth * 0.5f * Plugin.XpMultiplier.Value * (1f + Stats.Get(Eff.Experience)); if (boss) { num *= 3f; } int num2 = Mathf.Max(1, Mathf.RoundToInt(num)); data.AddXp(num2); if (Plugin.ShowXpFloater.Value) { Floaters.Add(pos + Vector3.up * 1.2f, "+" + num2 + " XP", Floaters.XpColor, 15, 1.6f); } float num3 = Stats.Get(Eff.KillHeal); if (num3 > 0f) { ((Character)localPlayer).Heal(((Character)localPlayer).GetMaxHealth() * num3, true); } } } } [HarmonyPatch(typeof(ZNet), "OnNewConnection")] internal static class NetConnect { private static void Postfix(ZNetPeer peer) { peer.m_rpc.Register("VR_Config", (Action)Net.RPC_Config); peer.m_rpc.Register("VR_Nodes", (Action)Net.RPC_Nodes); peer.m_rpc.Register("VR_SetConfig", (Action)Net.RPC_SetConfig); if (Net.IsRemoteClient) { Net.ClearServer(); NodeConfig.ClearServer(); Net.ServerLocked = false; } } } [HarmonyPatch(typeof(ZNet), "RPC_PeerInfo")] internal static class NetPeerInfo { private static void Postfix(ZNet __instance, ZRpc rpc) { if (!__instance.IsServer()) { return; } try { Net.SendConfig(rpc); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not send settings to a peer: " + ex.Message)); } } } [HarmonyPatch(typeof(Game), "Start")] internal static class NetGameStart { private static void Postfix() { if (ZRoutedRpc.instance != null) { ZRoutedRpc.instance.Register("VR_KillXp", (Action)Net.RPC_KillXp); } } } public static class NodeConfig { private static readonly Dictionary defaults = new Dictionary(); private static Dictionary local = new Dictionary(); private static Dictionary server = new Dictionary(); private static bool hasServer; private static DateTime stamp; private static float nextCheck; public static string FilePath => Path.Combine(Paths.ConfigPath, Path.Combine("ValheimReforged", "Nodes.yml")); private static string SkillKey(Ability a, string field) { return "skill." + a.Id + "." + field; } private static string TalentKey(TNode n, string field) { return "talent." + n.Id + "." + field; } private static string PerkKey(TalentPerk p) { return "perk." + p; } public static void Init() { try { foreach (Ability item in Abilities.All) { defaults[SkillKey(item, "maxRank")] = item.MaxRank; defaults[SkillKey(item, "cost")] = item.Cost; if (item.Active) { defaults[SkillKey(item, "cooldown")] = item.Cooldown; defaults[SkillKey(item, "power")] = item.Power; } else { defaults[SkillKey(item, "value")] = item.PerRank; } } foreach (TNode item2 in Talents.All) { if (!item2.IsOrigin) { defaults[TalentKey(item2, "cost")] = item2.Cost; defaults[TalentKey(item2, "maxRank")] = item2.MaxRank; defaults[TalentKey(item2, "power")] = item2.Power; } } foreach (TalentPerk value in Enum.GetValues(typeof(TalentPerk))) { if (value != TalentPerk.None) { defaults[PerkKey(value)] = Talents.PerkValue(value); } } LoadLocal(); WriteFile(); Apply(local); Plugin.Log.LogInfo((object)("Node settings: " + FilePath + " (" + defaults.Count + " values)")); } catch (Exception ex) { Plugin.Log.LogWarning((object)("NodeConfig.Init: " + ex.Message)); } } private static Dictionary Parse(string text) { Dictionary dictionary = new Dictionary(); string[] array = text.Split(new char[1] { '\n' }); for (int i = 0; i < array.Length; i++) { string text2 = array[i].Trim(new char[1] { '\r' }).Trim(); if (text2.Length != 0 && text2[0] != '#') { int num = text2.IndexOf(':'); if (num > 0 && float.TryParse(text2.Substring(num + 1).Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { dictionary[text2.Substring(0, num).Trim()] = result; } } } return dictionary; } private static void LoadLocal() { local = new Dictionary(); if (File.Exists(FilePath)) { local = Parse(File.ReadAllText(FilePath, Encoding.UTF8)); stamp = File.GetLastWriteTimeUtc(FilePath); } } private static string Num(float v) { return v.ToString("0.#####", CultureInfo.InvariantCulture); } private static void WriteFile() { StringBuilder sb = new StringBuilder(); Action line = delegate(string s) { sb.Append(s).Append('\n'); }; Action action = delegate(string k) { if (!local.TryGetValue(k, out var value)) { value = defaults[k]; } line(k + ": " + Num(value)); }; line("# Valheim Reforged - values of every node. Edit the numbers and save; the game applies them while running."); line("# With LockConfiguration = true on the server, the server's file overrides every client."); line("#"); line("# skill..maxRank / cost ranks the node can have / skill points per rank"); line("# skill..value passive: bonus per rank (0.02 = 2%; flat amount for health/stamina/eitr)"); line("# skill..cooldown / power active: cooldown in seconds / damage and effect multiplier"); line("# talent..cost / maxRank / power talent points per rank / ranks / multiplier of the node's bonuses"); line("# perk. strength per rank of each branch keystone effect"); line(""); RpgClass[] array = new RpgClass[4] { RpgClass.Warrior, RpgClass.Archer, RpgClass.Mage, RpgClass.Rogue }; for (int num = 0; num < array.Length; num++) { RpgClass c = array[num]; line("# ===== " + c.ToString() + " skills ====="); foreach (Ability item in Abilities.For(c)) { line("# " + item.Id + (item.Active ? " (active)" : " (passive)")); action(SkillKey(item, "maxRank")); action(SkillKey(item, "cost")); if (item.Active) { action(SkillKey(item, "cooldown")); action(SkillKey(item, "power")); } else { action(SkillKey(item, "value")); } } line(""); } line("# ===== keystone perks ====="); foreach (TalentPerk value2 in Enum.GetValues(typeof(TalentPerk))) { if (value2 != TalentPerk.None) { action(PerkKey(value2)); } } line(""); string text = null; foreach (TNode item2 in Talents.All) { if (!item2.IsOrigin) { if (item2.Group != text) { text = item2.Group; line(""); line("# ===== talents: " + text + " ====="); } line("# " + item2.Id + " (" + item2.Tier.ToString() + ")"); action(TalentKey(item2, "cost")); action(TalentKey(item2, "maxRank")); action(TalentKey(item2, "power")); } } Directory.CreateDirectory(Path.GetDirectoryName(FilePath)); string text2 = sb.ToString(); if (!File.Exists(FilePath) || File.ReadAllText(FilePath, Encoding.UTF8).Replace("\r\n", "\n") != text2) { File.WriteAllText(FilePath, text2.Replace("\n", "\r\n"), new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); } stamp = File.GetLastWriteTimeUtc(FilePath); } private static void Apply(Dictionary map) { Func func = delegate(string k) { if (map.TryGetValue(k, out var value)) { return value; } return (!defaults.TryGetValue(k, out value)) ? 0f : value; }; foreach (Ability item in Abilities.All) { item.MaxRank = Math.Max(1, (int)Math.Round(func(SkillKey(item, "maxRank")))); item.Cost = Math.Max(1, (int)Math.Round(func(SkillKey(item, "cost")))); if (item.Active) { item.Cooldown = Math.Max(0f, func(SkillKey(item, "cooldown"))); item.Power = Math.Max(0f, func(SkillKey(item, "power"))); } else { item.PerRank = func(SkillKey(item, "value")); } } foreach (TNode item2 in Talents.All) { if (!item2.IsOrigin) { item2.CostOverride = Math.Max(1, (int)Math.Round(func(TalentKey(item2, "cost")))); item2.MaxRankOverride = Math.Max(1, (int)Math.Round(func(TalentKey(item2, "maxRank")))); item2.Power = Math.Max(0f, func(TalentKey(item2, "power"))); } } foreach (TalentPerk value2 in Enum.GetValues(typeof(TalentPerk))) { if (value2 != TalentPerk.None) { Talents.PerkOver[value2] = func(PerkKey(value2)); } } Talents.Dirty = true; } public static void Tick() { if (Time.realtimeSinceStartup < nextCheck) { return; } nextCheck = Time.realtimeSinceStartup + 2f; try { if (!File.Exists(FilePath)) { WriteFile(); } else if (!(File.GetLastWriteTimeUtc(FilePath) == stamp)) { LoadLocal(); if (!hasServer || !Net.IsRemoteClient) { Apply(local); } if ((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsServer()) { Net.BroadcastConfig(); } Plugin.Log.LogInfo((object)"Node settings reloaded."); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("NodeConfig.Tick: " + ex.Message)); } } public static string ServerText() { try { return File.Exists(FilePath) ? File.ReadAllText(FilePath, Encoding.UTF8) : ""; } catch { return ""; } } public static void SetServer(string text) { if (string.IsNullOrEmpty(text)) { ClearServer(); return; } server = Parse(text); hasServer = true; Apply(server); Plugin.Log.LogInfo((object)("Node settings received from the server (" + server.Count + " values).")); } public static void ClearServer() { if (hasServer) { hasServer = false; Apply(local); } } } [BepInPlugin("com.yeyian.valheimreforged", "Reforged Classes", "0.1.0")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; public static RpgData Data; public static SyncedEntry MaxLevel; public static SyncedEntry PointsPerLevel; public static SyncedEntry TalentPointsPerLevel; public static SyncedEntry TalentPointsPerBoss; public static SyncedEntry TranscendMax; public static SyncedEntry TalentPointsPerTranscend; public static SyncedEntry XpMultiplier; public static SyncedEntry XpBase; public static SyncedEntry XpExponent; public static SyncedEntry TalentPower; public static SyncedEntry AbilityDamage; public static SyncedEntry DisableVanillaSkillGain; public static SyncedEntry AllowRefund; public static ConfigEntry ShowXpFloater; public static ConfigEntry ShowCombatText; public static ConfigEntry MenuKey; public static ConfigEntry HudX; public static ConfigEntry HudY; public static ConfigEntry[] AbilityKeys = new ConfigEntry[2]; private float regenTimer; private void Awake() { //IL_0301: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Net.LockConfiguration = ((BaseUnityPlugin)this).Config.Bind("Servidor", "LockConfiguration", true, "Server only. When true, this server's settings override the clients' (sent on connect and whenever this file changes). When false, every client uses its own settings."); Net.Hook(((BaseUnityPlugin)this).Config); MaxLevel = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "MaxLevel", 50, "Maximum character level"); PointsPerLevel = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "PointsPerLevel", 1, "Skill points per level"); TalentPointsPerLevel = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "TalentPointsPerLevel", 1, "Talent tree points per level"); TalentPointsPerBoss = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "TalentPointsPerBoss", 3, "Talent tree points per defeated boss"); TranscendMax = new SyncedEntry(((BaseUnityPlugin)this).Config, "Transcendência", "MaxTranscendences", 10, "How many times a character can transcend at the maximum level (0 disables transcendence)"); TalentPointsPerTranscend = new SyncedEntry(((BaseUnityPlugin)this).Config, "Transcendência", "TalentPointsPerTranscendence", 10, "Extra talent points granted for each transcendence"); XpMultiplier = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "XpMultiplier", 1f, "XP multiplier per kill"); XpBase = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "XpBase", 90f, "XP needed to go from level 1 to 2; each next level needs XpBase * level ^ XpExponent"); XpExponent = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "XpExponent", 1.3f, "How fast the XP needed per level grows"); TalentPower = new SyncedEntry(((BaseUnityPlugin)this).Config, "Equilíbrio", "TalentPower", 1f, "Multiplier applied to every bonus of the Talents tab"); AbilityDamage = new SyncedEntry(((BaseUnityPlugin)this).Config, "Equilíbrio", "AbilityDamage", 1f, "Multiplier applied to the damage of active abilities"); DisableVanillaSkillGain = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "DisableVanillaSkillGain", defaultValue: true, "Disables skill gain by use; skills scale with the character level instead"); AllowRefund = new SyncedEntry(((BaseUnityPlugin)this).Config, "Progressão", "AllowRefund", defaultValue: true, "Allows refunding talent points with Ctrl+click (free)"); ShowXpFloater = ((BaseUnityPlugin)this).Config.Bind("Interface", "ShowXpFloater", true, "Shows gained XP as floating text over the slain monster"); ShowCombatText = ((BaseUnityPlugin)this).Config.Bind("Interface", "ShowCombatText", true, "Shows floating text for critical hits, execute and opening bonuses"); HudX = ((BaseUnityPlugin)this).Config.Bind("Interface", "HudX", 250f, "Distance in pixels (at 1080p) from the left edge of the screen to the level medallion; the ability slots follow it"); HudY = ((BaseUnityPlugin)this).Config.Bind("Interface", "HudY", 116f, "Distance in pixels (at 1080p) from the bottom edge of the screen to the top of the ability slots"); MenuKey = ((BaseUnityPlugin)this).Config.Bind("Teclas", "Menu", (KeyCode)107, "Opens the RPG panel"); KeyCode[] array = (KeyCode[])(object)new KeyCode[2] { (KeyCode)118, (KeyCode)98 }; for (int i = 0; i < 2; i++) { AbilityKeys[i] = ((BaseUnityPlugin)this).Config.Bind("Teclas", "Ability" + (i + 1), array[i], "Skill bar active ability, slot " + (i + 1)); } NodeConfig.Init(); new Harmony("com.yeyian.valheimreforged").PatchAll(); } public static void LevelBonus(RpgClass c, int level, out float hp, out float stamina, out float eitr) { int num = level - 1; hp = (stamina = (eitr = 0f)); switch (c) { case RpgClass.Warrior: hp = (float)num * 4f; stamina = (float)num * 1f; break; case RpgClass.Archer: hp = (float)num * 2f; stamina = (float)num * 1.5f; break; case RpgClass.Mage: hp = (float)num * 1f; eitr = (float)num * 3f; break; case RpgClass.Rogue: hp = (float)num * 2f; stamina = (float)num * 2f; break; } } private void Update() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) NodeConfig.Tick(); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { Data = null; return; } if (Data == null) { Data = RpgData.Load(localPlayer); } regenTimer += Time.deltaTime; if (regenTimer >= 1f && Data.Class != RpgClass.None) { regenTimer = 0f; float num = Stats.Get(Eff.HealthRegen); float num2 = Stats.Get(Eff.StaminaRegen); float num3 = Stats.Get(Eff.EitrRegen); if (num > 0f && ((Character)localPlayer).GetHealth() < ((Character)localPlayer).GetMaxHealth()) { ((Character)localPlayer).Heal(num, false); } if (num2 > 0f) { ((Character)localPlayer).AddStamina(num2); } if (num3 > 0f) { ((Character)localPlayer).AddEitr(num3); } } if (Ui.Open && Input.GetKeyDown((KeyCode)27)) { Ui.Open = false; } else if (Input.GetKeyDown(MenuKey.Value) && !Ui.BlockedByOtherUi()) { Ui.Open = !Ui.Open; } if (Ui.Open || Ui.BlockedByOtherUi() || Data.Class == RpgClass.None) { return; } for (int i = 0; i < 2; i++) { if (Input.GetKeyDown(AbilityKeys[i].Value)) { Abilities.Cast(localPlayer, Data, i); } } } private void FixedUpdate() { if ((Object)(object)Player.m_localPlayer != (Object)null) { Dash.Step(Player.m_localPlayer); } } private void OnGUI() { Ui.Draw(); } } [HarmonyPatch(typeof(Character), "OnDeath")] internal static class KillXp { private static void Postfix(Character __instance) { //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_0060: 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) if (__instance is Player) { return; } HitData value = Traverse.Create((object)__instance).Field("m_lastHit").GetValue(); Player val = (Player)((value != null) ? /*isinst with value type is only supported in some contexts*/: null); if ((Object)(object)val == (Object)null) { return; } float maxHealth = __instance.GetMaxHealth(); bool flag = __instance.IsBoss(); Vector3 centerPoint = __instance.GetCenterPoint(); if ((Object)(object)val == (Object)(object)Player.m_localPlayer) { KillRewards.Grant(maxHealth, flag, centerPoint); return; } ZNetView component = ((Component)val).GetComponent(); if (ZRoutedRpc.instance != null && (Object)(object)component != (Object)null && component.GetZDO() != null) { ZRoutedRpc.instance.InvokeRoutedRPC(component.GetZDO().GetOwner(), "VR_KillXp", new object[3] { maxHealth, flag, centerPoint }); } } } [HarmonyPatch(typeof(Skills), "RaiseSkill")] internal static class NoSkillGain { internal static bool Prefix() { return !Plugin.DisableVanillaSkillGain.Value; } } [HarmonyPatch(typeof(Skill), "Raise")] internal static class NoSkillRaise { private static bool Prefix(ref bool __result) { if (!NoSkillGain.Prefix()) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(Skills), "GetSkillLevel")] internal static class SkillFollowsLevel { internal static bool Primary(RpgClass c, SkillType t) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Invalid comparison between Unknown and I4 //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 switch (c) { case RpgClass.Warrior: if ((int)t != 1 && (int)t != 7 && (int)t != 3 && (int)t != 4) { return (int)t == 6; } return true; case RpgClass.Archer: if ((int)t != 8 && (int)t != 14 && (int)t != 5) { return (int)t == 100; } return true; case RpgClass.Mage: if ((int)t != 9) { return (int)t == 10; } return true; case RpgClass.Rogue: if ((int)t != 2 && (int)t != 101 && (int)t != 11) { return (int)t == 102; } return true; default: return false; } } private static void Postfix(Skills __instance, SkillType skillType, ref float __result) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Invalid comparison between Unknown and I4 RpgData data = Plugin.Data; Player localPlayer = Player.m_localPlayer; if (data != null && !((Object)(object)localPlayer == (Object)null) && data.Class != RpgClass.None && Plugin.DisableVanillaSkillGain.Value && !((Object)(object)((Character)localPlayer).GetSkills() != (Object)(object)__instance)) { float num = (float)data.Level / (float)Plugin.MaxLevel.Value; float num2 = (Primary(data.Class, skillType) ? 1f : 0.5f); float num3 = Mathf.Max(__result, Mathf.Floor(num * num2 * 100f)); if ((int)skillType == 104) { num3 += Stats.Get(Eff.FishingSkill); } __result = num3; } } } [HarmonyPatch(typeof(SkillsDialog), "Setup")] internal static class SkillsDialogNote { private static Transform Deep(Transform t, string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown foreach (Transform item in t) { Transform val = item; if (((Object)val).name == name) { return val; } Transform val2 = Deep(val, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } private static void Postfix(SkillsDialog __instance) { try { if (Plugin.Data == null || Plugin.Data.Class == RpgClass.None || !Plugin.DisableVanillaSkillGain.Value) { return; } IList value = Traverse.Create((object)__instance).Field("m_elements").GetValue(); if (value != null) { foreach (object item in value) { GameObject val = (GameObject)((item is GameObject) ? item : null); Transform val2 = (((Object)(object)val != (Object)null) ? Deep(val.transform, "currentlevel") : null); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(false); } } } object value2 = Traverse.Create((object)__instance).Field("m_totalSkillText").GetValue(); if (value2 != null) { PropertyInfo property = value2.GetType().GetProperty("text"); if (property != null) { property.SetValue(value2, L.T("skills.dialog_note"), null); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("SkillsDialogNote: " + ex.Message)); } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] internal static class ClassStats { private static void Postfix(Player __instance, ref float hp, ref float stamina, ref float eitr) { RpgData data = Plugin.Data; if (data != null && !((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && data.Class != RpgClass.None) { Plugin.LevelBonus(data.Class, data.Level, out var hp2, out var stamina2, out var eitr2); hp += hp2; stamina += stamina2; eitr += eitr2; hp += Stats.Get(Eff.MaxHealth); stamina += Stats.Get(Eff.MaxStamina); eitr += Stats.Get(Eff.MaxEitr); } } } [HarmonyPatch(typeof(Player), "GetEquipmentMovementModifier")] internal static class RogueSpeed { private static void Postfix(Player __instance, ref float __result) { if (Plugin.Data != null && (Object)(object)__instance == (Object)(object)Player.m_localPlayer) { __result += Stats.Get(Eff.MoveSpeed); } } } [HarmonyPatch(typeof(Character), "Damage")] internal static class DamageModifiers { private static void Prefix(Character __instance, HitData hit) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected I4, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Invalid comparison between Unknown and I4 //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0151: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_0270: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || Plugin.Data == null || Plugin.Data.Class == RpgClass.None || hit == null || (Object)(object)hit.GetAttacker() != (Object)(object)localPlayer) { return; } float num = 1f + Stats.Get(Eff.Damage); SkillType skill = hit.m_skill; switch (skill - 1) { case 0: case 1: case 2: case 3: case 4: case 6: case 10: num += Stats.Get(Eff.MeleeDamage); break; case 7: case 13: num += Stats.Get(Eff.RangedDamage); break; case 8: case 9: num += Stats.Get(Eff.MagicDamage); break; } num += TalentPerks.WeaponBonus(hit.m_skill); num *= TalentPerks.DamageMultiplier(localPlayer, __instance, hit); if ((int)hit.m_skill == 10) { int num2 = Talents.PerkRank(TalentPerk.Siphon); if (num2 > 0) { ((Character)localPlayer).AddEitr(Talents.PerkValue(TalentPerk.Siphon) * (float)num2); } } float healthPercentage = __instance.GetHealthPercentage(); float num3 = Stats.Get(Eff.Execute); float num4 = Stats.Get(Eff.Opening); Vector3 val = ((hit.m_point != Vector3.zero) ? hit.m_point : __instance.GetCenterPoint()); int instanceID = ((Object)__instance).GetInstanceID(); if (healthPercentage < 0.3f && num3 > 0f) { num += num3; if (Plugin.ShowCombatText.Value) { Floaters.Add(val + Vector3.up * 0.5f, L.T("combat.execute"), Floaters.ExecuteColor, 16, 1f, "ex" + instanceID, 0.8f); } } if (healthPercentage > 0.8f && num4 > 0f) { num += num4; if (Plugin.ShowCombatText.Value) { Floaters.Add(val + Vector3.up * 0.5f, L.T("combat.opening"), Floaters.OpeningColor, 16, 1f, "op" + instanceID, 0.8f); } } bool num5 = Random.value < Stats.Get(Eff.Crit); if (num5) { num *= 1.75f; } if (num != 1f) { ((DamageTypes)(ref hit.m_damage)).Modify(num); } if (num5 && Plugin.ShowCombatText.Value) { Floaters.Add(val + Vector3.up * 0.2f, L.F("combat.crit", Mathf.RoundToInt(hit.GetTotalDamage())), Floaters.CritColor, 22); } float num6 = Stats.Get(Eff.LifeSteal); if (num6 > 0f) { ((Character)localPlayer).Heal(Mathf.Min(hit.GetTotalDamage() * num6, ((Character)localPlayer).GetMaxHealth() * 0.25f), false); } } } [HarmonyPatch(typeof(Player), "UseStamina")] internal static class StaminaCostPatch { private static void Prefix(Player __instance, ref float __0) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && Plugin.Data != null) { float num = Mathf.Min(0.6f, Stats.Get(Eff.StaminaCost)); if (num > 0f) { __0 *= 1f - num; } int num2 = (((Character)__instance).IsSwimming() ? Talents.PerkRank(TalentPerk.Swimmer) : 0); if (num2 > 0) { __0 *= Mathf.Max(0.1f, 1f - Talents.PerkValue(TalentPerk.Swimmer) * (float)num2 / 100f); } } } } [HarmonyPatch(typeof(Skills), "LowerAllSkills")] internal static class NoSkillLossOnDeath { private static bool Prefix() { return !Plugin.DisableVanillaSkillGain.Value; } } [HarmonyPatch(typeof(Character), "RPC_Damage")] internal static class VictimModifiers { private static void Prefix(Character __instance, HitData hit) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)__instance != (Object)(object)localPlayer) && !((Object)(object)localPlayer == (Object)null) && Plugin.Data != null && Plugin.Data.Class != RpgClass.None && hit != null) { float num = Mathf.Min(0.8f, Stats.Get(Eff.Resist)); if (num > 0f) { ((DamageTypes)(ref hit.m_damage)).Modify(1f - num); } float num2 = Mathf.Min(0.75f, Stats.Get(Eff.ElementalResist)); if (num2 > 0f) { hit.m_damage.m_fire *= 1f - num2; hit.m_damage.m_frost *= 1f - num2; hit.m_damage.m_lightning *= 1f - num2; hit.m_damage.m_poison *= 1f - num2; hit.m_damage.m_spirit *= 1f - num2; } } } } public enum RpgClass { None, Warrior, Archer, Mage, Rogue } public class RpgData { private const string Key = "VR_Data"; public int Level = 1; public long Xp; public RpgClass Class; public int Points; public int Trans; public readonly Dictionary Ranks = new Dictionary(); public readonly Dictionary TalentRanks = new Dictionary(); public readonly string[] Slots = new string[2]; public int TalentBank => Trans * Plugin.TalentPointsPerTranscend.Value; public bool CanTranscend { get { if (Class != RpgClass.None && Level >= Plugin.MaxLevel.Value) { return Trans < Plugin.TranscendMax.Value; } return false; } } public static long XpForNext(int level) { return (long)((double)Plugin.XpBase.Value * Math.Pow(level, Plugin.XpExponent.Value)); } public int TalentRank(string id) { if (!TalentRanks.TryGetValue(id, out var value)) { return 0; } return value; } public string BuyTalent(TNode n) { if (n.IsOrigin) { return null; } if (TalentRank(n.Id) >= n.MaxRank) { return L.T("ui.rank_max"); } if (TalentRank(n.Id) == 0 && !Talents.IsAvailable(n, this)) { return L.T("msg.talent_neighbor"); } if (Talents.Available(this) < n.Cost) { return L.F("msg.talent_points_needed", n.Cost); } TalentRanks[n.Id] = TalentRank(n.Id) + 1; Talents.Dirty = true; Save(); return null; } public string RefundTalent(TNode n) { if (TalentRank(n.Id) == 0) { return L.T("msg.nothing_refund"); } if (!Talents.CanRefund(n, this)) { return L.T("msg.would_disconnect"); } int num = TalentRank(n.Id); if (num == 1) { TalentRanks.Remove(n.Id); } else { TalentRanks[n.Id] = num - 1; } Talents.Dirty = true; Save(); return null; } public void RespecTalents() { TalentRanks.Clear(); Talents.Dirty = true; Save(); } public int Rank(string id) { if (!Ranks.TryGetValue(id, out var value)) { return 0; } return value; } public void AddXp(long amount) { //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (Class != RpgClass.None && amount > 0) { Xp += amount; int level = Level; int points = Points; while (Level < Plugin.MaxLevel.Value && Xp >= XpForNext(Level)) { Xp -= XpForNext(Level); Level++; Points += Plugin.PointsPerLevel.Value; } if (Level > level && (Object)(object)Player.m_localPlayer != (Object)null) { ((Character)Player.m_localPlayer).Message((MessageType)2, L.F("msg.level_up", Level, Points - points, (Level - level) * Plugin.TalentPointsPerLevel.Value), 0, (Sprite)null, false); Vfx.LevelUp(((Component)Player.m_localPlayer).transform.position); } if (Level >= Plugin.MaxLevel.Value) { Xp = 0L; } Save(); } } public void Transcend() { //IL_015b: Unknown result type (might be due to invalid IL or missing references) if (!CanTranscend) { Plugin.Log.LogInfo((object)("Transcend refused: class=" + Class.ToString() + " level=" + Level + "/" + Plugin.MaxLevel.Value + " transcendences=" + Trans + "/" + Plugin.TranscendMax.Value)); return; } Trans++; Level = 1; Xp = 0L; Points = 0; Ranks.Clear(); TalentRanks.Clear(); for (int i = 0; i < Slots.Length; i++) { Slots[i] = null; } Buffs.Clear(); Talents.Dirty = true; Save(); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, L.F("msg.transcended", Trans, Plugin.TalentPointsPerTranscend.Value), 0, (Sprite)null, false); Vfx.LevelUp(((Component)localPlayer).transform.position); } } public void ChooseClass(RpgClass c) { if (Class == RpgClass.None) { Class = c; Save(); } } public bool Available(Ability a) { if (a.Parent != null) { return Rank(a.Parent) > 0; } return true; } public bool Spend(Ability a) { if (Points < a.Cost || Rank(a.Id) >= a.MaxRank || !Available(a)) { return false; } Points -= a.Cost; Ranks[a.Id] = Rank(a.Id) + 1; if (a.Active) { AutoEquip(a.Id); } Save(); return true; } public void SpendAll(Ability a) { while (Spend(a)) { } } public string Refund(Ability a) { int num = Rank(a.Id); if (num <= 0) { return L.T("msg.nothing_refund"); } if (num == 1) { foreach (Ability item in Abilities.For(Class)) { if (item.Parent == a.Id && Rank(item.Id) > 0) { return L.F("msg.refund_first", item.Name); } } } Points += a.Cost; if (num == 1) { Ranks.Remove(a.Id); for (int i = 0; i < Slots.Length; i++) { if (Slots[i] == a.Id) { Slots[i] = null; } } } else { Ranks[a.Id] = num - 1; } Save(); return null; } public string EquipTo(Ability a, int slot) { if (!a.Active || Rank(a.Id) == 0) { return L.T("msg.buy_first"); } int num = Array.IndexOf(Slots, a.Id); string text = Slots[slot]; Slots[slot] = a.Id; if (num >= 0 && num != slot) { Slots[num] = text; } Save(); return L.F("msg.in_slot", a.Name, slot + 1); } private void AutoEquip(string id) { if (Array.IndexOf(Slots, id) >= 0) { return; } for (int i = 0; i < Slots.Length; i++) { if (Slots[i] == null) { Slots[i] = id; break; } } } public string ToggleSlot(Ability a) { if (!a.Active || Rank(a.Id) == 0) { return L.T("msg.buy_first"); } int num = Array.IndexOf(Slots, a.Id); if (num >= 0) { Slots[num] = null; Save(); return L.F("msg.removed", a.Name); } for (int i = 0; i < Slots.Length; i++) { if (Slots[i] == null) { Slots[i] = a.Id; Save(); return L.F("msg.equipped", a.Name); } } return L.T("msg.bar_full"); } public void ClearSlot(int i) { Slots[i] = null; Save(); } public void Respec() { int num = 0; foreach (KeyValuePair rank in Ranks) { Ability ability = Abilities.Find(rank.Key); num += rank.Value * (ability?.Cost ?? 1); } Points += num; Ranks.Clear(); for (int i = 0; i < Slots.Length; i++) { Slots[i] = null; } Buffs.Clear(); Class = RpgClass.None; Save(); } public void Save() { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } List list = new List(); foreach (KeyValuePair rank in Ranks) { list.Add(rank.Key + "=" + rank.Value); } List list2 = new List(); foreach (KeyValuePair talentRank in TalentRanks) { list2.Add(talentRank.Key + "=" + talentRank.Value); } localPlayer.m_customData["VR_Tal"] = string.Join(",", list2.ToArray()); Dictionary customData = localPlayer.m_customData; string[] obj = new string[7] { Level.ToString(), Xp.ToString(), null, null, null, null, null }; int num = (int)Class; obj[2] = num.ToString(); obj[3] = Points.ToString(); obj[4] = string.Join(",", list.ToArray()); obj[5] = string.Join(",", Slots.Select((string x) => x ?? "").ToArray()); obj[6] = Trans.ToString(); customData["VR_Data"] = string.Join(";", obj); } public static RpgData Load(Player p) { RpgData rpgData = new RpgData(); Talents.Dirty = true; if (p.m_customData.TryGetValue("VR_Tal", out var value) && value.Length > 0) { string[] array = value.Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { '=' }); if (array2.Length == 2 && int.TryParse(array2[1], out var result) && Talents.Nodes.ContainsKey(array2[0])) { rpgData.TalentRanks[array2[0]] = result; } } } if (!p.m_customData.TryGetValue("VR_Data", out var value2)) { return rpgData; } try { string[] array3 = value2.Split(new char[1] { ';' }); rpgData.Level = int.Parse(array3[0], CultureInfo.InvariantCulture); rpgData.Xp = long.Parse(array3[1], CultureInfo.InvariantCulture); rpgData.Class = (RpgClass)int.Parse(array3[2], CultureInfo.InvariantCulture); rpgData.Points = int.Parse(array3[3], CultureInfo.InvariantCulture); if (array3.Length > 6) { int.TryParse(array3[6], out rpgData.Trans); } if (array3.Length > 5) { string[] array4 = array3[5].Split(new char[1] { ',' }); for (int j = 0; j < rpgData.Slots.Length && j < array4.Length; j++) { rpgData.Slots[j] = ((array4[j].Length > 0) ? array4[j] : null); } } if (array3.Length > 4 && array3[4].Length > 0) { string[] array = array3[4].Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { string[] array5 = array[i].Split(new char[1] { '=' }); rpgData.Ranks[array5[0]] = int.Parse(array5[1], CultureInfo.InvariantCulture); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Corrupt RPG data, resetting: " + ex.Message)); return new RpgData(); } for (int k = 0; k < rpgData.Slots.Length; k++) { if (rpgData.Slots[k] != null && (Abilities.Find(rpgData.Slots[k]) == null || !Abilities.Find(rpgData.Slots[k]).Active || rpgData.Rank(rpgData.Slots[k]) == 0)) { rpgData.Slots[k] = null; } } foreach (Ability item in Abilities.For(rpgData.Class)) { if (item.Active && rpgData.Rank(item.Id) > 0) { rpgData.AutoEquip(item.Id); } } return rpgData; } } public static class TalentPerks { private static readonly Dictionary swordHits = new Dictionary(); private static bool IsMelee(SkillType s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 if ((int)s != 1 && (int)s != 2 && (int)s != 7 && (int)s != 3 && (int)s != 11 && (int)s != 4) { return (int)s == 5; } return true; } public static float WeaponBonus(SkillType s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown return (s - 1) switch { 0 => Stats.Get(Eff.SwordDamage), 1 => Stats.Get(Eff.KnifeDamage), 6 => Stats.Get(Eff.AxeDamage), 2 => Stats.Get(Eff.ClubDamage), 7 => Stats.Get(Eff.BowDamage), 13 => Stats.Get(Eff.CrossbowDamage), 8 => Stats.Get(Eff.ElementalDamage), 9 => Stats.Get(Eff.BloodDamage), _ => 0f, }; } public static float DamageMultiplier(Player p, Character victim, HitData hit) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Invalid comparison between Unknown and I4 //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_0027: 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_00df: Invalid comparison between Unknown and I4 //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Invalid comparison between Unknown and I4 //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 //IL_018e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) float num = 1f; SkillType skill = hit.m_skill; int num2; if ((int)skill == 1 && (num2 = Talents.PerkRank(TalentPerk.Rhythm)) > 0) { ZDOID zDOID = ((Character)p).GetZDOID(); swordHits.TryGetValue(zDOID, out var value); if (++value >= 5) { value = 0; num *= 1f + Talents.PerkValue(TalentPerk.Rhythm) * (float)num2 / 100f; } if (swordHits.Count > 64) { swordHits.Clear(); } swordHits[zDOID] = value; } if (IsMelee(skill) && (num2 = Talents.PerkRank(TalentPerk.Assassin)) > 0 && ((Character)p).IsCrouching()) { num *= 1f + Talents.PerkValue(TalentPerk.Assassin) * (float)num2 / 100f; } if ((int)skill == 7 && (num2 = Talents.PerkRank(TalentPerk.Execute)) > 0 && victim.GetHealthPercentage() < 0.25f) { num *= 1f + Talents.PerkValue(TalentPerk.Execute) * (float)num2 / 100f; } if ((int)skill == 3 && (num2 = Talents.PerkRank(TalentPerk.Stagger)) > 0) { hit.m_staggerMultiplier *= 1f + Talents.PerkValue(TalentPerk.Stagger) * (float)num2 / 100f; } if ((int)skill == 8 && (num2 = Talents.PerkRank(TalentPerk.Sniper)) > 0 && Vector3.Distance(((Component)p).transform.position, ((Component)victim).transform.position) > 20f) { num *= 1f + Talents.PerkValue(TalentPerk.Sniper) * (float)num2 / 100f; } if ((int)skill == 14 && (num2 = Talents.PerkRank(TalentPerk.Opener)) > 0 && victim.GetHealthPercentage() >= 0.9f) { num *= 1f + Talents.PerkValue(TalentPerk.Opener) * (float)num2 / 100f; } if ((int)skill == 9 && (num2 = Talents.PerkRank(TalentPerk.Echo)) > 0 && Random.value * 100f < Talents.PerkValue(TalentPerk.Echo) * (float)num2) { num *= 2f; } return num; } } [HarmonyPatch(typeof(Player), "GetBodyArmor")] internal static class TalentArmor { private static void Postfix(Player __instance, ref float __result) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { float num = Stats.Get(Eff.ArmorBonus); if (num > 0f) { __result *= 1f + num; } } } } [HarmonyPatch] internal static class TalentGather { private static IEnumerable TargetMethods() { yield return AccessTools.Method(typeof(TreeBase), "RPC_Damage", (Type[])null, (Type[])null); yield return AccessTools.Method(typeof(TreeLog), "RPC_Damage", (Type[])null, (Type[])null); yield return AccessTools.Method(typeof(Destructible), "RPC_Damage", (Type[])null, (Type[])null); yield return AccessTools.Method(typeof(MineRock), "RPC_Hit", (Type[])null, (Type[])null); yield return AccessTools.Method(typeof(MineRock5), "RPC_Damage", (Type[])null, (Type[])null); } private static void Prefix(HitData hit) { try { Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer) && Plugin.Data != null) { float num = Stats.Get(Eff.MiningDamage); if (num > 0f && hit.m_damage.m_pickaxe > 0f) { hit.m_damage.m_pickaxe *= 1f + num; } int num2 = ((hit.m_damage.m_pickaxe > 0f) ? Talents.PerkRank(TalentPerk.Prospector) : 0); if (num2 > 0) { ((Character)val).AddStamina(Talents.PerkValue(TalentPerk.Prospector) * (float)num2); } int num3 = ((hit.m_damage.m_chop > 0f) ? Talents.PerkRank(TalentPerk.Woodsman) : 0); if (num3 > 0) { ((Character)val).AddStamina(Talents.PerkValue(TalentPerk.Woodsman) * (float)num3); } float num4 = Stats.Get(Eff.ChoppingDamage); if (num4 > 0f && hit.m_damage.m_chop > 0f) { hit.m_damage.m_chop *= 1f + num4; } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("TalentGather: " + ex.Message)); } } } [HarmonyPatch(typeof(Pickable), "Interact")] internal static class TalentHarvest { private static void Postfix(Pickable __instance, Humanoid character, bool __result) { try { Player val = (Player)(object)((character is Player) ? character : null); if (!__result || (Object)(object)val == (Object)null || (Object)(object)val != (Object)(object)Player.m_localPlayer) { return; } float num = Stats.Get(Eff.HarvestYield); int num2 = Talents.PerkRank(TalentPerk.Bountiful); if ((!(num <= 0f) || num2 != 0) && !((Object)(object)__instance.m_itemPrefab == (Object)null) && __instance.m_amount > 0) { float num3 = (float)__instance.m_amount * num; if (num2 > 0 && Random.value * 100f < Talents.PerkValue(TalentPerk.Bountiful) * (float)num2) { num3 += (float)__instance.m_amount; } int num4 = (int)num3; if (Random.value < num3 - (float)num4) { num4++; } if (num4 > 0) { Traverse.Create((object)__instance).Method("Drop", new object[3] { __instance.m_itemPrefab, 2, num4 }).GetValue(); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("TalentHarvest: " + ex.Message)); } } } [HarmonyPatch(typeof(Player), "EatFood")] internal static class TalentFood { private static void Postfix(Player __instance, ItemData item, bool __result) { try { if (!__result || (Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } int num = Talents.PerkRank(TalentPerk.Feast); if (num > 0) { ((Character)__instance).Heal(((Character)__instance).GetMaxHealth() * Talents.PerkValue(TalentPerk.Feast) * (float)num / 100f, true); } float num2 = Stats.Get(Eff.FoodDuration); if (num2 <= 0f) { return; } IList value = Traverse.Create((object)__instance).Field("m_foods").GetValue(); if (value == null) { return; } foreach (object item2 in value) { Traverse val = Traverse.Create(item2); ItemData value2 = val.Field("m_item").GetValue(); if (value2 != null && value2.m_shared.m_name == item.m_shared.m_name) { val.Field("m_time").SetValue((object)(val.Field("m_time").GetValue() * (1f + num2))); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("TalentFood: " + ex.Message)); } } } [HarmonyPatch(typeof(Attack), "UseAmmo")] internal static class TalentAmmoSave { private static void Postfix(Attack __instance, ItemData ammoItem, bool __result) { try { Humanoid value = Traverse.Create((object)__instance).Field("m_character").GetValue(); Player val = (Player)(object)((value is Player) ? value : null); if (__result && ammoItem != null && !((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer) && !((Object)(object)ammoItem.m_dropPrefab == (Object)null)) { float num = Mathf.Min(Stats.Get(Eff.AmmoSave), 0.75f); if (Buffs.Get(Eff.FreeAmmo) > 0f) { num = 1f; } if (num > 0f && Random.value < num) { ((Humanoid)val).GetInventory().AddItem(ammoItem.m_dropPrefab, 1); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("TalentAmmoSave: " + ex.Message)); } } } public enum NodeTier { Minor, Notable, Keystone } public enum TalentPerk { None, Rhythm, Assassin, Execute, Stagger, Sniper, Opener, Echo, Siphon, Prospector, Woodsman, Bountiful, Feast, Swimmer } public class EffectAmount { public Eff Effect; public float Factor; } public class TNode { public string Id; public string Group; public NodeTier Tier; public Vector2 Pos; public bool IsOrigin; public readonly List Effects = new List(); public readonly List Links = new List(); public TalentPerk Perk; public int CostOverride = -1; public int MaxRankOverride = -1; public float Power = 1f; public string Name => L.T("talent." + Id); public int Cost { get { if (!IsOrigin) { if (CostOverride < 0) { if (Tier != NodeTier.Keystone) { if (Tier != NodeTier.Notable) { return 1; } return 2; } return 3; } return CostOverride; } return 0; } } public int MaxRank { get { if (!IsOrigin) { if (MaxRankOverride < 0) { if (Tier != NodeTier.Keystone) { return 1; } return 3; } return MaxRankOverride; } return 1; } } public float TierMultiplier { get { if (Tier != NodeTier.Keystone) { if (Tier != NodeTier.Notable) { return 1f; } return 2f; } return 3f; } } public float Amount(EffectAmount e) { return e.Factor * Talents.BaseValue(e.Effect) * TierMultiplier * Power; } } public static class Talents { private class Arm { public string Group; public Eff P; public Eff C; public Eff A; public Eff B; } public const string OriginId = "origin"; public static readonly Dictionary Nodes; public static readonly List All; public static readonly List> Edges; public static readonly List Groups; public static readonly Dictionary ArmLabel; public static readonly Dictionary ArmKeystone; public static bool Dirty; private static readonly Dictionary cache; private static readonly Dictionary perkRanks; private static readonly Dictionary groupColors; public static readonly Dictionary PerkOver; private const float Spacing = 120f; private const float RailOffset = 1f; public const int FirstSpine = 2; public const int LastSpine = 11; public const int FirstRail = 6; private static readonly Arm[] Arms; private static readonly string[] SpineTemplate; private static readonly string[] LeftTemplate; private static readonly string[] RightTemplate; private static readonly string[] BridgesVitals; private static readonly string[] BridgesRecovery; private static readonly string[] BridgesLow; private static readonly string[] BridgesHigh; private static readonly string[] bossKeys; private static int bossCache; private static float bossCacheAt; public static float BaseValue(Eff e) { switch (e) { case Eff.Damage: return 0.01f; case Eff.MaxHealth: case Eff.MaxStamina: return 1f; case Eff.MaxEitr: return 5f; case Eff.MoveSpeed: return 0.01f; case Eff.FishingSkill: return 1f; case Eff.HarvestYield: return 0.03f; case Eff.LifeSteal: return 0.005f; case Eff.AmmoSave: return 0.015f; case Eff.HealthRegen: return 0.1f; case Eff.StaminaRegen: return 0.08f; case Eff.ElementalResist: return 0.01f; default: return 0.02f; } } public static string GroupName(string g) { return g; } public static Color GroupColor(string g) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!groupColors.TryGetValue(g, out var value)) { return new Color(0.95f, 0.82f, 0.45f); } return value; } public static string PerkText(TalentPerk p) { return L.T("perk." + p); } public static float PerkValue(TalentPerk p) { if (!PerkOver.TryGetValue(p, out var value)) { return PerkDefault(p); } return value; } private static float PerkDefault(TalentPerk p) { return p switch { TalentPerk.Rhythm => 75f, TalentPerk.Assassin => 40f, TalentPerk.Execute => 40f, TalentPerk.Stagger => 50f, TalentPerk.Sniper => 30f, TalentPerk.Opener => 25f, TalentPerk.Echo => 15f, TalentPerk.Siphon => 2f, TalentPerk.Prospector => 2f, TalentPerk.Woodsman => 2f, TalentPerk.Bountiful => 20f, TalentPerk.Feast => 10f, TalentPerk.Swimmer => 35f, _ => 0f, }; } private static TalentPerk PerkForGroup(string g) { return g switch { "Swords" => TalentPerk.Rhythm, "Knives" => TalentPerk.Assassin, "Axes" => TalentPerk.Execute, "Maces" => TalentPerk.Stagger, "Bows" => TalentPerk.Sniper, "Crossbows" => TalentPerk.Opener, "Elemental Magic" => TalentPerk.Echo, "Blood Magic" => TalentPerk.Siphon, "Mining" => TalentPerk.Prospector, "Woodcutting" => TalentPerk.Woodsman, "Farming" => TalentPerk.Bountiful, "Cooking" => TalentPerk.Feast, "Fishing" => TalentPerk.Swimmer, _ => TalentPerk.None, }; } private static Arm MakeArm(string group, Eff p, Eff c, Eff a, Eff b) { return new Arm { Group = group, P = p, C = c, A = a, B = b }; } private static TNode AddNode(string id, string name, string group, NodeTier tier, Vector2 pos, string effects) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) TNode tNode = new TNode { Id = id, Group = group, Tier = tier, Pos = pos }; if (!string.IsNullOrEmpty(effects)) { string[] array = effects.Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { ':' }); tNode.Effects.Add(new EffectAmount { Effect = (Eff)Enum.Parse(typeof(Eff), array2[0]), Factor = float.Parse(array2[1], CultureInfo.InvariantCulture) }); } } Nodes[id] = tNode; All.Add(tNode); return tNode; } private static void Link(string a, string b) { TNode tNode = Nodes[a]; TNode tNode2 = Nodes[b]; if (!tNode.Links.Contains(tNode2)) { tNode.Links.Add(tNode2); tNode2.Links.Add(tNode); Edges.Add(new KeyValuePair(tNode, tNode2)); } } private static NodeTier Tier(char c) { return c switch { 'n' => NodeTier.Notable, 'k' => NodeTier.Keystone, _ => NodeTier.Minor, }; } private static void AddEntry(string id, string entry, string group, Vector2 pos) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) string[] array = entry.Split(new char[1] { '|' }); AddNode(id, array[0], group, Tier(array[1][0]), pos, array[2]); } private static string Fill(Arm arm, string template) { string[] array = template.Split(new char[1] { '|' }); string[] array2 = array[1].Split(new char[1] { ',' }); for (int i = 0; i < array2.Length; i++) { string[] array3 = array2[i].Split(new char[1] { ':' }); array2[i] = (array3[0] switch { "P" => arm.P, "C" => arm.C, "A" => arm.A, _ => arm.B, }).ToString() + ":" + array3[1]; } return array[0] + "|" + string.Join(",", array2); } private static Vector2 Dir(float deg) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) float num = deg * ((float)Math.PI / 180f); return new Vector2(Mathf.Cos(num), Mathf.Sin(num)); } static Talents() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01e4: 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) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0a2c: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Unknown result type (might be due to invalid IL or missing references) //IL_0a42: Unknown result type (might be due to invalid IL or missing references) //IL_0a4c: Unknown result type (might be due to invalid IL or missing references) Nodes = new Dictionary(); All = new List(); Edges = new List>(); Groups = new List(); ArmLabel = new Dictionary(); ArmKeystone = new Dictionary(); Dirty = true; cache = new Dictionary(); perkRanks = new Dictionary(); groupColors = new Dictionary { { "Swords", new Color(0.92f, 0.36f, 0.26f) }, { "Knives", new Color(0.8f, 0.26f, 0.5f) }, { "Axes", new Color(0.95f, 0.55f, 0.2f) }, { "Maces", new Color(0.72f, 0.5f, 0.32f) }, { "Bows", new Color(0.46f, 0.82f, 0.36f) }, { "Crossbows", new Color(0.3f, 0.72f, 0.55f) }, { "Elemental Magic", new Color(0.42f, 0.62f, 1f) }, { "Blood Magic", new Color(0.7f, 0.25f, 0.85f) }, { "Mining", new Color(0.62f, 0.66f, 0.72f) }, { "Woodcutting", new Color(0.55f, 0.72f, 0.28f) }, { "Farming", new Color(0.85f, 0.8f, 0.25f) }, { "Cooking", new Color(0.9f, 0.45f, 0.35f) }, { "Fishing", new Color(0.3f, 0.65f, 0.9f) } }; PerkOver = new Dictionary(); Arms = new Arm[13] { MakeArm("Swords", Eff.SwordDamage, Eff.MeleeDamage, Eff.ArmorBonus, Eff.LifeSteal), MakeArm("Knives", Eff.KnifeDamage, Eff.MeleeDamage, Eff.MoveSpeed, Eff.StaminaRegen), MakeArm("Axes", Eff.AxeDamage, Eff.MeleeDamage, Eff.MaxHealth, Eff.HealthRegen), MakeArm("Maces", Eff.ClubDamage, Eff.MeleeDamage, Eff.ArmorBonus, Eff.ElementalResist), MakeArm("Bows", Eff.BowDamage, Eff.RangedDamage, Eff.AmmoSave, Eff.StaminaRegen), MakeArm("Crossbows", Eff.CrossbowDamage, Eff.RangedDamage, Eff.AmmoSave, Eff.ArmorBonus), MakeArm("Elemental Magic", Eff.ElementalDamage, Eff.MagicDamage, Eff.MaxEitr, Eff.ElementalResist), MakeArm("Blood Magic", Eff.BloodDamage, Eff.MagicDamage, Eff.MaxEitr, Eff.LifeSteal), MakeArm("Mining", Eff.MiningDamage, Eff.Experience, Eff.MaxStamina, Eff.HealthRegen), MakeArm("Woodcutting", Eff.ChoppingDamage, Eff.Experience, Eff.MaxStamina, Eff.StaminaRegen), MakeArm("Farming", Eff.HarvestYield, Eff.Experience, Eff.MaxHealth, Eff.HealthRegen), MakeArm("Cooking", Eff.FoodDuration, Eff.Experience, Eff.MaxHealth, Eff.StaminaRegen), MakeArm("Fishing", Eff.FishingSkill, Eff.Experience, Eff.MoveSpeed, Eff.ElementalResist) }; SpineTemplate = new string[10] { "m|P:1", "m|A:1", "n|P:1,C:1", "m|P:1", "m|B:1", "n|P:1,A:1", "m|P:1", "m|B:1", "n|P:2,B:1", "k|P:1,C:1,A:1" }; LeftTemplate = new string[5] { "m|P:1", "m|C:1", "n|P:1,C:1", "m|P:1", "n|P:2" }; RightTemplate = new string[5] { "m|A:1", "m|B:1", "n|A:1,B:1", "m|A:1", "n|A:1,P:1" }; BridgesVitals = new string[13] { "|m|MaxHealth:1", "|m|MaxStamina:1", "|m|MaxEitr:1", "|m|MaxHealth:1", "|m|MaxStamina:1", "|m|MaxEitr:1", "|m|MaxHealth:1", "|m|MaxStamina:1", "|m|MaxEitr:1", "|m|MaxHealth:1", "|m|MaxStamina:1", "|m|MaxEitr:1", "|m|MaxHealth:1" }; BridgesRecovery = new string[13] { "|m|HealthRegen:1", "|m|StaminaRegen:1", "|m|MoveSpeed:1", "|m|ElementalResist:1", "|m|ArmorBonus:1", "|m|HealthRegen:1", "|m|StaminaRegen:1", "|m|MoveSpeed:1", "|m|ElementalResist:1", "|m|ArmorBonus:1", "|m|HealthRegen:1", "|m|StaminaRegen:1", "|m|MoveSpeed:1" }; BridgesLow = new string[13] { "|m|Experience:1", "|m|MaxHealth:1", "|m|MaxStamina:1", "|m|ArmorBonus:1", "|m|MoveSpeed:1", "|m|Damage:1", "|m|MaxEitr:1", "|m|Experience:1", "|m|MaxHealth:1", "|m|StaminaRegen:1", "|m|ElementalResist:1", "|m|MoveSpeed:1", "|m|Experience:1" }; BridgesHigh = new string[13] { "|n|Experience:1,MoveSpeed:1", "|n|MaxHealth:1,ArmorBonus:1", "|n|MaxStamina:1,Experience:1", "|n|ArmorBonus:1,ElementalResist:1", "|n|MoveSpeed:1,MaxStamina:1", "|n|Damage:1,MaxHealth:1", "|n|MaxEitr:1,Experience:1", "|n|LifeSteal:1,Damage:1", "|n|HealthRegen:1,MaxHealth:1", "|n|Experience:1,ArmorBonus:1", "|n|MaxHealth:1,Experience:1", "|n|StaminaRegen:1,HealthRegen:1", "|n|Experience:1,MoveSpeed:1" }; bossKeys = new string[7] { "defeated_eikthyr", "defeated_gdking", "defeated_bonemass", "defeated_dragon", "defeated_goblinking", "defeated_queen", "defeated_fader" }; bossCacheAt = -99f; AddNode("origin", "Origin", "Origin", NodeTier.Minor, Vector2.zero, null).IsOrigin = true; int num = Arms.Length; for (int i = 0; i < num; i++) { Arm arm = Arms[i]; Groups.Add(arm.Group); float num2 = 90f - (float)i * 360f / (float)num; Vector2 val = Dir(num2); Vector2 val2 = Dir(num2 + 90f); Vector2 val3 = Dir(num2 - 90f); string text = "t" + i + "_"; for (int j = 0; j < SpineTemplate.Length; j++) { int num3 = 2 + j; AddEntry(text + "s" + num3, "|" + Fill(arm, SpineTemplate[j]), arm.Group, val * (float)num3 * 120f); Link((j == 0) ? "origin" : (text + "s" + (num3 - 1)), text + "s" + num3); if (j == SpineTemplate.Length - 1) { TNode tNode = Nodes[text + "s" + num3]; tNode.Perk = PerkForGroup(arm.Group); ArmKeystone[arm.Group] = tNode.Pos; } } for (int k = 0; k < LeftTemplate.Length; k++) { int num4 = 6 + k; AddEntry(text + "l" + num4, "|" + Fill(arm, LeftTemplate[k]), arm.Group, (val * (float)num4 + val2 * 1f) * 120f); AddEntry(text + "r" + num4, "|" + Fill(arm, RightTemplate[k]), arm.Group, (val * (float)num4 + val3 * 1f) * 120f); Link(text + "s" + num4, text + "l" + num4); Link(text + "s" + num4, text + "r" + num4); if (k > 0) { Link(text + "l" + (num4 - 1), text + "l" + num4); Link(text + "r" + (num4 - 1), text + "r" + num4); } } ArmLabel[arm.Group] = val * 12.6f * 120f; } for (int l = 0; l < num; l++) { int num5 = (l + 1) % num; int[] array = new int[4] { 7, 8, 9, 10 }; for (int m = 0; m < array.Length; m++) { int num6 = array[m]; string text2 = "t" + l + "_r" + num6; string text3 = "t" + num5 + "_l" + num6; string text4 = "j" + num6 + "_" + l; AddEntry(text4, num6 switch { 9 => BridgesRecovery[l], 8 => BridgesLow[l], 7 => BridgesVitals[l], _ => BridgesHigh[l], }, "Crossroads", (Nodes[text2].Pos + Nodes[text3].Pos) / 2f); Link(text2, text4); Link(text3, text4); } } } public static bool IsAvailable(TNode node, RpgData d) { if (node.IsOrigin || d.TalentRank(node.Id) > 0) { return false; } foreach (TNode link in node.Links) { if (link.IsOrigin || d.TalentRank(link.Id) > 0) { return true; } } return false; } public static bool CanRefund(TNode node, RpgData d) { int num = d.TalentRank(node.Id); if (node.IsOrigin || num <= 0) { return false; } if (num > 1) { return true; } HashSet hashSet = new HashSet(d.TalentRanks.Keys); hashSet.Remove(node.Id); HashSet hashSet2 = new HashSet(); Queue queue = new Queue(); queue.Enqueue(Nodes["origin"]); while (queue.Count > 0) { foreach (TNode link in queue.Dequeue().Links) { if (hashSet.Contains(link.Id) && hashSet2.Add(link.Id)) { queue.Enqueue(link); } } } return hashSet2.Count == hashSet.Count; } public static int Bosses() { if (Time.realtimeSinceStartup - bossCacheAt < 2f) { return bossCache; } bossCacheAt = Time.realtimeSinceStartup; int num = 0; if ((Object)(object)ZoneSystem.instance != (Object)null) { string[] array = bossKeys; foreach (string text in array) { if (ZoneSystem.instance.GetGlobalKey(text)) { num++; } } } return bossCache = num; } public static int Total(RpgData d) { return d.Level * Plugin.TalentPointsPerLevel.Value + Bosses() * Plugin.TalentPointsPerBoss.Value + d.TalentBank; } public static int Spent(RpgData d) { int num = 0; foreach (KeyValuePair talentRank in d.TalentRanks) { if (Nodes.TryGetValue(talentRank.Key, out var value)) { num += value.Cost * talentRank.Value; } } return num; } public static int Available(RpgData d) { return Total(d) - Spent(d); } public static int SpentInGroup(RpgData d, string group) { int num = 0; foreach (KeyValuePair talentRank in d.TalentRanks) { if (Nodes.TryGetValue(talentRank.Key, out var value) && value.Group == group) { num += value.Cost * talentRank.Value; } } return num; } private static void Recompute(RpgData d) { cache.Clear(); perkRanks.Clear(); foreach (KeyValuePair talentRank in d.TalentRanks) { if (!Nodes.TryGetValue(talentRank.Key, out var value)) { continue; } foreach (EffectAmount effect in value.Effects) { cache.TryGetValue(effect.Effect, out var value2); cache[effect.Effect] = value2 + value.Amount(effect) * (float)talentRank.Value; } if (value.Perk != TalentPerk.None) { perkRanks[value.Perk] = talentRank.Value; } } Dirty = false; } public static float Bonus(Eff e) { RpgData data = Plugin.Data; if (data == null) { return 0f; } if (Dirty) { Recompute(data); } if (!cache.TryGetValue(e, out var value)) { return 0f; } return value * Plugin.TalentPower.Value; } public static int PerkRank(TalentPerk p) { RpgData data = Plugin.Data; if (data == null) { return 0; } if (Dirty) { Recompute(data); } if (!perkRanks.TryGetValue(p, out var value)) { return 0; } return value; } } public class Pix { public readonly int W; public readonly int H; private readonly Color[] px; public Pix(int w, int h) { W = w; H = h; px = (Color[])(object)new Color[w * h]; } public void Plot(int x, int y, Color c, float a) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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) if (x >= 0 && y >= 0 && x < W && y < H) { a *= c.a; if (!(a <= 0f)) { int num = y * W + x; Color val = px[num]; float num2 = a + val.a * (1f - a); float num3 = 1f / num2; px[num] = new Color((c.r * a + val.r * val.a * (1f - a)) * num3, (c.g * a + val.g * val.a * (1f - a)) * num3, (c.b * a + val.b * val.a * (1f - a)) * num3, num2); } } } public void Set(int x, int y, Color c) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) px[y * W + x] = c; } public Color Get(int x, int y) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return px[y * W + x]; } public void Disc(float cx, float cy, float r, Color c) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) for (int i = Mathf.Max(0, (int)(cy - r - 1f)); (float)i <= Mathf.Min((float)(H - 1), cy + r + 1f); i++) { for (int j = Mathf.Max(0, (int)(cx - r - 1f)); (float)j <= Mathf.Min((float)(W - 1), cx + r + 1f); j++) { Plot(j, i, c, Mathf.Clamp01(r - Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), new Vector2(cx, cy)) + 0.5f)); } } } public void Ring(float cx, float cy, float r, float th, Color c) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) for (int i = Mathf.Max(0, (int)(cy - r - th)); (float)i <= Mathf.Min((float)(H - 1), cy + r + th); i++) { for (int j = Mathf.Max(0, (int)(cx - r - th)); (float)j <= Mathf.Min((float)(W - 1), cx + r + th); j++) { float num = Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), new Vector2(cx, cy)); Plot(j, i, c, Mathf.Clamp01(th * 0.5f - Mathf.Abs(num - r) + 0.5f)); } } } public void Line(float x0, float y0, float x1, float y1, float th, Color c) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(x0, y0); Vector2 val2 = new Vector2(x1, y1) - val; float sqrMagnitude = ((Vector2)(ref val2)).sqrMagnitude; int num = Mathf.Max(0, (int)(Mathf.Min(x0, x1) - th - 1f)); int num2 = Mathf.Min(W - 1, (int)(Mathf.Max(x0, x1) + th + 1f)); int num3 = Mathf.Max(0, (int)(Mathf.Min(y0, y1) - th - 1f)); int num4 = Mathf.Min(H - 1, (int)(Mathf.Max(y0, y1) + th + 1f)); Vector2 val3 = default(Vector2); for (int i = num3; i <= num4; i++) { for (int j = num; j <= num2; j++) { ((Vector2)(ref val3))..ctor((float)j + 0.5f, (float)i + 0.5f); float num5 = ((sqrMagnitude > 0f) ? Mathf.Clamp01(Vector2.Dot(val3 - val, val2) / sqrMagnitude) : 0f); float num6 = Mathf.Clamp01(th * 0.5f - Vector2.Distance(val3, val + val2 * num5) + 0.5f); if (num6 > 0f) { Plot(j, i, c, num6); } } } } public void Diamond(float cx, float cy, float rx, float ry, Color c) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) for (int i = Mathf.Max(0, (int)(cy - ry - 1f)); (float)i <= Mathf.Min((float)(H - 1), cy + ry + 1f); i++) { for (int j = Mathf.Max(0, (int)(cx - rx - 1f)); (float)j <= Mathf.Min((float)(W - 1), cx + rx + 1f); j++) { float num = Mathf.Abs((float)j + 0.5f - cx) / rx + Mathf.Abs((float)i + 0.5f - cy) / ry; Plot(j, i, c, Mathf.Clamp01((1f - num) * Mathf.Min(rx, ry) + 0.5f)); } } } public void FadeEdgesX(float width) { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { float num = Mathf.Clamp01((float)Mathf.Min(j, W - 1 - j) / width); Color val = px[i * W + j]; val.a *= num; px[i * W + j] = val; } } } public Texture2D ToTexture(TextureWrapMode wrap = (TextureWrapMode)1) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown Texture2D val = new Texture2D(W, H, (TextureFormat)4, false) { filterMode = (FilterMode)1, wrapMode = wrap }; val.SetPixels(px); val.Apply(); return val; } } public static class Tex { private static Texture2D stone; private static Texture2D vignette; private static Texture2D glow; private static Texture2D disc; private static Texture2D roundFrame; private static Texture2D diamondFrame; private static Texture2D pip; private static Texture2D corner; private static Texture2D divider; private static Texture2D runes; public static Texture2D Stone => stone ?? (stone = MakeStone()); public static Texture2D Vignette => vignette ?? (vignette = MakeVignette()); public static Texture2D Glow => glow ?? (glow = MakeGlow()); public static Texture2D Disc => disc ?? (disc = MakeDisc()); public static Texture2D RoundFrame => roundFrame ?? (roundFrame = MakeRoundFrame()); public static Texture2D DiamondFrame => diamondFrame ?? (diamondFrame = MakeDiamondFrame()); public static Texture2D Pip => pip ?? (pip = MakePip()); public static Texture2D Corner => corner ?? (corner = MakeCorner()); public static Texture2D Divider => divider ?? (divider = MakeDivider()); public static Texture2D Runes => runes ?? (runes = MakeRunes()); private static Texture2D MakeStone() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(256, 256); for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { float num = 0.6f * Mathf.PerlinNoise((float)j * 0.03f, (float)i * 0.03f) + 0.3f * Mathf.PerlinNoise((float)j * 0.11f + 50f, (float)i * 0.11f + 20f) + 0.1f * Mathf.PerlinNoise((float)j * 0.5f, (float)i * 0.5f); float num2 = 0.075f + num * 0.055f - (float)i / 256f * 0.015f; pix.Set(j, i, new Color(num2 * 1.06f, num2, num2 * 0.9f, 1f)); } } return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeVignette() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(128, 128); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(64f, 64f)) / 64f; pix.Set(j, i, new Color(0f, 0f, 0f, Mathf.SmoothStep(0.45f, 1.15f, num) * 0.75f)); } } return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeGlow() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(128, 128); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = Mathf.Clamp01(Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(64f, 64f)) / 64f); pix.Set(j, i, new Color(1f, 1f, 1f, (1f - num) * (1f - num))); } } return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeDisc() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(64, 64); pix.Disc(32f, 32f, 31f, Color.white); return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeRoundFrame() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(128, 128); Color white = Color.white; pix.Ring(64f, 64f, 59f, 6f, white); pix.Ring(64f, 64f, 50f, 2f, new Color(1f, 1f, 1f, 0.8f)); for (int i = 0; i < 8; i++) { float num = (float)i * (float)Math.PI / 4f; pix.Disc(64f + Mathf.Cos(num) * 59f, 64f + Mathf.Sin(num) * 59f, 4.2f, white); } return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeDiamondFrame() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bc: 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_00e4: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(128, 128); Color white = Color.white; Vector2[] array = (Vector2[])(object)new Vector2[4] { new Vector2(64f, 5f), new Vector2(123f, 64f), new Vector2(64f, 123f), new Vector2(5f, 64f) }; for (int i = 0; i < 4; i++) { pix.Line(array[i].x, array[i].y, array[(i + 1) % 4].x, array[(i + 1) % 4].y, 6f, white); } Vector2[] array2 = (Vector2[])(object)new Vector2[4] { new Vector2(64f, 17f), new Vector2(111f, 64f), new Vector2(64f, 111f), new Vector2(17f, 64f) }; for (int j = 0; j < 4; j++) { pix.Line(array2[j].x, array2[j].y, array2[(j + 1) % 4].x, array2[(j + 1) % 4].y, 2f, new Color(1f, 1f, 1f, 0.8f)); } Vector2[] array3 = array; foreach (Vector2 val in array3) { pix.Disc(val.x, val.y, 5.5f, white); } return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakePip() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(16, 16); pix.Diamond(8f, 8f, 7f, 7f, Color.white); return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeCorner() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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) Pix pix = new Pix(48, 48); Color white = Color.white; pix.Line(4f, 4f, 4f, 44f, 3f, white); pix.Line(4f, 4f, 44f, 4f, 3f, white); pix.Line(10f, 10f, 10f, 30f, 1.5f, new Color(1f, 1f, 1f, 0.7f)); pix.Line(10f, 10f, 30f, 10f, 1.5f, new Color(1f, 1f, 1f, 0.7f)); pix.Diamond(4f, 4f, 8f, 8f, white); pix.Diamond(4f, 44f, 3.5f, 3.5f, white); pix.Diamond(44f, 4f, 3.5f, 3.5f, white); return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeDivider() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(256, 14); Color white = Color.white; pix.Line(4f, 7f, 116f, 7f, 2f, white); pix.Line(140f, 7f, 252f, 7f, 2f, white); pix.Diamond(128f, 7f, 7f, 6f, white); pix.Diamond(112f, 7f, 3f, 3f, white); pix.Diamond(144f, 7f, 3f, 3f, white); pix.FadeEdgesX(48f); return pix.ToTexture((TextureWrapMode)1); } private static Texture2D MakeRunes() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) Pix pix = new Pix(1024, 28); Color white = Color.white; float[][] array = new float[12][] { new float[12] { 2f, 0f, 2f, 20f, 2f, 13f, 10f, 19f, 2f, 7f, 10f, 13f }, new float[12] { 2f, 0f, 2f, 20f, 2f, 20f, 10f, 14f, 10f, 14f, 10f, 0f }, new float[12] { 2f, 0f, 2f, 20f, 2f, 15f, 10f, 10f, 10f, 10f, 2f, 5f }, new float[12] { 2f, 0f, 2f, 20f, 2f, 20f, 10f, 15f, 2f, 13f, 10f, 8f }, new float[16] { 2f, 0f, 2f, 20f, 2f, 20f, 10f, 15f, 10f, 15f, 2f, 10f, 2f, 10f, 10f, 0f }, new float[8] { 10f, 17f, 2f, 10f, 2f, 10f, 10f, 3f }, new float[8] { 2f, 2f, 10f, 18f, 2f, 18f, 10f, 2f }, new float[12] { 2f, 0f, 2f, 20f, 10f, 0f, 10f, 20f, 2f, 13f, 10f, 7f }, new float[4] { 6f, 0f, 6f, 20f }, new float[12] { 9f, 20f, 3f, 13f, 3f, 13f, 9f, 7f, 9f, 7f, 3f, 0f }, new float[12] { 6f, 0f, 6f, 20f, 1f, 14f, 6f, 20f, 11f, 14f, 6f, 20f }, new float[12] { 2f, 0f, 2f, 20f, 2f, 20f, 10f, 15f, 10f, 15f, 2f, 10f } }; int num = 0; float num2 = 18f; while (num2 < 1000f) { if (num % 7 == 6) { pix.Diamond(num2 + 6f, 14f, 4f, 4f, white); } else { float[] array2 = array[(num * 5 + num / 3) % array.Length]; for (int i = 0; i + 3 < array2.Length; i += 4) { pix.Line(num2 + array2[i], 4f + array2[i + 1], num2 + array2[i + 2], 4f + array2[i + 3], 2f, white); } } num2 += 30f; num++; } pix.FadeEdgesX(120f); return pix.ToTexture((TextureWrapMode)1); } } public static class Ui { private class TipLine { public string T; public int Size; public Color C; public bool Bold; } public static bool Open; private static readonly Color Gold = new Color(0.83f, 0.68f, 0.32f); private static readonly Color GoldBright = new Color(1f, 0.86f, 0.42f); private static readonly Color Parchment = new Color(0.93f, 0.88f, 0.75f); private static readonly Color Muted = new Color(0.66f, 0.62f, 0.54f); private static readonly Color Silver = new Color(0.74f, 0.76f, 0.8f); private static readonly Color Locked = new Color(0.3f, 0.29f, 0.28f); private static readonly Color Red = new Color(1f, 0.52f, 0.46f); private static readonly Color Green = new Color(0.55f, 0.92f, 0.55f); private static GUIStyle lbl; private static float uiScale = 1f; private static float tzoom = 0.42f; private static int modal; private static Vector2 tpan; private static Vector2 tDragLast; private static bool tInit; private static bool tDragging; private static Material glMat; private static int tab; private static float zoom = 0.85f; private static Vector2 pan; private static bool treeInit; private static bool dragging; private static Vector2 dragLast; private static int lastDrawFrame; private static string toast; private static float toastUntil; private static readonly float[] prevCd = new float[2]; private static readonly float[] flashUntil = new float[2]; private static bool maximized; private const float RowPitch = 124f; private static readonly float[] ColX = new float[3] { 150f, 410f, 670f }; public static bool BlockedByOtherUi() { if ((!((Object)(object)InventoryGui.instance != (Object)null) || !InventoryGui.IsVisible()) && (!((Object)(object)Chat.instance != (Object)null) || !Chat.instance.HasFocus()) && !Menu.IsVisible() && !Console.IsVisible()) { return TextInput.IsVisible(); } return true; } public static void Draw() { //IL_0039: 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_004a: Unknown result type (might be due to invalid IL or missing references) RpgData data = Plugin.Data; if (data != null && !((Object)(object)Player.m_localPlayer == (Object)null)) { float num = (uiScale = Mathf.Clamp((float)Screen.height / 1080f, 0.7f, 2f)); Matrix4x4 matrix = GUI.matrix; GUI.matrix = Matrix4x4.Scale(new Vector3(num, num, 1f)); float vw = (float)Screen.width / num; float vh = (float)Screen.height / num; Floaters.Draw(num); if (data.Class != RpgClass.None && !Open) { Hud(data, vw, vh); } if (Open) { DrawPanel(data, vw, vh); } GUI.matrix = matrix; } } private static void Hud(RpgData d, float vw, float vh) { //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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: 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_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0912: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_076b: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) Color val = Icons.Accent(d.Class); float realtimeSinceStartup = Time.realtimeSinceStartup; _ = vw / 2f; float num = ((d.Level >= Plugin.MaxLevel.Value) ? 1f : ((float)d.Xp / (float)RpgData.XpForNext(d.Level))); Rect r = default(Rect); ((Rect)(ref r))..ctor(0f, vh - 7f, vw, 7f); Fill(r, new Color(0.04f, 0.04f, 0.05f, 0.85f)); Fill(new Rect(0f, ((Rect)(ref r)).y, vw * num, ((Rect)(ref r)).height), val); Fill(new Rect(0f, ((Rect)(ref r)).y, vw * num, 2f), Color.Lerp(val, Color.white, 0.5f)); for (int i = 1; i < 10; i++) { Fill(new Rect(vw * (float)i / 10f - 1f, ((Rect)(ref r)).y, 2f, ((Rect)(ref r)).height), new Color(0f, 0f, 0f, 0.55f)); } Fill(new Rect(0f, ((Rect)(ref r)).y - 1f, vw, 1f), new Color(Gold.r, Gold.g, Gold.b, 0.6f)); float num2 = 142f; float num3 = Plugin.HudX.Value + 84f; float num4 = vh - Plugin.HudY.Value; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(num3 - 84f, num4 + 2f, 60f, 60f); if (d.Points > 0) { float num5 = 0.35f + 0.25f * Mathf.Sin(realtimeSinceStartup * 3f); Img(new Rect(((Rect)(ref r2)).x - 26f, ((Rect)(ref r2)).y - 26f, 112f, 112f), Tex.Glow, new Color(GoldBright.r, GoldBright.g, GoldBright.b, num5)); } Img(r2, Tex.Disc, new Color(0.06f, 0.06f, 0.07f, 0.92f)); Img(new Rect(((Rect)(ref r2)).x - 6f, ((Rect)(ref r2)).y - 6f, 72f, 72f), Tex.RoundFrame, (d.Points > 0) ? GoldBright : Gold); Text(r2, d.Level.ToString(), 22, Parchment, (TextAnchor)4, bold: true, wrap: false, shadow: true); if (d.Points > 0) { Text(new Rect(((Rect)(ref r2)).x - 20f, ((Rect)(ref r2)).yMax + 8f, 100f, 18f), L.F("hud.skill_points", d.Points, Plugin.MenuKey.Value), 12, GoldBright, (TextAnchor)4, bold: true, wrap: false, shadow: true); } int num6 = Talents.Available(d); if (num6 > 0) { Text(new Rect(((Rect)(ref r2)).x - 20f, ((Rect)(ref r2)).yMax + (float)((d.Points > 0) ? 24 : 8), 100f, 18f), L.F("hud.talent_points", num6), 12, GoldBright, (TextAnchor)4, bold: true, wrap: false, shadow: true); } Rect r3 = default(Rect); Rect r4 = default(Rect); for (int j = 0; j < 2; j++) { ((Rect)(ref r3))..ctor(num3 + (float)j * 78f, num4, 64f, 64f); Ability ability = ((d.Slots[j] == null) ? null : Abilities.Find(d.Slots[j])); string t = ((object)Plugin.AbilityKeys[j].Value/*cast due to .constrained prefix*/).ToString(); float num7 = ((ability == null) ? 0f : Abilities.CooldownLeft(ability.Id)); if (prevCd[j] > 0f && num7 <= 0f && ability != null) { flashUntil[j] = realtimeSinceStartup + 0.8f; } prevCd[j] = num7; Img(new Rect(((Rect)(ref r3)).x - 5f, ((Rect)(ref r3)).y - 5f, 74f, 74f), Tex.Disc, new Color(0.05f, 0.05f, 0.06f, 0.8f)); if (ability != null) { GUI.DrawTexture(new Rect(((Rect)(ref r3)).x + 2f, ((Rect)(ref r3)).y + 2f, 60f, 60f), (Texture)(object)Icons.ForAbility(ability)); if (num7 > 0f) { float num8 = Mathf.Clamp01(num7 / Abilities.CooldownTotal(ability.Id)); GUI.BeginGroup(new Rect(((Rect)(ref r3)).x, ((Rect)(ref r3)).y, 64f, 64f * num8)); Img(new Rect(0f, 0f, 64f, 64f), Tex.Disc, new Color(0f, 0f, 0f, 0.7f)); GUI.EndGroup(); Text(r3, num7.ToString((num7 >= 10f) ? "0" : "0.0"), 20, Parchment, (TextAnchor)4, bold: true, wrap: false, shadow: true); } } Img(new Rect(((Rect)(ref r3)).x - 9f, ((Rect)(ref r3)).y - 9f, 82f, 82f), Tex.RoundFrame, (ability == null) ? Locked : ((num7 > 0f) ? Muted : Gold)); if (realtimeSinceStartup < flashUntil[j]) { float num9 = (flashUntil[j] - realtimeSinceStartup) / 0.8f; Img(new Rect(((Rect)(ref r3)).x - 30f, ((Rect)(ref r3)).y - 30f, 124f, 124f), Tex.Glow, new Color(GoldBright.r, GoldBright.g, GoldBright.b, num9 * 0.9f)); Text(new Rect(((Rect)(ref r3)).x - 20f, ((Rect)(ref r3)).y - 30f - (1f - num9) * 14f, 104f, 18f), L.T("hud.ready"), 12, new Color(GoldBright.r, GoldBright.g, GoldBright.b, num9), (TextAnchor)4, bold: true, wrap: false, shadow: true); } ((Rect)(ref r4))..ctor(((Rect)(ref r3)).center.x - 13f, ((Rect)(ref r3)).yMax + 7f, 26f, 18f); Fill(new Rect(((Rect)(ref r4)).x - 1f, ((Rect)(ref r4)).y - 1f, 28f, 20f), (ability == null) ? Locked : Gold); Fill(r4, new Color(0.07f, 0.07f, 0.08f, 0.95f)); Text(r4, t, 11, (ability == null) ? Muted : Parchment, (TextAnchor)4, bold: true); } float num10 = num3 + num2 + 40f; Rect val2 = default(Rect); foreach (Buff item in Buffs.Active) { float num11 = item.Expires - Time.time; if (!(num11 <= 0f)) { Ability ability2 = Abilities.Find(item.Id); ((Rect)(ref val2))..ctor(num10, num4 + 10f, 40f, 40f); Img(new Rect(((Rect)(ref val2)).x - 3f, ((Rect)(ref val2)).y - 3f, 46f, 46f), Tex.Disc, new Color(0.05f, 0.05f, 0.06f, 0.85f)); if (ability2 != null) { GUI.DrawTexture(val2, (Texture)(object)Icons.ForAbility(ability2)); } Img(new Rect(((Rect)(ref val2)).x - 6f, ((Rect)(ref val2)).y - 6f, 52f, 52f), Tex.RoundFrame, GoldBright); Fill(new Rect(((Rect)(ref val2)).x - 2f, ((Rect)(ref val2)).yMax + 8f, 44f, 4f), new Color(0f, 0f, 0f, 0.8f)); Fill(new Rect(((Rect)(ref val2)).x - 2f, ((Rect)(ref val2)).yMax + 8f, 44f * Mathf.Clamp01(num11 / Mathf.Max(0.1f, item.Duration)), 4f), GoldBright); Text(new Rect(((Rect)(ref val2)).x - 10f, ((Rect)(ref val2)).yMax + 12f, 60f, 16f), num11.ToString("0") + "s", 11, Parchment, (TextAnchor)4, bold: true, wrap: false, shadow: true); num10 += 58f; } } } private static void DrawPanel(RpgData d, float vw, float vh) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_02ce: Invalid comparison between Unknown and I4 //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_039a: 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_042b: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) float num = (maximized ? (vw - 40f) : 1040f); float num2 = (maximized ? (vh - 24f) : 770f); Rect val = default(Rect); ((Rect)(ref val))..ctor((vw - num) / 2f, maximized ? 12f : Mathf.Max(6f, (vh - num2) / 2f), num, num2); Color accent = ((d.Class == RpgClass.None) ? Gold : Icons.Accent(d.Class)); if (Time.frameCount - lastDrawFrame > 2) { treeInit = false; dragging = false; } lastDrawFrame = Time.frameCount; Fill(new Rect(0f, 0f, vw, vh), new Color(0f, 0f, 0f, 0.55f)); Fill(new Rect(((Rect)(ref val)).x + 8f, ((Rect)(ref val)).y + 10f, num, num2), new Color(0f, 0f, 0f, 0.5f)); Fill(new Rect(((Rect)(ref val)).x - 4f, ((Rect)(ref val)).y - 4f, num + 8f, num2 + 8f), new Color(Gold.r * 0.55f, Gold.g * 0.55f, Gold.b * 0.55f, 1f)); Fill(new Rect(((Rect)(ref val)).x - 1f, ((Rect)(ref val)).y - 1f, num + 2f, num2 + 2f), new Color(0.04f, 0.035f, 0.03f)); GUI.DrawTexture(val, (Texture)(object)Tex.Stone); Img(val, Tex.Vignette, Color.white); Frame(new Rect(((Rect)(ref val)).x + 9f, ((Rect)(ref val)).y + 9f, num - 18f, num2 - 18f), new Color(Gold.r, Gold.g, Gold.b, 0.55f), 1f); Corner(((Rect)(ref val)).x + 2f, ((Rect)(ref val)).y + 2f, flipX: false, flipY: false); Corner(((Rect)(ref val)).xMax - 50f, ((Rect)(ref val)).y + 2f, flipX: true, flipY: false); Corner(((Rect)(ref val)).x + 2f, ((Rect)(ref val)).yMax - 50f, flipX: false, flipY: true); Corner(((Rect)(ref val)).xMax - 50f, ((Rect)(ref val)).yMax - 50f, flipX: true, flipY: true); if (modal == 0 || (int)Event.current.type == 7) { if (d.Class == RpgClass.None) { ClassSelect(d, val); } else { Main(d, val, accent); } } if (d.Class == RpgClass.None) { modal = 0; } if (modal != 0) { ConfirmModal(d, val, vw, vh); } if (Btn(new Rect(((Rect)(ref val)).xMax - 52f, ((Rect)(ref val)).y + 16f, 32f, 32f), "✕", new Color(0.2f, 0.17f, 0.14f), enabled: true, 16)) { Open = false; } Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref val)).xMax - 90f, ((Rect)(ref val)).y + 16f, 32f, 32f); if (Btn(r, "", new Color(0.2f, 0.17f, 0.14f), enabled: true, 16)) { maximized = !maximized; treeInit = false; tInit = false; } if (!maximized) { Frame(new Rect(((Rect)(ref r)).x + 9f, ((Rect)(ref r)).y + 9f, 14f, 14f), Parchment, 2f); return; } Frame(new Rect(((Rect)(ref r)).x + 8f, ((Rect)(ref r)).y + 13f, 12f, 12f), Parchment, 2f); Frame(new Rect(((Rect)(ref r)).x + 12f, ((Rect)(ref r)).y + 8f, 12f, 12f), Parchment, 2f); } private static void ConfirmModal(RpgData d, Rect p, float vw, float vh) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0256: 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) Fill(new Rect(0f, 0f, vw, vh), new Color(0f, 0f, 0f, 0.6f)); Rect r = default(Rect); ((Rect)(ref r))..ctor(vw / 2f - 230f, vh / 2f - 95f, 460f, 190f); Fill(new Rect(((Rect)(ref r)).x - 3f, ((Rect)(ref r)).y - 3f, ((Rect)(ref r)).width + 6f, ((Rect)(ref r)).height + 6f), Gold); Fill(r, new Color(0.07f, 0.06f, 0.05f)); Text(new Rect(((Rect)(ref r)).x + 20f, ((Rect)(ref r)).y + 14f, ((Rect)(ref r)).width - 40f, 30f), L.T((modal == 1) ? "ui.reset_talents" : ((modal == 3) ? "ui.transcend" : "ui.reset_class")), 20, Parchment, (TextAnchor)4, bold: true, wrap: false, shadow: true); Text(new Rect(((Rect)(ref r)).x + 24f, ((Rect)(ref r)).y + 52f, ((Rect)(ref r)).width - 48f, 64f), (modal == 3) ? L.F("ui.confirm_transcend", Plugin.TalentPointsPerTranscend.Value) : L.T((modal == 1) ? "ui.confirm_talents" : "ui.confirm_class"), 14, Muted, (TextAnchor)4, bold: false, wrap: true); if (Btn(new Rect(((Rect)(ref r)).x + 30f, ((Rect)(ref r)).yMax - 58f, 190f, 40f), L.T("ui.confirm"), new Color(0.5f, 0.15f, 0.12f), enabled: true, 15)) { if (modal == 1) { d.RespecTalents(); Toast(L.T("ui.talents_reset")); } else if (modal == 3) { d.Transcend(); } else { d.Respec(); } modal = 0; } if (Btn(new Rect(((Rect)(ref r)).xMax - 220f, ((Rect)(ref r)).yMax - 58f, 190f, 40f), L.T("ui.cancel"), new Color(0.2f, 0.17f, 0.14f), enabled: true, 15)) { modal = 0; } } private static string ClassInfo(RpgClass c) { string text = L.T("class." + c.ToString() + ".desc") + "\n\n" + L.T("ui.actives_label"); foreach (Ability item in Abilities.For(c)) { if (item.Active) { text = text + "\n" + item.Name; } } return text; } private static void ClassSelect(RpgData d, Rect p) { //IL_0020: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0203: 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_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: 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_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028d: 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_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) Text(new Rect(((Rect)(ref p)).x, ((Rect)(ref p)).y + 28f, ((Rect)(ref p)).width, 44f), L.T("ui.choose_class"), 32, Parchment, (TextAnchor)4, bold: true, wrap: false, shadow: true); Img(new Rect(((Rect)(ref p)).center.x - 260f, ((Rect)(ref p)).y + 76f, 520f, 20f), Tex.Divider, Gold); Text(new Rect(((Rect)(ref p)).x, ((Rect)(ref p)).y + 100f, ((Rect)(ref p)).width, 24f), L.T("ui.choose_hint"), 14, Muted, (TextAnchor)4); RpgClass[] array = new RpgClass[4] { RpgClass.Warrior, RpgClass.Archer, RpgClass.Mage, RpgClass.Rogue }; string[] array2 = new string[4] { L.T("class.Warrior"), L.T("class.Archer"), L.T("class.Mage"), L.T("class.Rogue") }; string[] array3 = new string[4]; for (int i = 0; i < 4; i++) { array3[i] = ClassInfo(array[i]); } float num = 220f; float num2 = 22f; float num3 = ((Rect)(ref p)).x + (((Rect)(ref p)).width - (num * 4f + num2 * 3f)) / 2f; Rect r = default(Rect); for (int j = 0; j < 4; j++) { ((Rect)(ref r))..ctor(num3 + (float)j * (num + num2), ((Rect)(ref p)).y + 150f, num, 520f); Color val = Icons.Accent(array[j]); bool flag = ((Rect)(ref r)).Contains(Event.current.mousePosition); Fill(new Rect(((Rect)(ref r)).x - 2f, ((Rect)(ref r)).y - 2f, ((Rect)(ref r)).width + 4f, ((Rect)(ref r)).height + 4f), (Color)(flag ? val : new Color(val.r * 0.5f, val.g * 0.5f, val.b * 0.5f))); Fill(r, new Color(0.08f, 0.075f, 0.07f)); if (flag) { Img(new Rect(((Rect)(ref r)).x - 40f, ((Rect)(ref r)).y - 40f, ((Rect)(ref r)).width + 80f, 300f), Tex.Glow, new Color(val.r, val.g, val.b, 0.35f)); } float num4 = (flag ? 1.05f : 1f); Matrix4x4 matrix = GUI.matrix; ScaleAbout(Vector2.one * num4, new Vector2(((Rect)(ref r)).center.x, ((Rect)(ref r)).y + 100f)); Img(new Rect(((Rect)(ref r)).center.x - 62f, ((Rect)(ref r)).y + 38f, 124f, 124f), Tex.RoundFrame, val); GUI.DrawTexture(new Rect(((Rect)(ref r)).center.x - 48f, ((Rect)(ref r)).y + 52f, 96f, 96f), (Texture)(object)Icons.ForClass(array[j])); GUI.matrix = matrix; Text(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + 184f, num, 36f), array2[j], 26, Parchment, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref r)).x + 20f, ((Rect)(ref r)).y + 224f, num - 40f, 14f), Tex.Divider, val); Text(new Rect(((Rect)(ref r)).x + 16f, ((Rect)(ref r)).y + 250f, num - 32f, 200f), array3[j], 14, Parchment, (TextAnchor)1, bold: false, wrap: true); if (Btn(new Rect(((Rect)(ref r)).x + 24f, ((Rect)(ref r)).yMax - 64f, num - 48f, 42f), L.T("ui.choose"), new Color(val.r * 0.55f, val.g * 0.55f, val.b * 0.55f), enabled: true, 18)) { d.ChooseClass(array[j]); } } } private static Vector2 NodeCenter(Rect p, int col, int row) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) return new Vector2((row == 0) ? 380f : (ColX[col] - 30f), 72f + (float)row * 124f); } private static string[] BranchNames(RpgClass c) { return new string[3] { L.T("branch." + c.ToString() + ".0"), L.T("branch." + c.ToString() + ".1"), L.T("branch." + c.ToString() + ".2") }; } private static void Main(RpgData d, Rect p, Color accent) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_00a9: 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_00ed: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0222: 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_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: 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_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_08e5: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Invalid comparison between Unknown and I4 //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_0990: Unknown result type (might be due to invalid IL or missing references) //IL_099a: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0950: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_0a54: Unknown result type (might be due to invalid IL or missing references) //IL_0a2f: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a4d: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Unknown result type (might be due to invalid IL or missing references) //IL_0a69: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a73: Unknown result type (might be due to invalid IL or missing references) //IL_0c07: Unknown result type (might be due to invalid IL or missing references) //IL_0c0c: Unknown result type (might be due to invalid IL or missing references) //IL_0c11: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Unknown result type (might be due to invalid IL or missing references) //IL_0c46: Unknown result type (might be due to invalid IL or missing references) //IL_0c4b: Unknown result type (might be due to invalid IL or missing references) //IL_0c60: Unknown result type (might be due to invalid IL or missing references) //IL_0c6a: Unknown result type (might be due to invalid IL or missing references) //IL_0c8e: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cca: Unknown result type (might be due to invalid IL or missing references) //IL_0cde: Unknown result type (might be due to invalid IL or missing references) //IL_0d0a: Unknown result type (might be due to invalid IL or missing references) //IL_0d14: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d20: Unknown result type (might be due to invalid IL or missing references) //IL_0d2b: Unknown result type (might be due to invalid IL or missing references) //IL_0d35: Unknown result type (might be due to invalid IL or missing references) //IL_0d49: Unknown result type (might be due to invalid IL or missing references) //IL_0d75: Unknown result type (might be due to invalid IL or missing references) //IL_0d7f: Unknown result type (might be due to invalid IL or missing references) //IL_0d85: Unknown result type (might be due to invalid IL or missing references) //IL_0d99: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Unknown result type (might be due to invalid IL or missing references) //IL_0ddd: Unknown result type (might be due to invalid IL or missing references) //IL_0de2: Unknown result type (might be due to invalid IL or missing references) //IL_0a9a: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0ab0: Unknown result type (might be due to invalid IL or missing references) //IL_0ab6: Unknown result type (might be due to invalid IL or missing references) //IL_0ac1: Unknown result type (might be due to invalid IL or missing references) //IL_0acb: Unknown result type (might be due to invalid IL or missing references) //IL_0acd: Unknown result type (might be due to invalid IL or missing references) //IL_0adb: Unknown result type (might be due to invalid IL or missing references) //IL_0ae1: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_0b10: Unknown result type (might be due to invalid IL or missing references) //IL_0b15: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b2b: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) //IL_0ba7: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b73: Unknown result type (might be due to invalid IL or missing references) //IL_0b81: Unknown result type (might be due to invalid IL or missing references) //IL_0dfd: Unknown result type (might be due to invalid IL or missing references) //IL_0e0c: Unknown result type (might be due to invalid IL or missing references) //IL_0e11: Unknown result type (might be due to invalid IL or missing references) //IL_0e16: Unknown result type (might be due to invalid IL or missing references) //IL_0e1a: Unknown result type (might be due to invalid IL or missing references) //IL_0e2e: Unknown result type (might be due to invalid IL or missing references) //IL_0e93: Unknown result type (might be due to invalid IL or missing references) //IL_1438: Unknown result type (might be due to invalid IL or missing references) //IL_143e: Invalid comparison between Unknown and I4 //IL_1447: Unknown result type (might be due to invalid IL or missing references) //IL_0eaa: Unknown result type (might be due to invalid IL or missing references) //IL_0eac: Unknown result type (might be due to invalid IL or missing references) //IL_14b9: Unknown result type (might be due to invalid IL or missing references) //IL_14bf: Invalid comparison between Unknown and I4 //IL_1486: Unknown result type (might be due to invalid IL or missing references) //IL_148c: Invalid comparison between Unknown and I4 //IL_14c7: Unknown result type (might be due to invalid IL or missing references) //IL_14e2: Unknown result type (might be due to invalid IL or missing references) //IL_148e: Unknown result type (might be due to invalid IL or missing references) //IL_1493: Unknown result type (might be due to invalid IL or missing references) //IL_1495: Unknown result type (might be due to invalid IL or missing references) //IL_149a: Unknown result type (might be due to invalid IL or missing references) //IL_149f: Unknown result type (might be due to invalid IL or missing references) //IL_14a4: Unknown result type (might be due to invalid IL or missing references) //IL_14a9: Unknown result type (might be due to invalid IL or missing references) //IL_14ab: Unknown result type (might be due to invalid IL or missing references) //IL_146d: Unknown result type (might be due to invalid IL or missing references) //IL_146f: Unknown result type (might be due to invalid IL or missing references) //IL_151b: Unknown result type (might be due to invalid IL or missing references) //IL_152c: Unknown result type (might be due to invalid IL or missing references) //IL_0ee5: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_1592: Unknown result type (might be due to invalid IL or missing references) //IL_1599: Unknown result type (might be due to invalid IL or missing references) //IL_159a: Unknown result type (might be due to invalid IL or missing references) //IL_0eea: Unknown result type (might be due to invalid IL or missing references) //IL_0ee2: Unknown result type (might be due to invalid IL or missing references) //IL_15b5: Unknown result type (might be due to invalid IL or missing references) //IL_15ba: Unknown result type (might be due to invalid IL or missing references) //IL_15bc: Unknown result type (might be due to invalid IL or missing references) //IL_15c1: Unknown result type (might be due to invalid IL or missing references) //IL_15c2: Unknown result type (might be due to invalid IL or missing references) //IL_1550: Unknown result type (might be due to invalid IL or missing references) //IL_1556: Invalid comparison between Unknown and I4 //IL_0edb: Unknown result type (might be due to invalid IL or missing references) //IL_0ed4: Unknown result type (might be due to invalid IL or missing references) //IL_155a: Unknown result type (might be due to invalid IL or missing references) //IL_1561: Invalid comparison between Unknown and I4 //IL_1573: Unknown result type (might be due to invalid IL or missing references) //IL_157a: Invalid comparison between Unknown and I4 //IL_1565: Unknown result type (might be due to invalid IL or missing references) //IL_156c: Invalid comparison between Unknown and I4 //IL_0f14: Unknown result type (might be due to invalid IL or missing references) //IL_0f24: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0f71: Unknown result type (might be due to invalid IL or missing references) //IL_0f85: Unknown result type (might be due to invalid IL or missing references) //IL_0f95: Unknown result type (might be due to invalid IL or missing references) //IL_0fb5: Unknown result type (might be due to invalid IL or missing references) //IL_0fbf: Unknown result type (might be due to invalid IL or missing references) //IL_0fc5: Unknown result type (might be due to invalid IL or missing references) //IL_0fcb: Unknown result type (might be due to invalid IL or missing references) //IL_0fd6: Unknown result type (might be due to invalid IL or missing references) //IL_1084: Unknown result type (might be due to invalid IL or missing references) //IL_1094: Unknown result type (might be due to invalid IL or missing references) //IL_10b4: Unknown result type (might be due to invalid IL or missing references) //IL_10d2: Unknown result type (might be due to invalid IL or missing references) //IL_111b: Unknown result type (might be due to invalid IL or missing references) //IL_0ff8: Unknown result type (might be due to invalid IL or missing references) //IL_1008: Unknown result type (might be due to invalid IL or missing references) //IL_1028: Unknown result type (might be due to invalid IL or missing references) //IL_107a: Unknown result type (might be due to invalid IL or missing references) //IL_1125: Unknown result type (might be due to invalid IL or missing references) //IL_1135: Unknown result type (might be due to invalid IL or missing references) //IL_1149: Unknown result type (might be due to invalid IL or missing references) //IL_115a: Unknown result type (might be due to invalid IL or missing references) //IL_1164: Unknown result type (might be due to invalid IL or missing references) //IL_1174: Unknown result type (might be due to invalid IL or missing references) //IL_1188: Unknown result type (might be due to invalid IL or missing references) //IL_1114: Unknown result type (might be due to invalid IL or missing references) //IL_10f9: Unknown result type (might be due to invalid IL or missing references) //IL_11aa: Unknown result type (might be due to invalid IL or missing references) //IL_11a6: Unknown result type (might be due to invalid IL or missing references) //IL_11cb: Unknown result type (might be due to invalid IL or missing references) //IL_11ed: Unknown result type (might be due to invalid IL or missing references) //IL_121e: Unknown result type (might be due to invalid IL or missing references) //IL_1237: Unknown result type (might be due to invalid IL or missing references) //IL_1246: Unknown result type (might be due to invalid IL or missing references) //IL_1263: Unknown result type (might be due to invalid IL or missing references) //IL_1282: Unknown result type (might be due to invalid IL or missing references) //IL_12c9: Unknown result type (might be due to invalid IL or missing references) //IL_12d9: Unknown result type (might be due to invalid IL or missing references) //IL_1332: Unknown result type (might be due to invalid IL or missing references) //IL_1337: Unknown result type (might be due to invalid IL or missing references) //IL_1341: Unknown result type (might be due to invalid IL or missing references) //IL_1352: Unknown result type (might be due to invalid IL or missing references) //IL_135c: Unknown result type (might be due to invalid IL or missing references) //IL_1366: Unknown result type (might be due to invalid IL or missing references) //IL_136b: Unknown result type (might be due to invalid IL or missing references) //IL_1386: Unknown result type (might be due to invalid IL or missing references) //IL_1290: Unknown result type (might be due to invalid IL or missing references) //IL_128d: Unknown result type (might be due to invalid IL or missing references) //IL_13a1: Unknown result type (might be due to invalid IL or missing references) //IL_13ed: Unknown result type (might be due to invalid IL or missing references) //IL_13b6: Unknown result type (might be due to invalid IL or missing references) float realtimeSinceStartup = Time.realtimeSinceStartup; Img(new Rect(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).y + 16f, 96f, 96f), Tex.RoundFrame, accent); GUI.DrawTexture(new Rect(((Rect)(ref p)).x + 26f + 12f, ((Rect)(ref p)).y + 16f + 12f, 72f, 72f), (Texture)(object)Icons.ForClass(d.Class)); Text(new Rect(((Rect)(ref p)).x + 138f, ((Rect)(ref p)).y + 16f, 460f, 38f), ClassName(d.Class), 30, Parchment, (TextAnchor)3, bold: true, wrap: false, shadow: true); Text(new Rect(((Rect)(ref p)).x + 140f, ((Rect)(ref p)).y + 50f, 300f, 22f), L.F("ui.level", d.Level), 16, accent, (TextAnchor)3, bold: true); if (d.Trans > 0) { Text(new Rect(((Rect)(ref p)).x + 260f, ((Rect)(ref p)).y + 50f, 300f, 22f), L.F("ui.trans_count", d.Trans, Plugin.TranscendMax.Value), 14, GoldBright, (TextAnchor)3, bold: true); } bool flag = d.Level >= Plugin.MaxLevel.Value; float num = (flag ? 1f : ((float)d.Xp / (float)RpgData.XpForNext(d.Level))); Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref p)).x + 140f, ((Rect)(ref p)).y + 78f, 520f, 20f); Fill(new Rect(((Rect)(ref r)).x - 2f, ((Rect)(ref r)).y - 2f, ((Rect)(ref r)).width + 4f, ((Rect)(ref r)).height + 4f), new Color(Gold.r * 0.6f, Gold.g * 0.6f, Gold.b * 0.6f)); Fill(r, new Color(0.04f, 0.04f, 0.05f)); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width * num, ((Rect)(ref r)).height), accent); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width * num, 6f), Color.Lerp(accent, Color.white, 0.45f)); for (int i = 1; i < 10; i++) { Fill(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * (float)i / 10f - 1f, ((Rect)(ref r)).y, 2f, ((Rect)(ref r)).height), new Color(0f, 0f, 0f, 0.5f)); } Text(r, flag ? L.T("ui.max_level") : (d.Xp + " / " + RpgData.XpForNext(d.Level) + " XP"), 12, Color.white, (TextAnchor)4, bold: true, wrap: false, shadow: true); string[] array = new string[3] { L.T("ui.tab.skills"), L.T("ui.tab.talents"), L.T("ui.tab.sheet") }; for (int j = 0; j < 3; j++) { if (Btn(new Rect(((Rect)(ref p)).xMax - 356f, ((Rect)(ref p)).y + 16f + (float)(j * 32), 104f, 28f), array[j], (tab == j) ? new Color(accent.r * 0.55f, accent.g * 0.55f, accent.b * 0.55f) : new Color(0.15f, 0.13f, 0.11f), enabled: true, 14)) { tab = j; } } int num2 = ((tab == 1) ? Talents.Available(d) : d.Points); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref p)).xMax - 240f, ((Rect)(ref p)).y + 56f, 200f, 54f); if (num2 > 0) { Img(new Rect(((Rect)(ref r2)).x - 30f, ((Rect)(ref r2)).y - 18f, ((Rect)(ref r2)).width + 60f, ((Rect)(ref r2)).height + 36f), Tex.Glow, new Color(GoldBright.r, GoldBright.g, GoldBright.b, 0.22f + 0.15f * Mathf.Sin(realtimeSinceStartup * 3f))); } Fill(new Rect(((Rect)(ref r2)).x - 2f, ((Rect)(ref r2)).y - 2f, ((Rect)(ref r2)).width + 4f, ((Rect)(ref r2)).height + 4f), (Color)((num2 > 0) ? GoldBright : new Color(Gold.r * 0.5f, Gold.g * 0.5f, Gold.b * 0.5f))); Fill(r2, new Color(0.07f, 0.065f, 0.06f)); Text(new Rect(((Rect)(ref r2)).x, ((Rect)(ref r2)).y + 1f, ((Rect)(ref r2)).width, 34f), num2.ToString(), 28, (num2 > 0) ? GoldBright : Muted, (TextAnchor)4, bold: true); Text(new Rect(((Rect)(ref r2)).x, ((Rect)(ref r2)).y + 34f, ((Rect)(ref r2)).width, 18f), (tab == 1) ? L.T("ui.points_talent") : L.T("ui.points_skill"), 11, Muted, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).y + 112f, ((Rect)(ref p)).width - 52f, 26f), Tex.Runes, new Color(Gold.r, Gold.g, Gold.b, 0.4f)); if (d.CanTranscend) { Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref p)).x + 680f - 360f, ((Rect)(ref p)).y + 102f, 240f, 32f); Img(new Rect(((Rect)(ref r3)).x - 30f, ((Rect)(ref r3)).y - 14f, ((Rect)(ref r3)).width + 60f, ((Rect)(ref r3)).height + 28f), Tex.Glow, new Color(GoldBright.r, GoldBright.g, GoldBright.b, 0.25f + 0.15f * Mathf.Sin(realtimeSinceStartup * 3f))); if (Btn(r3, L.T("ui.transcend"), new Color(0.45f, 0.33f, 0.08f), enabled: true, 15)) { modal = 3; } } if (tab == 1) { TalentsView(d, p, accent); return; } if (tab == 2) { Sheet(d, p, accent); Footer(d, p, accent); return; } tInit = false; List list = Abilities.For(d.Class); string[] array2 = BranchNames(d.Class); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).y + 144f, ((Rect)(ref p)).width - 280f, ((Rect)(ref p)).height - 262f); Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(((Rect)(ref val)).xMax - 122f, ((Rect)(ref val)).y + 8f, 114f, 26f); if (!treeInit) { zoom = Mathf.Clamp(Mathf.Min(((Rect)(ref val)).width / 690f, ((Rect)(ref val)).height / 650f), 0.45f, 1.4f); pan = new Vector2(((Rect)(ref val)).width / 2f - 380f * zoom, ((Rect)(ref val)).height / 2f - 330f * zoom); treeInit = true; } Event current = Event.current; Vector2 mousePosition = current.mousePosition; bool flag2 = ((Rect)(ref val)).Contains(mousePosition); if ((int)current.type == 6 && flag2) { float num3 = Mathf.Clamp(zoom * (1f - current.delta.y * 0.05f), 0.45f, 1.6f); Vector2 val2 = mousePosition - new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y); pan = val2 - (val2 - pan) * (num3 / zoom); zoom = num3; current.Use(); } Fill(val, new Color(0f, 0f, 0f, 0.28f)); Frame(val, new Color(Gold.r, Gold.g, Gold.b, 0.3f), 1f); GUI.BeginGroup(val); float z = zoom; Func func = (Vector2 v) => new Vector2(pan.x + v.x * z, pan.y + v.y * z); Func func2 = (float size) => Mathf.Max(8, Mathf.RoundToInt(size * z)); Vector2 val3 = func(NodeCenter(p, 1, 0)); foreach (Ability item in list) { Vector2 val4 = ((item.Parent == null) ? val3 : func(NodeCenter(p, item.Col, Abilities.Find(item.Parent).Row))); Vector2 val5 = func(NodeCenter(p, item.Col, item.Row)); bool num4 = d.Rank(item.Id) > 0; bool flag3 = !num4 && d.Available(item); if (num4) { Stroke(val4, val5, 11f * z, new Color(accent.r, accent.g, accent.b, 0.18f)); Stroke(val4, val5, 5f * z, accent); Vector2 val6 = Vector2.Lerp(val4, val5, (realtimeSinceStartup * 0.6f + (float)item.Col * 0.31f + (float)item.Row * 0.17f) % 1f); Img(new Rect(val6.x - 5f * z, val6.y - 5f * z, 10f * z, 10f * z), Tex.Pip, Color.white); } else if (flag3) { DashedStroke(val4, val5, 4f * z, Silver, 16f * z, 9f * z); } else { Stroke(val4, val5, 3f * z, new Color(0.17f, 0.16f, 0.15f)); } } for (int num5 = 0; num5 < 3; num5++) { Vector2 val7 = func(new Vector2(ColX[num5] - 30f, 132f)); Rect r5 = new Rect(val7.x - 105f * z, val7.y, 210f * z, 20f * z); Fill(r5, new Color(0.06f, 0.055f, 0.05f, 0.95f)); Frame(r5, new Color(Gold.r, Gold.g, Gold.b, 0.5f), 1f); Text(r5, array2[num5], func2(12f), Gold, (TextAnchor)4, bold: true); } Img(new Rect(val3.x - 54f * z, val3.y - 54f * z, 108f * z, 108f * z), Tex.Glow, new Color(accent.r, accent.g, accent.b, 0.35f)); Img(new Rect(val3.x - 44f * z, val3.y - 44f * z, 88f * z, 88f * z), Tex.RoundFrame, accent); GUI.DrawTexture(new Rect(val3.x - 32f * z, val3.y - 32f * z, 64f * z, 64f * z), (Texture)(object)Icons.ForClass(d.Class)); Ability ability = null; Vector2 val8 = Vector2.zero; Rect r6 = default(Rect); Rect r7 = default(Rect); foreach (Ability item2 in list) { Vector2 val9 = func(NodeCenter(p, item2.Col, item2.Row)); ((Rect)(ref r6))..ctor(val9.x - 36f * z, val9.y - 36f * z, 72f * z, 72f * z); int num6 = d.Rank(item2.Id); bool flag4 = d.Available(item2); bool flag5 = num6 >= item2.MaxRank; bool flag6 = flag2 && ((Rect)(ref r6)).Contains(Event.current.mousePosition); if (flag6) { ability = item2; val8 = val9; } float num7 = z * (flag6 ? 1.09f : 1f); Color val10 = (flag5 ? GoldBright : ((num6 > 0) ? accent : (flag4 ? Silver : Locked))); float num8 = (item2.Active ? 98f : 84f) * num7; float num9 = 58f * num7; if (flag5) { Img(new Rect(val9.x - 70f * num7, val9.y - 70f * num7, 140f * num7, 140f * num7), Tex.Glow, new Color(GoldBright.r, GoldBright.g, GoldBright.b, 0.45f)); } else if (num6 > 0) { Img(new Rect(val9.x - 62f * num7, val9.y - 62f * num7, 124f * num7, 124f * num7), Tex.Glow, new Color(accent.r, accent.g, accent.b, 0.3f)); } else if (flag4 && d.Points > 0) { Img(new Rect(val9.x - 66f * num7, val9.y - 66f * num7, 132f * num7, 132f * num7), Tex.Glow, new Color(Silver.r, Silver.g, Silver.b, 0.18f + 0.16f * Mathf.Sin(realtimeSinceStartup * 3.2f + (float)item2.Col + (float)item2.Row))); } Img(new Rect(val9.x - 33f * num7, val9.y - 33f * num7, 66f * num7, 66f * num7), Tex.Disc, new Color(0.04f, 0.04f, 0.05f, 0.95f)); GUI.color = (Color)((num6 > 0) ? Color.white : (flag4 ? new Color(1f, 1f, 1f, 0.75f) : new Color(0.4f, 0.4f, 0.4f, 0.55f))); GUI.DrawTexture(new Rect(val9.x - num9 / 2f, val9.y - num9 / 2f, num9, num9), (Texture)(object)Icons.ForAbility(item2)); GUI.color = Color.white; Img(new Rect(val9.x - num8 / 2f, val9.y - num8 / 2f, num8, num8), item2.Active ? Tex.DiamondFrame : Tex.RoundFrame, flag6 ? Color.white : val10); float num10 = 11f * num7; float num11 = (float)item2.MaxRank * num10; float num12 = val9.y + (item2.Active ? 51f : 44f) * num7; Fill(new Rect(val9.x - num11 / 2f - 3f * num7, num12 - num7, num11 + 6f * num7, 13f * num7), new Color(0.04f, 0.04f, 0.05f, 0.92f)); for (int num13 = 0; num13 < item2.MaxRank; num13++) { Img(new Rect(val9.x - num11 / 2f + (float)num13 * num10, num12, num10, num10), Tex.Pip, (Color)((num13 < num6) ? (flag5 ? GoldBright : accent) : new Color(0.22f, 0.21f, 0.2f))); } int num14 = Array.IndexOf(d.Slots, item2.Id); if (num14 >= 0) { ((Rect)(ref r7))..ctor(val9.x + 22f * num7, val9.y - 46f * num7, 22f * num7, 20f * num7); Fill(new Rect(((Rect)(ref r7)).x - 1f, ((Rect)(ref r7)).y - 1f, ((Rect)(ref r7)).width + 2f, ((Rect)(ref r7)).height + 2f), Gold); Fill(r7, new Color(0.07f, 0.065f, 0.06f)); Text(r7, ((object)Plugin.AbilityKeys[num14].Value/*cast due to .constrained prefix*/).ToString(), func2(12f), GoldBright, (TextAnchor)4, bold: true); } Event current4 = Event.current; if (flag2 && (int)current4.type == 0 && current4.button == 1 && ((Rect)(ref r6)).Contains(current4.mousePosition)) { Click(d, item2, flag4, shift: false, ctrl: true); current4.Use(); continue; } bool shift = current4.shift; bool control = current4.control; if (flag2 && LeftButton(r6, GUIContent.none, GUIStyle.none)) { Click(d, item2, flag4, shift, control); } } GUI.EndGroup(); Event current5 = Event.current; if ((int)current5.type == 0 && flag2 && !((Rect)(ref r4)).Contains(mousePosition) && (current5.button == 2 || (current5.button == 0 && ability == null))) { dragging = true; dragLast = mousePosition; current5.Use(); } else if (dragging && (int)current5.type == 3) { pan += mousePosition - dragLast; dragLast = mousePosition; current5.Use(); } if ((int)current5.rawType == 1) { dragging = false; } if (Btn(r4, L.T("ui.center"), new Color(0.2f, 0.17f, 0.14f), enabled: true, 12)) { treeInit = false; } Text(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).yMax - 22f, 360f, 18f), L.T("ui.hint_zoom_pan"), 11, Muted, (TextAnchor)3, bold: false, wrap: false, shadow: true); if (ability != null && ability.Active) { Event current6 = Event.current; if ((int)current6.type == 4 && ((int)current6.keyCode == 49 || (int)current6.keyCode == 50)) { Toast(d.EquipTo(ability, ((int)current6.keyCode != 49) ? 1 : 0)); current6.Use(); } } Sidebar(d, p, accent); Footer(d, p, accent); if (ability != null) { Tooltip(d, ability, new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y) + val8, accent, p); } } private static string Pct(float v) { return ((v >= 0f) ? "+" : "") + (v * 100f).ToString("0.#") + "%"; } private static void Row(ref float y, Rect col, string label, string value, Color vc) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) Text(new Rect(((Rect)(ref col)).x + 14f, y, ((Rect)(ref col)).width * 0.62f, 20f), label, 13, Muted, (TextAnchor)3); Text(new Rect(((Rect)(ref col)).x + ((Rect)(ref col)).width * 0.5f, y, ((Rect)(ref col)).width * 0.5f - 14f, 20f), value, 13, vc, (TextAnchor)5, bold: true); y += 25f; } private static void StatRow(ref float y, Rect col, string label, float total, float passive, bool pct, string suffix = "") { //IL_0041: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) string text = (pct ? Pct(total) : (((total >= 0f) ? "+" : "") + total.ToString("0.0") + suffix)); bool flag = total > passive + 0.0001f; Row(ref y, col, label, (total <= 0f) ? "—" : (text + (flag ? " *" : "")), (total <= 0f) ? Muted : (flag ? GoldBright : Parchment)); } private static Rect Section(Rect col, string title) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref col)).x - 2f, ((Rect)(ref col)).y - 2f, ((Rect)(ref col)).width + 4f, ((Rect)(ref col)).height + 4f), new Color(Gold.r * 0.45f, Gold.g * 0.45f, Gold.b * 0.45f)); Fill(col, new Color(0.06f, 0.055f, 0.05f, 0.96f)); Text(new Rect(((Rect)(ref col)).x, ((Rect)(ref col)).y + 8f, ((Rect)(ref col)).width, 20f), title, 13, Gold, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref col)).x + 14f, ((Rect)(ref col)).y + 28f, ((Rect)(ref col)).width - 28f, 12f), Tex.Divider, Gold); return col; } private static void Sheet(RpgData d, Rect p, Color accent) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00cd: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0837: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_0981: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_098a: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_0a07: Unknown result type (might be due to invalid IL or missing references) //IL_0a0f: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a60: Unknown result type (might be due to invalid IL or missing references) //IL_0a59: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { float num = ((Rect)(ref p)).y + 148f; float num2 = ((Rect)(ref p)).height - 270f; float num3 = (((Rect)(ref p)).width - 56f - 28f) / 3f; float num4 = 14f; Rect col = Section(new Rect(((Rect)(ref p)).x + 28f, num, num3, num2), L.T("sheet.attributes")); Rect col2 = Section(new Rect(((Rect)(ref p)).x + 28f + num3 + num4, num, num3, num2), L.T("sheet.combat")); Rect val = Section(new Rect(((Rect)(ref p)).x + 28f + (num3 + num4) * 2f, num, num3, num2), L.T("sheet.weapons")); Func func = (Eff e) => Stats.Get(e); Func func2 = (Eff e) => Stats.GetPassive(e); float y = ((Rect)(ref col)).y + 50f; Row(ref y, col, L.T("sheet.max_health"), ((Character)localPlayer).GetMaxHealth().ToString("0"), Parchment); Row(ref y, col, L.T("sheet.max_stamina"), ((Character)localPlayer).GetMaxStamina().ToString("0"), Parchment); Row(ref y, col, L.T("sheet.max_eitr"), ((Character)localPlayer).GetMaxEitr().ToString("0"), Parchment); y += 8f; StatRow(ref y, col, L.T("sheet.move_speed"), func(Eff.MoveSpeed), func2(Eff.MoveSpeed), pct: true); StatRow(ref y, col, L.T("sheet.regen_health"), func(Eff.HealthRegen), func2(Eff.HealthRegen), pct: false, " /s"); StatRow(ref y, col, L.T("sheet.regen_stamina"), func(Eff.StaminaRegen), func2(Eff.StaminaRegen), pct: false, " /s"); StatRow(ref y, col, L.T("sheet.regen_eitr"), func(Eff.EitrRegen), func2(Eff.EitrRegen), pct: false, " /s"); StatRow(ref y, col, L.T("sheet.stamina_cost"), 0f - func(Eff.StaminaCost), 0f - func2(Eff.StaminaCost), pct: true); StatRow(ref y, col, L.T("sheet.cooldown"), 0f - func(Eff.Cooldown), 0f - func2(Eff.Cooldown), pct: true); y += 8f; StatRow(ref y, col, L.T("sheet.armor"), func(Eff.ArmorBonus), func2(Eff.ArmorBonus), pct: true); StatRow(ref y, col, L.T("sheet.elemental_resist"), 0f - Mathf.Min(0.75f, func(Eff.ElementalResist)), 0f - func2(Eff.ElementalResist), pct: true); StatRow(ref y, col, L.T("sheet.experience"), func(Eff.Experience), func2(Eff.Experience), pct: true); StatRow(ref y, col, L.T("sheet.ammo_save"), func(Eff.AmmoSave), func2(Eff.AmmoSave), pct: true); Plugin.LevelBonus(d.Class, d.Level, out var hp, out var stamina, out var eitr); y += 10f; Text(new Rect(((Rect)(ref col)).x + 14f, y, ((Rect)(ref col)).width - 28f, 70f), L.F("sheet.level_bonus", d.Level) + "\n+" + hp.ToString("0") + " " + L.T("stat.life") + ((stamina > 0f) ? (" +" + stamina.ToString("0.#") + " " + L.T("stat.stamina")) : "") + ((eitr > 0f) ? (" +" + eitr.ToString("0") + " " + L.T("stat.eitr")) : ""), 12, Muted, (TextAnchor)0, bold: false, wrap: true); y = ((Rect)(ref col2)).y + 50f; StatRow(ref y, col2, L.T("sheet.damage"), func(Eff.Damage), func2(Eff.Damage), pct: true); StatRow(ref y, col2, L.T("sheet.melee"), func(Eff.Damage) + func(Eff.MeleeDamage), func2(Eff.Damage) + func2(Eff.MeleeDamage), pct: true); StatRow(ref y, col2, L.T("sheet.ranged"), func(Eff.Damage) + func(Eff.RangedDamage), func2(Eff.Damage) + func2(Eff.RangedDamage), pct: true); StatRow(ref y, col2, L.T("sheet.magic"), func(Eff.Damage) + func(Eff.MagicDamage), func2(Eff.Damage) + func2(Eff.MagicDamage), pct: true); StatRow(ref y, col2, L.T("sheet.ability_power"), func(Eff.AbilityPower), func2(Eff.AbilityPower), pct: true); y += 8f; StatRow(ref y, col2, L.T("sheet.crit"), func(Eff.Crit), func2(Eff.Crit), pct: true); StatRow(ref y, col2, L.T("sheet.lifesteal"), func(Eff.LifeSteal), func2(Eff.LifeSteal), pct: true); StatRow(ref y, col2, L.T("sheet.execute"), func(Eff.Execute), func2(Eff.Execute), pct: true); StatRow(ref y, col2, L.T("sheet.opening"), func(Eff.Opening), func2(Eff.Opening), pct: true); y += 8f; StatRow(ref y, col2, L.T("sheet.damage_taken"), 0f - Mathf.Min(0.8f, func(Eff.Resist)), 0f - Mathf.Min(0.8f, func2(Eff.Resist)), pct: true); StatRow(ref y, col2, L.T("sheet.kill_heal"), func(Eff.KillHeal), func2(Eff.KillHeal), pct: true); y += 8f; StatRow(ref y, col2, L.T("sheet.mining"), func(Eff.MiningDamage), func2(Eff.MiningDamage), pct: true); StatRow(ref y, col2, L.T("sheet.chopping"), func(Eff.ChoppingDamage), func2(Eff.ChoppingDamage), pct: true); StatRow(ref y, col2, L.T("sheet.harvest"), func(Eff.HarvestYield), func2(Eff.HarvestYield), pct: true); StatRow(ref y, col2, L.T("sheet.food"), func(Eff.FoodDuration), func2(Eff.FoodDuration), pct: true); StatRow(ref y, col2, L.T("sheet.fishing"), func(Eff.FishingSkill), func2(Eff.FishingSkill), pct: false); Text(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 46f, ((Rect)(ref val)).width - 28f, 34f), L.T("sheet.weapons_hint"), 11, Muted, (TextAnchor)0, bold: false, wrap: true); SkillType[] array = new SkillType[12]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); y = ((Rect)(ref val)).y + 92f; SkillType[] array2 = (SkillType[])(object)array; Rect r = default(Rect); foreach (SkillType val2 in array2) { float skillFactor = ((Character)localPlayer).GetSkills().GetSkillFactor(val2); bool flag = SkillFollowsLevel.Primary(d.Class, val2); string text = SkillName(val2); Text(new Rect(((Rect)(ref val)).x + 14f, y, 110f, 20f), (flag ? "★ " : "") + text, 13, flag ? GoldBright : Parchment, (TextAnchor)3, flag); ((Rect)(ref r))..ctor(((Rect)(ref val)).x + 128f, y + 4f, 80f, 12f); Fill(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, ((Rect)(ref r)).width + 2f, ((Rect)(ref r)).height + 2f), new Color(Gold.r * 0.4f, Gold.g * 0.4f, Gold.b * 0.4f)); Fill(r, new Color(0.04f, 0.04f, 0.05f)); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width * Mathf.Clamp01(skillFactor), ((Rect)(ref r)).height), (Color)(flag ? accent : new Color(accent.r * 0.6f, accent.g * 0.6f, accent.b * 0.6f))); Text(new Rect(((Rect)(ref val)).x + 210f, y, 30f, 20f), Mathf.RoundToInt(skillFactor * 100f).ToString(), 13, Parchment, (TextAnchor)5, bold: true); float num6 = func(Eff.Damage) + TalentPerks.WeaponBonus(val2) + CategoryBonus(val2); Text(new Rect(((Rect)(ref val)).xMax - 68f, y, 58f, 20f), (num6 > 0f) ? Pct(num6) : "—", 13, (num6 > 0f) ? Green : Muted, (TextAnchor)5, bold: true); y += 30f; } } } private static float CategoryBonus(SkillType s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown switch (s - 1) { case 0: case 1: case 2: case 3: case 4: case 6: case 10: return Stats.Get(Eff.MeleeDamage); case 7: case 13: return Stats.Get(Eff.RangedDamage); case 8: case 9: return Stats.Get(Eff.MagicDamage); default: return 0f; } } private unsafe static string SkillName(SkillType s) { return L.T("skill." + ((object)(*(SkillType*)(&s))/*cast due to .constrained prefix*/).ToString()); } private static string TalentGlyph(TNode n) { if (n.IsOrigin) { return "star"; } switch (n.Effects[0].Effect) { case Eff.Damage: case Eff.MeleeDamage: case Eff.SwordDamage: case Eff.KnifeDamage: case Eff.AxeDamage: case Eff.ClubDamage: return "sword"; case Eff.RangedDamage: case Eff.BowDamage: case Eff.CrossbowDamage: case Eff.AmmoSave: return "a_rain"; case Eff.MagicDamage: case Eff.ElementalDamage: case Eff.BloodDamage: return "m_blast"; case Eff.MaxHealth: return "heart"; case Eff.MaxStamina: return "a_endur"; case Eff.MaxEitr: return "m_arcana"; case Eff.MoveSpeed: return "r_reflex"; case Eff.Experience: return "star"; case Eff.ArmorBonus: case Eff.ElementalResist: return "w_iron"; case Eff.MiningDamage: return "pick"; case Eff.ChoppingDamage: return "axe"; case Eff.HarvestYield: return "leaf"; case Eff.FoodDuration: return "bowl"; case Eff.FishingSkill: return "fish"; case Eff.LifeSteal: return "m_well"; case Eff.HealthRegen: return "w_wind"; case Eff.StaminaRegen: return "clock"; default: return "star"; } } private static Vector2 TV(Vector2 treePos) { //IL_000a: 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_002e: Unknown result type (might be due to invalid IL or missing references) return new Vector2(tpan.x + treePos.x * tzoom, tpan.y - treePos.y * tzoom); } private static void CenterOn(Vector2 treePos, float zoom, Rect vp) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) tzoom = zoom; tpan = new Vector2(((Rect)(ref vp)).width / 2f - treePos.x * zoom, ((Rect)(ref vp)).height / 2f + treePos.y * zoom); } private static void TalentsView(RpgData d, Rect p, Color accent) { //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_0084: 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_00ed: Invalid comparison between Unknown and I4 //IL_00d5: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_020d: 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_0217: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028e: 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_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Invalid comparison between Unknown and I4 //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Invalid comparison between Unknown and I4 //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_0980: Invalid comparison between Unknown and I4 //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_099f: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0a8f: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0ac8: Unknown result type (might be due to invalid IL or missing references) //IL_0ad9: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0a28: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Unknown result type (might be due to invalid IL or missing references) //IL_0a55: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b10: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) float realtimeSinceStartup = Time.realtimeSinceStartup; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).y + 144f, ((Rect)(ref p)).width - 280f, ((Rect)(ref p)).height - 262f); Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref val)).xMax - 122f, ((Rect)(ref val)).y + 8f, 114f, 26f); Event current = Event.current; Vector2 mousePosition = current.mousePosition; bool flag = ((Rect)(ref val)).Contains(mousePosition); if (!tInit) { tzoom = Mathf.Clamp(0.42f * ((Rect)(ref val)).height / 508f, 0.2f, 0.9f); tpan = new Vector2(((Rect)(ref val)).width / 2f, ((Rect)(ref val)).height / 2f); tInit = true; } if ((int)current.type == 6 && flag) { float num = Mathf.Clamp(tzoom * (1f - current.delta.y * 0.05f), 0.15f, 1.3f); Vector2 val2 = mousePosition - new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y); tpan = val2 - (val2 - tpan) * (num / tzoom); tzoom = num; current.Use(); } Fill(val, new Color(0.02f, 0.02f, 0.025f, 0.92f)); Frame(val, new Color(Gold.r, Gold.g, Gold.b, 0.3f), 1f); float z = tzoom; DrawTalentLinks(d, val); GUI.BeginGroup(val); Func func = (float size) => Mathf.Max(8, Mathf.RoundToInt(size * z)); Vector2 mousePosition2 = Event.current.mousePosition; foreach (KeyValuePair item in Talents.ArmLabel) { Vector2 val3 = TV(item.Value); if (!(val3.x < -100f) && !(val3.y < -30f) && !(val3.x > ((Rect)(ref val)).width + 100f) && !(val3.y > ((Rect)(ref val)).height + 30f)) { Text(new Rect(val3.x - 120f, val3.y - 14f, 240f, 28f), L.T("group." + item.Key).ToUpper(), Mathf.Max(10, func(17f)), Talents.GroupColor(item.Key), (TextAnchor)4, bold: true, wrap: false, shadow: true); } } TNode tNode = null; Vector2 val4 = Vector2.zero; float num2 = 0f; int num3 = Talents.Available(d); foreach (TNode item2 in Talents.All) { Vector2 val5 = TV(item2.Pos); float num4 = (item2.IsOrigin ? 88f : ((item2.Tier == NodeTier.Keystone) ? 98f : ((item2.Tier == NodeTier.Notable) ? 74f : 56f))) * z; if (val5.x < 0f - num4 || val5.y < 0f - num4 || val5.x > ((Rect)(ref val)).width + num4 || val5.y > ((Rect)(ref val)).height + num4) { continue; } int num5 = d.TalentRank(item2.Id); bool flag2 = Talents.IsAvailable(item2, d); bool flag3 = num5 >= item2.MaxRank; Color val6 = (item2.IsOrigin ? Gold : Talents.GroupColor(item2.Group)); Color val7 = ((item2.IsOrigin || flag3) ? GoldBright : ((num5 > 0) ? val6 : (flag2 ? Silver : Locked))); int num6; if (flag) { Vector2 val8 = mousePosition2 - val5; num6 = ((((Vector2)(ref val8)).sqrMagnitude <= num4 * 0.55f * num4 * 0.55f) ? 1 : 0); } else { num6 = 0; } bool flag4 = (byte)num6 != 0; if (flag4) { tNode = item2; val4 = val5; num2 = num4 * 0.55f; } float num7 = num4 * (flag4 ? 1.12f : 1f); if (num5 > 0 || item2.IsOrigin) { Img(new Rect(val5.x - num7, val5.y - num7, num7 * 2f, num7 * 2f), Tex.Glow, new Color(val6.r, val6.g, val6.b, (item2.Tier == NodeTier.Keystone) ? 0.5f : 0.28f)); } else if (flag2 && num3 >= item2.Cost) { Img(new Rect(val5.x - num7 * 0.95f, val5.y - num7 * 0.95f, num7 * 1.9f, num7 * 1.9f), Tex.Glow, new Color(Silver.r, Silver.g, Silver.b, 0.16f + 0.14f * Mathf.Sin(realtimeSinceStartup * 3.2f + item2.Pos.x * 0.01f))); } if (z < 0.24f) { Img(new Rect(val5.x - num7 * 0.4f, val5.y - num7 * 0.4f, num7 * 0.8f, num7 * 0.8f), Tex.Disc, val7); continue; } Img(new Rect(val5.x - num7 * 0.4f, val5.y - num7 * 0.4f, num7 * 0.8f, num7 * 0.8f), Tex.Disc, new Color(0.04f, 0.04f, 0.05f, 0.95f)); GUI.color = (Color)((num5 > 0 || item2.IsOrigin) ? Color.white : (flag2 ? new Color(1f, 1f, 1f, 0.75f) : new Color(0.4f, 0.4f, 0.4f, 0.55f))); GUI.DrawTexture(new Rect(val5.x - num7 * 0.36f, val5.y - num7 * 0.36f, num7 * 0.72f, num7 * 0.72f), (Texture)(object)Icons.ForGlyph(TalentGlyph(item2), val6)); GUI.color = Color.white; Color val9 = (flag4 ? Color.white : val7); if (item2.IsOrigin) { Img(new Rect(val5.x - num7 / 2f, val5.y - num7 / 2f, num7, num7), Tex.RoundFrame, val9); } else if (item2.Tier == NodeTier.Minor) { Img(new Rect(val5.x - num7 / 2f, val5.y - num7 / 2f, num7, num7), Tex.RoundFrame, val9); } else { float num8 = ((item2.Tier == NodeTier.Keystone) ? 1.18f : 1.08f); Img(new Rect(val5.x - num7 * num8 / 2f, val5.y - num7 * num8 / 2f, num7 * num8, num7 * num8), Tex.DiamondFrame, val9); if (item2.Tier == NodeTier.Keystone) { Img(new Rect(val5.x - num7 * 0.66f, val5.y - num7 * 0.66f, num7 * 1.32f, num7 * 1.32f), Tex.RoundFrame, new Color(val9.r, val9.g, val9.b, 0.55f)); } } if (item2.MaxRank > 1 && z >= 0.3f) { Rect r2 = new Rect(val5.x + num7 * 0.22f, val5.y + num7 * 0.3f, num7 * 0.5f, num7 * 0.26f); Fill(r2, new Color(0.03f, 0.03f, 0.04f, 0.92f)); Text(r2, num5 + "/" + item2.MaxRank, func(11f), flag3 ? GoldBright : Color.white, (TextAnchor)4, bold: true); } } GUI.EndGroup(); Event current4 = Event.current; if ((int)current4.type == 0 && flag && !((Rect)(ref r)).Contains(mousePosition) && (current4.button == 2 || (current4.button == 0 && tNode == null))) { tDragging = true; tDragLast = mousePosition; current4.Use(); } else if (tDragging && (int)current4.type == 3) { tpan += mousePosition - tDragLast; tDragLast = mousePosition; current4.Use(); } if ((int)current4.rawType == 1) { tDragging = false; } if (tNode != null && !tNode.IsOrigin && (int)Event.current.type == 0 && Event.current.button == 1) { Toast(d.RefundTalent(tNode) ?? L.T("ui.refunded")); Event.current.Use(); } else if (tNode != null && !tNode.IsOrigin) { bool control = Event.current.control; if (LeftButton(new Rect(((Rect)(ref val)).x + val4.x - num2, ((Rect)(ref val)).y + val4.y - num2, num2 * 2f, num2 * 2f), GUIContent.none, GUIStyle.none)) { ClickTalent(d, tNode, control); } } if (Btn(r, L.T("ui.center"), new Color(0.2f, 0.17f, 0.14f), enabled: true, 12)) { tInit = false; } Text(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).yMax - 22f, 460f, 18f), L.T("ui.hint_talents_view"), 11, Muted, (TextAnchor)3, bold: false, wrap: false, shadow: true); TalentSidebar(d, p, val); TalentFooter(d, p); if (tNode != null) { TalentTooltip(d, tNode, new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y) + val4, p); } } private static void ClickTalent(RpgData d, TNode n, bool ctrl) { if (ctrl) { Toast(d.RefundTalent(n) ?? L.T("ui.refunded")); return; } string text = d.BuyTalent(n); if (text != null) { Toast(text); } } private static bool ClipSegment(ref Vector2 a, ref Vector2 b, Rect r) { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = 1f; float num3 = b.x - a.x; float num4 = b.y - a.y; float[] array = new float[4] { 0f - num3, num3, 0f - num4, num4 }; float[] array2 = new float[4] { a.x - ((Rect)(ref r)).xMin, ((Rect)(ref r)).xMax - a.x, a.y - ((Rect)(ref r)).yMin, ((Rect)(ref r)).yMax - a.y }; for (int i = 0; i < 4; i++) { if (Mathf.Approximately(array[i], 0f)) { if (array2[i] < 0f) { return false; } continue; } float num5 = array2[i] / array[i]; if (array[i] < 0f) { if (num5 > num2) { return false; } if (num5 > num) { num = num5; } } else { if (num5 < num) { return false; } if (num5 < num2) { num2 = num5; } } } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(a.x + num * num3, a.y + num * num4); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(a.x + num2 * num3, a.y + num2 * num4); a = val; b = val2; return true; } private static void Quad(Vector2 a, Vector2 b, float w, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; if (!(((Vector2)(ref val)).sqrMagnitude < 0.01f)) { ((Vector2)(ref val)).Normalize(); Vector2 val2 = new Vector2(0f - val.y, val.x) * (w * 0.5f); GL.Color(c); GL.Vertex3(a.x + val2.x, a.y + val2.y, 0f); GL.Vertex3(a.x - val2.x, a.y - val2.y, 0f); GL.Vertex3(b.x - val2.x, b.y - val2.y, 0f); GL.Vertex3(b.x + val2.x, b.y + val2.y, 0f); } } private static void DrawTalentLinks(RpgData d, Rect vp) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0106: 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_0145: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034c: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) if ((int)Event.current.type != 7) { return; } if ((Object)(object)glMat == (Object)null) { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Hidden/Internal-Colored"); if ((Object)(object)val == (Object)null) { return; } glMat = new Material(val) { hideFlags = (HideFlags)61 }; } float num = uiScale; float num2 = tzoom; Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref vp)).x * num, ((Rect)(ref vp)).y * num, ((Rect)(ref vp)).width * num, ((Rect)(ref vp)).height * num); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Rect)(ref r)).x + tpan.x * num, ((Rect)(ref r)).y + tpan.y * num); List list = new List(); List list2 = new List(); List> list3 = new List>(); Color c = default(Color); ((Color)(ref c))..ctor(0.17f, 0.16f, 0.15f, 1f); Vector2 a = default(Vector2); Vector2 b = default(Vector2); foreach (KeyValuePair edge in Talents.Edges) { ((Vector2)(ref a))..ctor(val2.x + edge.Key.Pos.x * num2 * num, val2.y - edge.Key.Pos.y * num2 * num); ((Vector2)(ref b))..ctor(val2.x + edge.Value.Pos.x * num2 * num, val2.y - edge.Value.Pos.y * num2 * num); if (ClipSegment(ref a, ref b, r)) { bool flag = edge.Key.IsOrigin || d.TalentRank(edge.Key.Id) > 0; bool flag2 = edge.Value.IsOrigin || d.TalentRank(edge.Value.Id) > 0; Vector2[] array = (Vector2[])(object)new Vector2[2] { a, b }; if (flag && flag2) { string text = ((!edge.Key.IsOrigin && edge.Key.Group != "Crossroads") ? edge.Key.Group : edge.Value.Group); list3.Add(new KeyValuePair(array, (text == "Origin" || text == "Crossroads") ? Gold : Talents.GroupColor(text))); } else if (flag || flag2) { list2.Add(array); } else { list.Add(array); } } } GL.PushMatrix(); GL.LoadPixelMatrix(0f, (float)Screen.width, (float)Screen.height, 0f); glMat.SetPass(0); GL.Begin(7); float w = Mathf.Max(1.2f, 2.5f * num2 * num); float w2 = Mathf.Max(1.6f, 3.2f * num2 * num); float num3 = Mathf.Max(2f, 5f * num2 * num); foreach (Vector2[] item in list) { Quad(item[0], item[1], w, c); } foreach (Vector2[] item2 in list2) { Quad(item2[0], item2[1], w2, new Color(Silver.r, Silver.g, Silver.b, 0.6f)); } foreach (KeyValuePair item3 in list3) { Quad(item3.Key[0], item3.Key[1], num3 * 2.4f, new Color(item3.Value.r, item3.Value.g, item3.Value.b, 0.18f)); } foreach (KeyValuePair item4 in list3) { Quad(item4.Key[0], item4.Key[1], num3, item4.Value); } GL.End(); GL.PopMatrix(); } private static void TalentSidebar(RpgData d, Rect p, Rect vp) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_049f: 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_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref p)).xMax - 240f, ((Rect)(ref p)).y + 144f, 214f, ((Rect)(ref p)).height - 262f); Fill(new Rect(((Rect)(ref r)).x - 2f, ((Rect)(ref r)).y - 2f, ((Rect)(ref r)).width + 4f, ((Rect)(ref r)).height + 4f), new Color(Gold.r * 0.45f, Gold.g * 0.45f, Gold.b * 0.45f)); Fill(r, new Color(0.06f, 0.055f, 0.05f, 0.96f)); Text(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + 8f, ((Rect)(ref r)).width, 20f), L.T("ui.t_points"), 13, Gold, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref r)).x + 14f, ((Rect)(ref r)).y + 28f, ((Rect)(ref r)).width - 28f, 12f), Tex.Divider, Gold); int num = Talents.Total(d); int num2 = Talents.Spent(d); Row2(r, ((Rect)(ref r)).y + 46f, L.F("ui.t_level", d.Level, Plugin.TalentPointsPerLevel.Value), (d.Level * Plugin.TalentPointsPerLevel.Value).ToString(), Parchment); Row2(r, ((Rect)(ref r)).y + 66f, L.F("ui.t_bosses", Talents.Bosses(), Plugin.TalentPointsPerBoss.Value), (Talents.Bosses() * Plugin.TalentPointsPerBoss.Value).ToString(), Parchment); Row2(r, ((Rect)(ref r)).y + 86f, L.T("ui.t_spent"), num2 + " / " + num, Muted); if (d.Trans > 0) { Text(new Rect(((Rect)(ref r)).x + 12f, ((Rect)(ref r)).y + 96f, ((Rect)(ref r)).width - 24f, 18f), L.F("ui.t_trans", d.Trans, d.TalentBank), 11, GoldBright, (TextAnchor)3); } Text(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + 116f, ((Rect)(ref r)).width, 20f), L.T("ui.t_branches"), 13, Gold, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref r)).x + 14f, ((Rect)(ref r)).y + 136f, ((Rect)(ref r)).width - 28f, 12f), Tex.Divider, Gold); float num3 = ((Rect)(ref r)).y + 154f; Rect r2 = default(Rect); foreach (string group in Talents.Groups) { ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 8f, num3, ((Rect)(ref r)).width - 16f, 22f); if (((Rect)(ref r2)).Contains(Event.current.mousePosition)) { Fill(r2, new Color(1f, 1f, 1f, 0.07f)); } Fill(new Rect(((Rect)(ref r2)).x + 4f, ((Rect)(ref r2)).y + 6f, 10f, 10f), Talents.GroupColor(group)); Text(new Rect(((Rect)(ref r2)).x + 20f, ((Rect)(ref r2)).y, 120f, 22f), L.T("group." + group), 12, Parchment, (TextAnchor)3); int num4 = Talents.SpentInGroup(d, group); Text(new Rect(((Rect)(ref r2)).xMax - 54f, ((Rect)(ref r2)).y, 50f, 22f), (num4 > 0) ? L.F("ui.pts", num4) : "—", 12, (num4 > 0) ? GoldBright : Muted, (TextAnchor)5, bold: true); if (LeftButton(r2, GUIContent.none, GUIStyle.none)) { CenterOn(Talents.ArmKeystone[group] * 0.62f, 0.55f, vp); tInit = true; } num3 += 24f; } Text(new Rect(((Rect)(ref r)).x + 10f, num3 + 6f, ((Rect)(ref r)).width - 20f, 40f), L.T("ui.t_branch_hint"), 11, Muted, (TextAnchor)0, bold: false, wrap: true); } private static void Row2(Rect r, float y, string label, string value, Color vc) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_005e: Unknown result type (might be due to invalid IL or missing references) Text(new Rect(((Rect)(ref r)).x + 12f, y, ((Rect)(ref r)).width - 24f, 18f), label, 12, Muted, (TextAnchor)3); Text(new Rect(((Rect)(ref r)).x + 12f, y, ((Rect)(ref r)).width - 24f, 18f), value, 12, vc, (TextAnchor)5, bold: true); } private static void TalentFooter(RpgData d, Rect p) { //IL_002c: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00d9: 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_017a: 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_012a: Unknown result type (might be due to invalid IL or missing references) Img(new Rect(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).yMax - 112f, ((Rect)(ref p)).width - 52f, 16f), Tex.Divider, Gold); int num = Talents.Available(d); Text(new Rect(((Rect)(ref p)).x + 34f, ((Rect)(ref p)).yMax - 82f, 420f, 24f), L.F("ui.free_points", num), 18, (num > 0) ? GoldBright : Muted, (TextAnchor)3, bold: true); Text(new Rect(((Rect)(ref p)).x + 34f, ((Rect)(ref p)).yMax - 56f, 420f, 20f), L.T("ui.t_rule"), 12, Muted, (TextAnchor)3); if (toast != null && Time.realtimeSinceStartup < toastUntil) { Text(new Rect(((Rect)(ref p)).x + 420f, ((Rect)(ref p)).yMax - 56f, 340f, 26f), toast, 15, GoldBright, (TextAnchor)3, bold: true, wrap: false, shadow: true); } if (Btn(new Rect(((Rect)(ref p)).xMax - 300f, ((Rect)(ref p)).yMax - 62f, 270f, 40f), L.T("ui.reset_talents"), new Color(0.2f, 0.17f, 0.14f), enabled: true, 14)) { modal = 1; } } private static void TalentTooltip(RpgData d, TNode n, Vector2 nodePos, Rect panel) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00a9: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0280: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) Color val = (n.IsOrigin ? Gold : Talents.GroupColor(n.Group)); int num = d.TalentRank(n.Id); bool flag = num >= n.MaxRank; List lines = new List(); Action action = delegate(string t, int s, Color c, bool b) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) lines.Add(new TipLine { T = t, Size = s, C = c, Bold = b }); }; action(n.Name, 19, Parchment, arg4: true); if (n.IsOrigin) { action(L.T("ui.origin_title"), 12, Gold, arg4: true); action(L.T("ui.origin_desc"), 13, Parchment, arg4: false); TipBox(lines, nodePos, val, panel); return; } string text = ((n.Tier == NodeTier.Keystone) ? L.T("ui.tier.keystone") : ((n.Tier == NodeTier.Notable) ? L.T("ui.tier.notable") : L.T("ui.tier.minor"))); action(text + " • " + L.T("group." + n.Group) + ((n.MaxRank > 1) ? (" • " + L.F("ui.rank_of", num, n.MaxRank)) : ""), 12, val, arg4: true); foreach (EffectAmount effect in n.Effects) { float num2 = n.Amount(effect); if (num > 0) { action(L.T("ui.now") + Stats.Describe(effect.Effect, num2 * (float)num), 13, Green, arg4: false); } if (!flag) { action(((num > 0) ? L.T("ui.next_rank") : L.T("ui.gives")) + Stats.Describe(effect.Effect, num2 * (float)(num + 1)), 13, (num > 0) ? Silver : Parchment, arg4: false); } } if (n.Perk != TalentPerk.None) { action("★ " + Talents.PerkText(n.Perk) + ((n.MaxRank > 1) ? L.T("ui.per_rank_paren") : ""), 13, GoldBright, arg4: false); } bool flag2 = Talents.IsAvailable(n, d); int num3 = Talents.Available(d); if (flag) { action(L.T("ui.rank_max"), 13, GoldBright, arg4: true); } else if (num == 0 && !flag2) { action(L.T("ui.locked_neighbor"), 13, Red, arg4: true); } else if (num3 < n.Cost) { action(L.F("ui.missing_points", n.Cost - num3, n.Cost), 13, Red, arg4: true); } else { action(L.F("ui.click_buy", n.Cost), 13, Green, arg4: true); } if (num > 0) { action(L.T("ui.ctrl_refund"), 11, Muted, arg4: false); } TipBox(lines, nodePos, val, panel); } private static void Click(RpgData d, Ability a, bool avail, bool shift, bool ctrl) { if (ctrl) { if (!Plugin.AllowRefund.Value) { Toast(L.T("ui.refund_disabled")); } else { Toast(d.Refund(a) ?? L.T("ui.refunded")); } } else if (shift) { d.SpendAll(a); } else if (!d.Spend(a)) { Toast((!avail) ? L.F("ui.requires", Abilities.Find(a.Parent).Name) : ((d.Points < a.Cost) ? L.T("ui.no_points") : L.T("ui.rank_max"))); } } private static void Sidebar(RpgData d, Rect p, Color accent) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00bb: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref p)).xMax - 240f, ((Rect)(ref p)).y + 144f, 214f, ((Rect)(ref p)).height - 262f); Fill(new Rect(((Rect)(ref r)).x - 2f, ((Rect)(ref r)).y - 2f, ((Rect)(ref r)).width + 4f, ((Rect)(ref r)).height + 4f), new Color(Gold.r * 0.45f, Gold.g * 0.45f, Gold.b * 0.45f)); Fill(r, new Color(0.06f, 0.055f, 0.05f, 0.96f)); float num = ((Rect)(ref r)).y + 10f; Text(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 20f), L.T("ui.tree_bonus"), 13, Gold, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref r)).x + 14f, num + 20f, ((Rect)(ref r)).width - 28f, 12f), Tex.Divider, Gold); num += 40f; bool flag = false; foreach (Eff value in Enum.GetValues(typeof(Eff))) { if (value == Eff.None) { continue; } float tree = Stats.GetTree(value); if (!(tree <= 0f)) { flag = true; string t = Stats.Describe(value, tree); float num2 = TextH(t, 12, ((Rect)(ref r)).width - 24f, bold: false); Text(new Rect(((Rect)(ref r)).x + 12f, num, ((Rect)(ref r)).width - 24f, num2), t, 12, Parchment, (TextAnchor)0, bold: false, wrap: true); num += num2 + 5f; if (num > ((Rect)(ref r)).y + 215f) { break; } } } if (!flag) { Text(new Rect(((Rect)(ref r)).x + 12f, num, ((Rect)(ref r)).width - 24f, 40f), L.T("ui.no_passives"), 12, Muted, (TextAnchor)0, bold: false, wrap: true); } num = ((Rect)(ref r)).y + 232f; Text(new Rect(((Rect)(ref r)).x, num, ((Rect)(ref r)).width, 20f), L.T("ui.how_to"), 13, Gold, (TextAnchor)4, bold: true); Img(new Rect(((Rect)(ref r)).x + 14f, num + 20f, ((Rect)(ref r)).width - 28f, 12f), Tex.Divider, Gold); num += 36f; string[] array = new string[7] { L.T("ui.hint.buy"), L.T("ui.hint.shift"), Plugin.AllowRefund.Value ? L.T("ui.hint.refund") : L.T("ui.hint.refund_off"), L.T("ui.hint.rclick"), L.T("ui.hint.numkeys"), L.T("ui.hint.zoom"), L.T("ui.hint.drag") }; foreach (string t2 in array) { float num3 = TextH(t2, 11, ((Rect)(ref r)).width - 24f, bold: false); Text(new Rect(((Rect)(ref r)).x + 12f, num, ((Rect)(ref r)).width - 24f, num3), t2, 11, Muted, (TextAnchor)0, bold: false, wrap: true); num += num3 + 4f; } } private static void Footer(RpgData d, Rect p, Color accent) { //IL_002c: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: 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_021a: 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_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) Img(new Rect(((Rect)(ref p)).x + 26f, ((Rect)(ref p)).yMax - 112f, ((Rect)(ref p)).width - 52f, 16f), Tex.Divider, Gold); Text(new Rect(((Rect)(ref p)).x + 30f, ((Rect)(ref p)).yMax - 90f, 220f, 16f), L.T("ui.skillbar"), 11, Muted, (TextAnchor)3, bold: true); Rect val = default(Rect); Rect r = default(Rect); for (int i = 0; i < 2; i++) { ((Rect)(ref val))..ctor(((Rect)(ref p)).x + 34f + (float)(i * 82), ((Rect)(ref p)).yMax - 70f, 54f, 54f); Ability ability = ((d.Slots[i] == null) ? null : Abilities.Find(d.Slots[i])); Img(new Rect(((Rect)(ref val)).x - 4f, ((Rect)(ref val)).y - 4f, 62f, 62f), Tex.Disc, new Color(0.05f, 0.05f, 0.06f, 0.9f)); if (ability != null) { GUI.DrawTexture(val, (Texture)(object)Icons.ForAbility(ability)); } Img(new Rect(((Rect)(ref val)).x - 8f, ((Rect)(ref val)).y - 8f, 70f, 70f), Tex.RoundFrame, (ability == null) ? Locked : Gold); ((Rect)(ref r))..ctor(((Rect)(ref val)).xMax - 4f, ((Rect)(ref val)).yMax - 14f, 22f, 18f); Fill(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, 24f, 20f), Gold); Fill(r, new Color(0.07f, 0.065f, 0.06f)); Text(r, ((object)Plugin.AbilityKeys[i].Value/*cast due to .constrained prefix*/).ToString(), 11, Parchment, (TextAnchor)4, bold: true); if (ability != null) { if (LeftButton(val, GUIContent.none, GUIStyle.none)) { d.ClearSlot(i); } if (((Rect)(ref val)).Contains(Event.current.mousePosition)) { Text(new Rect(((Rect)(ref val)).x - 20f, ((Rect)(ref val)).y - 38f, 100f, 16f), L.T("ui.click_remove"), 10, Muted, (TextAnchor)4, bold: false, wrap: false, shadow: true); } } } if (toast != null && Time.realtimeSinceStartup < toastUntil) { Text(new Rect(((Rect)(ref p)).x + 220f, ((Rect)(ref p)).yMax - 56f, 480f, 26f), toast, 15, GoldBright, (TextAnchor)3, bold: true, wrap: false, shadow: true); } if (Btn(new Rect(((Rect)(ref p)).xMax - 300f, ((Rect)(ref p)).yMax - 62f, 270f, 40f), L.T("ui.reset_class"), new Color(0.2f, 0.17f, 0.14f), enabled: true, 14)) { modal = 2; } } private static void Tooltip(RpgData d, Ability a, Vector2 nodePos, Color accent, Rect panel) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00e2: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) int num = d.Rank(a.Id); bool flag = num >= a.MaxRank; List lines = new List(); Action action = delegate(string t, int s, Color c, bool b) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) lines.Add(new TipLine { T = t, Size = s, C = c, Bold = b }); }; action(a.Name, 19, Parchment, arg4: true); string text = (a.Active ? L.T("ui.active") : L.T("ui.passive")); action(text + " • " + L.F("ui.rank_of", num, a.MaxRank), 12, a.Active ? GoldBright : accent, arg4: true); if (a.Cost != 1) { action(L.F("ui.cost_each", a.Cost), 12, Muted, arg4: false); } action(a.Desc, 13, Parchment, arg4: false); if (a.Active) { float num2 = 1f - Mathf.Min(0.5f, Stats.Get(Eff.Cooldown)); action(L.F("ui.cooldown", (a.Cooldown * num2).ToString("0.#")) + ((num2 < 1f) ? L.T("ui.reduced") : ""), 12, Muted, arg4: false); if (!string.IsNullOrEmpty(a.Info)) { action(a.Info, 12, Muted, arg4: false); } if (a.Preview != null) { if (num > 0) { action(L.T("ui.now") + a.Preview(num), 13, Green, arg4: false); } if (!flag) { action(L.T("ui.next_rank") + a.Preview(num + 1), 13, Silver, arg4: false); } } } else { if (num > 0) { action(L.T("ui.now") + Stats.Describe(a.Effect, a.PerRank * (float)num), 13, Green, arg4: false); } if (!flag) { action(L.T("ui.next_rank") + Stats.Describe(a.Effect, a.PerRank * (float)(num + 1)), 13, Silver, arg4: false); } } if (!d.Available(a)) { action(L.F("ui.locked_requires", Abilities.Find(a.Parent).Name), 13, Red, arg4: true); } else if (flag) { action(L.T("ui.rank_max"), 13, GoldBright, arg4: true); } else if (d.Points > 0) { action(L.T("ui.click_buy_one"), 13, Green, arg4: true); } else { action(L.T("ui.no_talent_points"), 13, Muted, arg4: false); } if (a.Active && num > 0) { action(L.T("ui.right_click_hint"), 11, Muted, arg4: false); } TipBox(lines, nodePos, accent, panel); } private static void TipBox(List lines, Vector2 nodePos, Color accent, Rect panel) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) float num = 24f; foreach (TipLine line in lines) { num += TextH(line.T, line.Size, 296f, line.Bold) + 4f; } float num2 = nodePos.x + 56f; float num3 = nodePos.y - 30f; if (num2 + 320f > ((Rect)(ref panel)).xMax - 10f) { num2 = nodePos.x - 56f - 320f; } if (num3 + num > ((Rect)(ref panel)).yMax - 10f) { num3 = ((Rect)(ref panel)).yMax - 10f - num; } if (num3 < ((Rect)(ref panel)).y + 10f) { num3 = ((Rect)(ref panel)).y + 10f; } Rect val = default(Rect); ((Rect)(ref val))..ctor(num2, num3, 320f, num); Fill(new Rect(((Rect)(ref val)).x + 5f, ((Rect)(ref val)).y + 6f, ((Rect)(ref val)).width, ((Rect)(ref val)).height), new Color(0f, 0f, 0f, 0.55f)); Fill(new Rect(((Rect)(ref val)).x - 2f, ((Rect)(ref val)).y - 2f, ((Rect)(ref val)).width + 4f, ((Rect)(ref val)).height + 4f), new Color(accent.r * 0.8f, accent.g * 0.8f, accent.b * 0.8f)); Fill(new Rect(((Rect)(ref val)).x - 1f, ((Rect)(ref val)).y - 1f, ((Rect)(ref val)).width + 2f, ((Rect)(ref val)).height + 2f), new Color(0.03f, 0.03f, 0.03f)); GUI.DrawTexture(val, (Texture)(object)Tex.Stone); Fill(val, new Color(0.04f, 0.035f, 0.03f, 0.55f)); float num4 = ((Rect)(ref val)).y + 12f; for (int i = 0; i < lines.Count; i++) { TipLine tipLine = lines[i]; float num5 = TextH(tipLine.T, tipLine.Size, 296f, tipLine.Bold); Text(new Rect(((Rect)(ref val)).x + 12f, num4, 296f, num5), tipLine.T, tipLine.Size, tipLine.C, (TextAnchor)0, tipLine.Bold, wrap: true); num4 += num5 + 4f; if (i == 1) { Img(new Rect(((Rect)(ref val)).x + 12f, num4 - 2f, 296f, 10f), Tex.Divider, new Color(accent.r, accent.g, accent.b, 0.8f)); } } } private static void Toast(string t) { toast = t; toastUntil = Time.realtimeSinceStartup + 2.5f; } private static string ClassName(RpgClass c) { if (c != RpgClass.None) { return L.T("class." + c); } return ""; } private static void Img(Rect r, Texture2D t, Color tint) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = tint; GUI.DrawTexture(r, (Texture)(object)t); GUI.color = color; } private static void Corner(float x, float y, bool flipX, bool flipY) { //IL_0000: 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_003d: 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_0059: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 matrix = GUI.matrix; Vector2 pivot = default(Vector2); ((Vector2)(ref pivot))..ctor(x + 24f, y + 24f); ScaleAbout(new Vector2(flipX ? (-1f) : 1f, flipY ? 1f : (-1f)), pivot); Img(new Rect(x, y, 48f, 48f), Tex.Corner, Gold); GUI.matrix = matrix; } private static void Frame(Rect r, Color c, float t) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, t), c); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - t, ((Rect)(ref r)).width, t), c); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, t, ((Rect)(ref r)).height), c); Fill(new Rect(((Rect)(ref r)).xMax - t, ((Rect)(ref r)).y, t, ((Rect)(ref r)).height), c); } private static void Line(Vector2 a, Vector2 b, float w, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 matrix = GUI.matrix; float num = Mathf.Atan2(b.y - a.y, b.x - a.x) * 57.29578f; GUI.matrix = matrix * Matrix4x4.TRS(Vector2.op_Implicit(a), Quaternion.Euler(0f, 0f, num), Vector3.one); float num2 = (0f - w) / 2f; Vector2 val = b - a; Fill(new Rect(0f, num2, ((Vector2)(ref val)).magnitude, w), c); GUI.matrix = matrix; } private static void Stroke(Vector2 a, Vector2 b, float w, Color c) { //IL_0000: 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_0057: 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_0019: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00e8: 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_00f0: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_0121: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(a.x - b.x) < 0.5f) { Fill(new Rect(a.x - w / 2f, Mathf.Min(a.y, b.y), w, Mathf.Abs(b.y - a.y)), c); return; } if (Mathf.Abs(a.y - b.y) < 0.5f) { Fill(new Rect(Mathf.Min(a.x, b.x), a.y - w / 2f, Mathf.Abs(b.x - a.x), w), c); return; } Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; float num = Mathf.Max(1f, w * 0.4f); Vector2 val2 = (b - a) / magnitude; for (float num2 = 0f; num2 <= magnitude; num2 += num) { Vector2 val3 = a + val2 * num2; Img(new Rect(val3.x - w / 2f, val3.y - w / 2f, w, w), Tex.Disc, c); } } private static void DashedStroke(Vector2 a, Vector2 b, float w, Color c, float period, float dash) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_004a: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; Vector2 val2 = (b - a) / magnitude; for (float num = 0f; num < magnitude; num += period) { Stroke(a + val2 * num, a + val2 * Mathf.Min(magnitude, num + dash), w, c); } } private static void ScaleAbout(Vector2 scale, Vector2 pivot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) GUI.matrix = GUI.matrix * Matrix4x4.TRS(Vector2.op_Implicit(pivot), Quaternion.identity, Vector3.one) * Matrix4x4.Scale(new Vector3(scale.x, scale.y, 1f)) * Matrix4x4.TRS(Vector2.op_Implicit(-pivot), Quaternion.identity, Vector3.one); } private static void Dashed(Vector2 a, Vector2 b, float w, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; Vector2 val2 = (b - a) / magnitude; for (float num = 0f; num < magnitude; num += 16f) { Line(a + val2 * num, a + val2 * Mathf.Min(magnitude, num + 9f), w, c); } } private static bool LeftButton(Rect r, GUIContent content, GUIStyle style) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) int button = Event.current.button; if (GUI.Button(r, content, style)) { return button == 0; } return false; } private static void Fill(Rect r, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private static GUIStyle Style(int size, bool bold, TextAnchor anchor, bool wrap) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (lbl == null) { lbl = new GUIStyle(GUI.skin.label) { richText = false }; } lbl.fontSize = size; lbl.fontStyle = (FontStyle)(bold ? 1 : 0); lbl.alignment = anchor; lbl.wordWrap = wrap; return lbl; } private static float TextH(string t, int size, float width, bool bold) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown return Style(size, bold, (TextAnchor)0, wrap: true).CalcHeight(new GUIContent(t), width); } private static void Text(Rect r, string t, int size, Color c, TextAnchor anchor = (TextAnchor)0, bool bold = false, bool wrap = false, bool shadow = false) { //IL_0003: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = Style(size, bold, anchor, wrap); if (shadow) { val.normal.textColor = new Color(0f, 0f, 0f, 0.9f); GUI.Label(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), t, val); } val.normal.textColor = c; GUI.Label(r, t, val); } private static bool Btn(Rect r, string label, Color col, bool enabled, int size) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00e0: 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) bool flag = enabled && ((Rect)(ref r)).Contains(Event.current.mousePosition); Fill(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, ((Rect)(ref r)).width + 2f, ((Rect)(ref r)).height + 2f), new Color(Gold.r * (flag ? 0.9f : 0.5f), Gold.g * (flag ? 0.9f : 0.5f), Gold.b * (flag ? 0.9f : 0.5f))); Fill(r, flag ? Color.Lerp(col, Color.white, 0.12f) : col); Text(r, label, size, (Color)(enabled ? Parchment : new Color(1f, 1f, 1f, 0.35f)), (TextAnchor)4, bold: true); return LeftButton(r, GUIContent.none, GUIStyle.none) && enabled; } } [HarmonyPatch(typeof(GameCamera), "UpdateMouseCapture")] internal static class UnlockCursor { private static bool Prefix() { if (!Ui.Open) { return true; } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; return false; } } [HarmonyPatch(typeof(ZInput), "GetMouseScrollWheel")] internal static class BlockScrollWheel { private static void Postfix(ref float __result) { if (Ui.Open) { __result = 0f; } } } [HarmonyPatch(typeof(PlayerController), "TakeInput")] internal static class BlockInput { private static void Postfix(ref bool __result) { if (Ui.Open) { __result = false; } } } public static class Vfx { private static Material mat; private static readonly HashSet warned = new HashSet(); private static Material Mat() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if ((Object)(object)mat != (Object)null) { return mat; } Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended"); if ((Object)(object)val == (Object)null) { Plugin.Log.LogWarning((object)"No shader available for procedural effects"); return null; } mat = new Material(val); return mat; } public static void Prefab(string[] names, Vector3 pos, float scale = 1f) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { return; } foreach (string text in names) { GameObject prefab = instance.GetPrefab(text); if ((Object)(object)prefab == (Object)null) { continue; } if ((Object)(object)prefab.GetComponentInChildren(true) != (Object)null) { if (warned.Add(text)) { Plugin.Log.LogInfo((object)("VFX: skipping networked prefab " + text)); } continue; } GameObject val = Object.Instantiate(prefab, pos, Quaternion.identity); if (scale != 1f) { Transform transform = val.transform; transform.localScale *= scale; } Object.Destroy((Object)(object)val, 6f); return; } if (warned.Add(names[0])) { Plugin.Log.LogInfo((object)("VFX: no prefab found for [" + string.Join(", ", names) + "]")); } } public static void After(float seconds, Action what) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown GameObject val = new GameObject("VR_After"); bool fired = false; Run(val, 0.01f, seconds, delegate { if (!fired) { fired = true; what(); } }); } public static void Scatter(string[] names, Vector3 center, float radius, int count, float span) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_007b: Expected O, but got Unknown for (int i = 0; i < count; i++) { Vector2 val = Random.insideUnitCircle * radius; Vector3 pos = center + new Vector3(val.x, 0f, val.y); GameObject val2 = new GameObject("VR_Scatter"); bool fired = false; Run(val2, 0.01f, Random.value * span, delegate { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!fired) { fired = true; Prefab(names, pos); } }); } } public static void Ring(Vector3 pos, float radius, Color color, float dur = 0.6f, float delay = 0f) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0034: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) Material val = Mat(); if (!((Object)(object)val == (Object)null)) { GameObject go = new GameObject("VR_Ring"); go.transform.position = pos + Vector3.up * 0.25f; LineRenderer lr = go.AddComponent(); ((Renderer)lr).sharedMaterial = val; lr.useWorldSpace = false; lr.loop = true; lr.positionCount = 48; for (int i = 0; i < 48; i++) { float num = (float)i / 48f * (float)Math.PI * 2f; lr.SetPosition(i, new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num))); } go.transform.localScale = Vector3.zero; ((Renderer)lr).enabled = false; Run(go, dur, delay, delegate(float t) { //IL_002d: 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_0089: 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_008b: 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_00c0: Unknown result type (might be due to invalid IL or missing references) ((Renderer)lr).enabled = true; float num2 = 1f - (1f - t) * (1f - t); go.transform.localScale = Vector3.one * Mathf.Max(0.01f, radius * num2); Color val2 = default(Color); ((Color)(ref val2))..ctor(color.r, color.g, color.b, 1f - t); LineRenderer obj = lr; Color startColor = (lr.endColor = val2); obj.startColor = startColor; lr.widthMultiplier = (0.35f * (1f - t) + 0.05f) / Mathf.Max(0.01f, go.transform.localScale.x); }); } } public static void Pillar(Vector3 pos, float height, Color color, float dur = 0.8f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0036: Expected O, but got Unknown Material val = Mat(); if (!((Object)(object)val == (Object)null)) { GameObject val2 = new GameObject("VR_Pillar"); LineRenderer lr = val2.AddComponent(); ((Renderer)lr).sharedMaterial = val; lr.positionCount = 2; lr.useWorldSpace = true; Run(val2, dur, 0f, delegate(float t) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) lr.SetPosition(0, pos); lr.SetPosition(1, pos + Vector3.up * height * Mathf.Min(1f, t * 3f)); lr.widthMultiplier = 0.5f * (1f - t); LineRenderer obj = lr; LineRenderer obj2 = lr; Color val3 = default(Color); ((Color)(ref val3))..ctor(color.r, color.g, color.b, 1f - t); obj2.endColor = val3; obj.startColor = val3; }); } } public static void Bolt(Vector3 to, Color color, float dur = 0.3f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0028: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Material val = Mat(); if ((Object)(object)val == (Object)null) { return; } GameObject val2 = new GameObject("VR_Bolt"); LineRenderer lr = val2.AddComponent(); ((Renderer)lr).sharedMaterial = val; lr.useWorldSpace = true; lr.positionCount = 14; for (int i = 0; i < 14; i++) { float num = (float)i / 13f; Vector3 val3 = Vector3.Lerp(to + Vector3.up * 25f, to, num); if (i > 0 && i < 13) { val3 += new Vector3(Random.Range(-1.2f, 1.2f), 0f, Random.Range(-1.2f, 1.2f)); } lr.SetPosition(i, val3); } Run(val2, dur, 0f, delegate(float t) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) lr.widthMultiplier = 0.45f * (1f - t); LineRenderer obj = lr; LineRenderer obj2 = lr; Color val4 = default(Color); ((Color)(ref val4))..ctor(color.r, color.g, color.b, 1f - t); obj2.endColor = val4; obj.startColor = val4; }); } private static void Run(GameObject go, float dur, float delay, Action tick) { FxAnim fxAnim = go.AddComponent(); fxAnim.Dur = dur; fxAnim.Delay = delay; fxAnim.Tick = tick; } public static void Cast(string id, Vector3 origin, Vector3 target) { //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0a64: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0488: 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_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_0b1e: Unknown result type (might be due to invalid IL or missing references) //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0856: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_08fe: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: 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) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_09ac: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0b9a: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bed: Unknown result type (might be due to invalid IL or missing references) //IL_0c17: Unknown result type (might be due to invalid IL or missing references) //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_07e8: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) if (id == null) { return; } switch (id.Length) { case 7: switch (id[3]) { case 'h': if (id == "w_shock") { Ring(origin, 6f, new Color(1f, 0.55f, 0.2f), 0.55f); Ring(origin, 4f, new Color(1f, 0.85f, 0.4f), 0.45f, 0.08f); Prefab(new string[3] { "fx_goblinbrute_groundslam", "vfx_troll_groundslam", "fx_eikthyr_forwardshockwave" }, origin, 1.5f); } break; case 'l': if (id == "m_blast") { Bolt(target, new Color(0.7f, 0.85f, 1f)); Ring(target, 5f, new Color(0.45f, 0.65f, 1f), 0.5f, 0.1f); Prefab(new string[2] { "fx_Lightning", "fx_lightningstaffprojectile_hit" }, target); } break; case 'e': if (!(id == "r_venom")) { if (id == "a_herbs") { Pillar(origin, 3.5f, new Color(0.5f, 1f, 0.5f), 0.9f); Ring(origin, 2.5f, new Color(0.5f, 1f, 0.5f), 0.7f); Prefab(new string[2] { "vfx_Potion_health_medium", "vfx_HealthUpgrade" }, origin); } } else { Ring(origin, 5f, new Color(0.45f, 0.95f, 0.3f), 0.7f); Ring(origin, 3f, new Color(0.65f, 1f, 0.4f), 0.6f, 0.12f); Prefab(new string[2] { "vfx_BombBlob_explode_poison", "vfx_Poison" }, origin); } break; case 'u': if (id == "w_quake") { Ring(origin, 9f, new Color(0.9f, 0.5f, 0.2f), 0.7f); Ring(origin, 6f, new Color(1f, 0.8f, 0.4f), 0.55f, 0.1f); Ring(origin, 3f, Color.white, 0.4f, 0.2f); Prefab(new string[2] { "fx_goblinbrute_groundslam", "vfx_troll_groundslam" }, origin, 2f); } break; case 'o': if (id == "a_focus") { Ring(origin, 1.8f, new Color(1f, 0.9f, 0.4f)); Pillar(origin, 3f, new Color(1f, 0.9f, 0.4f)); } break; case 'r': if (!(id == "a_frost")) { if (id == "m_frost") { Ring(origin, 6f, new Color(0.6f, 0.9f, 1f)); Ring(origin, 3f, Color.white, 0.45f, 0.1f); Prefab(new string[2] { "fx_fenring_frost_hand_aoestart", "vfx_Frost" }, origin); } } else { Ring(target, 6f, new Color(0.6f, 0.85f, 1f), 0.7f); Scatter(new string[1] { "vfx_frostarrow_hit" }, target, 5f, 6, 0.5f); } break; case 'm': if (id == "r_smoke") { Ring(origin, 4f, new Color(0.6f, 0.5f, 0.7f), 0.8f); Prefab(new string[1] { "fx_ElakingMole_Sandcloud" }, origin, 1.5f); } break; } break; case 6: switch (id[4]) { case 'n': if (id == "w_wind") { Pillar(origin, 4f, new Color(0.5f, 1f, 0.55f), 0.9f); Ring(origin, 2.5f, new Color(0.6f, 1f, 0.6f), 0.7f); Prefab(new string[2] { "vfx_HealthUpgrade", "vfx_Potion_health_medium" }, origin); } break; case 'i': if (id == "a_rain") { Ring(target, 7f, new Color(0.5f, 0.9f, 0.4f), 0.7f); Ring(target, 4f, new Color(0.8f, 1f, 0.6f), 0.55f, 0.15f); Pillar(target, 12f, new Color(0.7f, 1f, 0.5f), 0.6f); Scatter(new string[1] { "vfx_arrowhit" }, target, 6f, 10, 0.7f); } break; case 'a': if (id == "a_leap") { Ring(origin, 1.6f, new Color(1f, 0.85f, 0.35f), 0.5f); Ring(origin, 2.6f, new Color(0.7f, 1f, 0.7f), 0.6f, 0.1f); Prefab(new string[2] { "fx_guardstone_activate", "vfx_HealthUpgrade" }, origin); } break; case 'l': if (!(id == "m_well")) { if (id == "w_wall") { Ring(origin, 2.5f, new Color(0.7f, 0.75f, 0.85f), 0.8f); Ring(origin, 1.5f, Color.white, 0.6f, 0.1f); Prefab(new string[2] { "fx_shield_start_frost", "fx_guardstone_activate" }, origin); } } else { Pillar(origin, 3.5f, new Color(0.45f, 0.65f, 1f), 0.9f); Ring(origin, 2.5f, new Color(0.6f, 0.75f, 1f), 0.7f); Prefab(new string[2] { "vfx_Potion_eitr_minor", "fx_guardstone_activate" }, origin); } break; case 'e': if (id == "r_step") { Pillar(origin, 3f, new Color(0.75f, 0.45f, 0.95f), 0.7f); Ring(origin, 2.5f, new Color(0.75f, 0.45f, 0.95f)); Prefab(new string[2] { "fx_JotunWitch_Dodge", "fx_perfectdodge" }, origin); } break; case 'g': if (id == "w_rage") { Pillar(origin, 4f, new Color(1f, 0.25f, 0.2f), 0.9f); Ring(origin, 3f, new Color(1f, 0.3f, 0.2f)); } break; } break; case 8: switch (id[7]) { case 'y': if (id == "a_volley") { Ring(target, 9f, new Color(0.5f, 0.9f, 0.4f), 0.8f); Pillar(target, 14f, new Color(0.7f, 1f, 0.5f), 0.7f); Scatter(new string[1] { "vfx_arrowhit" }, target, 8.5f, 20, 1f); } break; case 'd': if (id == "m_shield") { Ring(origin, 2.2f, new Color(0.5f, 0.7f, 1f), 0.9f); Ring(origin, 1.4f, Color.white, 0.7f, 0.1f); Prefab(new string[2] { "fx_shield_start_frost", "fx_guardstone_activate" }, origin); } break; case 'r': if (id == "m_meteor") { Ring(target, 7f, new Color(1f, 0.4f, 0.1f), 1.2f); Ring(target, 4f, new Color(1f, 0.7f, 0.2f), 1f, 0.1f); } break; case 'w': if (id == "r_shadow") { Pillar(origin, 3.5f, new Color(0.65f, 0.35f, 0.9f), 0.9f); Ring(origin, 2.5f, new Color(0.7f, 0.4f, 0.95f), 0.7f); } break; case 'e': if (id == "r_plague") { Ring(origin, 8f, new Color(0.45f, 0.9f, 0.25f), 0.8f); Ring(origin, 5f, new Color(0.6f, 1f, 0.35f), 0.65f, 0.1f); Prefab(new string[2] { "vfx_BombBlob_explode_poisonelite", "vfx_BombBlob_explode_poison" }, origin, 1.3f); } break; } break; case 5: if (id == "w_cry") { Ring(origin, 8f, new Color(1f, 0.7f, 0.2f)); Pillar(origin, 3f, new Color(1f, 0.8f, 0.3f), 0.7f); } break; case 12: if (id == "m_meteor_hit") { Ring(origin, 7f, new Color(1f, 0.5f, 0.15f), 0.5f); Pillar(origin, 10f, new Color(1f, 0.6f, 0.2f), 0.5f); Prefab(new string[2] { "fx_fireball_staff_explosion", "vfx_FireballHit" }, origin, 2f); } break; case 9: if (id == "r_execute") { Ring(target, 2f, new Color(0.9f, 0.2f, 0.3f), 0.4f); Prefab(new string[2] { "fx_perfectdodge", "fx_lightningweapon_hit" }, target); } break; case 10: case 11: break; } } public static void LevelUp(Vector3 pos) { //IL_0016: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(1f, 0.85f, 0.3f); Pillar(pos, 6f, color, 1.2f); Ring(pos, 4f, color, 0.9f); Ring(pos, 2.5f, Color.white, 0.7f, 0.15f); Prefab(new string[2] { "fx_guardstone_activate", "vfx_HealthUpgrade" }, pos); } } public class FxAnim : MonoBehaviour { public float Dur = 0.5f; public float Delay; public Action Tick; private float t; private void Update() { t += Time.deltaTime; if (!(t < Delay)) { float num = Mathf.Clamp01((t - Delay) / Dur); if (Tick != null) { Tick(num); } if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } }