Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ElementalWeave v1.0.0
plugins/ElementalWeave/ElementalWeave.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ElementalWeave.Compat; using ElementalWeave.Content; using ElementalWeave.Core; using ElementalWeave.Skills; using ElementalWeave.Spells; using ElementalWeave.States; using ElementalWeave.UI; using EntityStates; using EntityStates.Bandit2; using EntityStates.Mage; using EntityStates.Mage.Weapon; using HG; using HG.GeneralSerializer; using HarmonyLib; using Microsoft.CodeAnalysis; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [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 ElementalWeave { public enum BoltElementMode { Cycle, DominantOrb } internal static class WeaveConfig { internal static class General { internal const string Section = "00 General"; internal static ConfigEntry<bool> AutoCastWithoutWeavePrimary; internal static ConfigEntry<bool> RequireFreshClick; internal static ConfigEntry<float> CastDuration; internal static ConfigEntry<bool> MiniBossesByHull; internal static ConfigEntry<float> OrbScale; internal static ConfigEntry<float> OrbRadius; internal static ConfigEntry<float> OrbSpinSpeed; internal static ConfigEntry<bool> ShowHud; internal static ConfigEntry<int> ConfigVersion; } internal static class Keys { internal const string Section = "07 Orb Keys"; internal static ConfigEntry<KeyboardShortcut> IceOrb; internal static ConfigEntry<KeyboardShortcut> LightningOrb; internal static ConfigEntry<KeyboardShortcut> FireOrb; internal static ConfigEntry<bool> GamepadUsesSlotButtons; } internal static class Teleport { internal const string Section = "08 Passive - Teleport"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> Distance; internal static ConfigEntry<float> TravelTime; internal static ConfigEntry<float> ExitSpeed; internal static ConfigEntry<bool> KeepHover; internal static ConfigEntry<bool> ExtraJumpsFirst; internal static ConfigEntry<bool> ShowHudIcon; } internal static class Cast { internal const string Section = "01 Cast"; internal static ConfigEntry<float> GlobalDelay; } internal static class Mana { internal const string Section = "02 Mana"; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<float> Max; internal static ConfigEntry<float> Regen; } internal static class Bolt { internal const string Section = "03 Primary - Elemental Bolt"; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Proc; internal static ConfigEntry<float> Duration; internal static ConfigEntry<BoltElementMode> ElementMode; } internal static class IceOrb { internal const string Section = "04 Secondary - Ice Orb"; internal static ConfigEntry<float> Cooldown; } internal static class LightningOrb { internal const string Section = "05 Utility - Lightning Orb"; internal static ConfigEntry<float> Cooldown; } internal static class FireOrb { internal const string Section = "06 Special - Fire Orb"; internal static ConfigEntry<float> Cooldown; } internal static class Icicle { internal const string Section = "Spell 01 - Icicle (Ice+Ice+Ice)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Proc; internal static ConfigEntry<float> Speed; internal static ConfigEntry<float> Range; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> StunDuration; } internal static class Vanish { internal const string Section = "Spell 02 - Vanish (Ice+Ice+Lightning)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Duration; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> TickInterval; internal static ConfigEntry<float> TickDamage; internal static ConfigEntry<float> TickProc; internal static ConfigEntry<bool> CloakSpeed; } internal static class IceWall { internal const string Section = "Spell 03 - Ice Wall (Ice+Ice+Fire)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Duration; internal static ConfigEntry<float> Distance; internal static ConfigEntry<float> Spacing; internal static ConfigEntry<float> SpikeRadius; internal static ConfigEntry<float> SpawnDamage; internal static ConfigEntry<float> Proc; internal static ConfigEntry<float> PushSpeed; internal static ConfigEntry<float> MaxDistance; internal static ConfigEntry<float> AimDuration; internal static ConfigEntry<float> BreakSpread; internal static ConfigEntry<int> SpikeCount; internal static ConfigEntry<bool> EraseProjectiles; internal static ConfigEntry<bool> AimPlacement; } internal static class Vortex { internal const string Section = "Spell 04 - Vortex (Lightning x3)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Range; internal static ConfigEntry<float> PullDuration; internal static ConfigEntry<float> PullRadius; internal static ConfigEntry<float> PullSpeed; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> Proc; } internal static class Tornado { internal const string Section = "Spell 05 - Tornado (Lightning+Lightning+Ice)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Speed; internal static ConfigEntry<float> Duration; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> TickInterval; internal static ConfigEntry<float> TickDamage; internal static ConfigEntry<float> TickProc; internal static ConfigEntry<float> DragStrength; } internal static class Mark { internal const string Section = "Spell 06 - Mark (Lightning+Lightning+Fire)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Duration; internal static ConfigEntry<float> AttackSpeed; internal static ConfigEntry<float> MoveSpeed; internal static ConfigEntry<float> AllyRange; internal static ConfigEntry<float> AllyAimAngle; } internal static class Imps { internal const string Section = "Spell 07 - Fire Imps (Fire+Fire+Ice)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Duration; internal static ConfigEntry<float> HealthFraction; internal static ConfigEntry<float> DamageFraction; internal static ConfigEntry<int> Count; internal static ConfigEntry<string> MasterPrefab; } internal static class Meteor { internal const string Section = "Spell 08 - Meteor (Fire+Fire+Lightning)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> FallTime; internal static ConfigEntry<float> LandDistance; internal static ConfigEntry<float> LandDamage; internal static ConfigEntry<float> LandRadius; internal static ConfigEntry<float> RollSpeed; internal static ConfigEntry<float> RollDuration; internal static ConfigEntry<float> BurnRadius; internal static ConfigEntry<float> TickInterval; internal static ConfigEntry<float> TickDamage; internal static ConfigEntry<float> TickProc; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> Proc; } internal static class SunBeam { internal const string Section = "Spell 09 - Sun Beam (Fire x3)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Range; internal static ConfigEntry<float> Delay; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> Proc; } internal static class Wave { internal const string Section = "Spell 10 - Wave (Ice+Lightning+Fire)"; internal static ConfigEntry<float> Cooldown; internal static ConfigEntry<float> ManaCost; internal static ConfigEntry<float> Speed; internal static ConfigEntry<float> MinRange; internal static ConfigEntry<float> MaxRange; internal static ConfigEntry<float> Radius; internal static ConfigEntry<float> Damage; internal static ConfigEntry<float> Proc; internal static ConfigEntry<float> PushSpeed; } private static ConfigFile file; private const int CurrentVersion = 2; internal static void Bind(ConfigFile config) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) file = config; General.AutoCastWithoutWeavePrimary = B("00 General", "AutoCastWithoutWeavePrimary", value: true, "Если на ЛКМ стоит обычная атака Artificer (не «Стихийный заряд»), заклинание кастуется само, как только собрана третья сфера. Так сферы можно брать и со штатными атаками."); General.RequireFreshClick = B("00 General", "RequireFreshClick", value: true, "Каст с ЛКМ только по новому нажатию: удержание ЛКМ продолжает стрелять и не тратит сферы случайно."); General.CastDuration = B("00 General", "CastDuration", 0.35f, "Длительность анимации каста, с (делится на скорость атаки)."); General.MiniBossesByHull = B("00 General", "MiniBossesByHull", value: true, "Считать мини-боссами всех крупных врагов (hull Golem и больше: големы, старшие лемурианы, бронзонги и т.д.). Их, как и боссов, не тянет, не толкает и не оглушает."); General.OrbScale = B("00 General", "OrbScale", 0.5f, "Размер кружащих сфер (множитель к призраку плазменного заряда Artificer)."); General.OrbRadius = B("00 General", "OrbRadius", 0.9f, "Радиус орбиты сфер вокруг персонажа, м."); General.OrbSpinSpeed = B("00 General", "OrbSpinSpeed", 140f, "Скорость вращения сфер, градусов в секунду."); General.ShowHud = B("00 General", "ShowHud", value: true, "Показывать панель сфер, собранного заклинания и откатов над панелью навыков."); General.ConfigVersion = B("00 General", "ConfigVersion", 0, "Служебное: версия этого файла настроек. Не меняйте — по ней мод переносит старые значения по умолчанию на новые."); Keys.IceOrb = B<KeyboardShortcut>("07 Orb Keys", "IceOrbKey", KeyboardShortcut.Empty, "Своя клавиша сферы льда. Пусто — сфера на клавише своего слота (ПКМ). Игровые настройки управления не меняются: клавиша работает только для сферы, у других выживших слот остаётся на прежней кнопке. Если клавиша задана, игровая кнопка слота сферу больше не вызывает. Примеры: Q, E, Alpha1, Mouse3 (боковая кнопка мыши), LeftAlt."); Keys.LightningOrb = B<KeyboardShortcut>("07 Orb Keys", "LightningOrbKey", KeyboardShortcut.Empty, "Своя клавиша сферы молнии. Пусто — клавиша слота (Shift)."); Keys.FireOrb = B<KeyboardShortcut>("07 Orb Keys", "FireOrbKey", KeyboardShortcut.Empty, "Своя клавиша сферы огня. Пусто — клавиша слота (R)."); Keys.GamepadUsesSlotButtons = B("07 Orb Keys", "GamepadUsesSlotButtons", value: true, "На геймпаде сферы остаются на кнопках слотов, даже если для клавиатуры заданы свои клавиши."); Teleport.Cooldown = B("08 Passive - Teleport", "Cooldown", 10f, "Откат телепорта, с. Сокращается предметами, ускоряющими все навыки (Alien Head, Purity, Brainstalks...)."); Teleport.Distance = B("08 Passive - Teleport", "Distance", 22f, "Максимальная дальность телепорта, м (до точки под прицелом или на эту дальность в сторону прицела)."); Teleport.TravelTime = B("08 Passive - Teleport", "TravelTime", 0.12f, "Сколько длится сам перенос, с (персонаж невидим и неуязвим)."); Teleport.ExitSpeed = B("08 Passive - Teleport", "ExitSpeed", 6f, "Скорость после телепорта в сторону переноса, м/с. Падение при этом гасится."); Teleport.KeepHover = B("08 Passive - Teleport", "KeepHover", value: false, "Оставить штатное парение ENV Suit вместе с телепортом (по умолчанию телепорт заменяет парение)."); Teleport.ExtraJumpsFirst = B("08 Passive - Teleport", "ExtraJumpsFirst", value: false, "Сначала тратить дополнительные прыжки (Hopoo Feather и т.п.), и только потом телепортироваться. По умолчанию прыжок в воздухе сразу телепортирует, а прыжки тратятся, пока телепорт на откате."); Teleport.ShowHudIcon = B("08 Passive - Teleport", "ShowHudIcon", value: true, "Показывать иконку телепорта с откатом рядом с панелью навыков."); Cast.GlobalDelay = B("01 Cast", "GlobalDelay", 0.5f, "Общая задержка между любыми двумя кастами заклинаний, с."); Mana.Enabled = B("02 Mana", "Enabled", value: false, "Включить ресурс «мана» с полоской в HUD. Выключено по умолчанию: в RoR2 заклинания и так ограничены откатами, а мана с фиксированной регенерацией не масштабируется предметами (см. README)."); Mana.Max = B("02 Mana", "Max", 100f, "Максимум маны."); Mana.Regen = B("02 Mana", "Regen", 5f, "Восстановление маны в секунду."); Bolt.Damage = B("03 Primary - Elemental Bolt", "Damage", 1.6f, "Урон заряда с рук (1.6 = 160%)."); Bolt.Proc = B("03 Primary - Elemental Bolt", "ProcCoefficient", 1f, "Proc coefficient заряда (и его взрыва)."); Bolt.Duration = B("03 Primary - Elemental Bolt", "BaseDuration", 0.55f, "Время одного выстрела, с (делится на скорость атаки). 0.55 = ~1.8 выстрела в секунду."); Bolt.ElementMode = B("03 Primary - Elemental Bolt", "ElementMode", BoltElementMode.Cycle, "Стихия заряда. Cycle: огонь → молния → лёд по кругу (в RoR2 нет стихийных статов урона). DominantOrb: стихия, сфер которой сейчас больше всего (при равенстве — по кругу)."); IceOrb.Cooldown = B("04 Secondary - Ice Orb", "Cooldown", 0.25f, "Откат вызова сферы льда, с. Сфера урона не наносит, только копится (максимум 3, новая вытесняет самую старую)."); LightningOrb.Cooldown = B("05 Utility - Lightning Orb", "Cooldown", 0.25f, "Откат вызова сферы молнии, с."); FireOrb.Cooldown = B("06 Special - Fire Orb", "Cooldown", 0.25f, "Откат вызова сферы огня, с."); Icicle.Cooldown = B("Spell 01 - Icicle (Ice+Ice+Ice)", "Cooldown", 5f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Icicle.ManaCost = B("Spell 01 - Icicle (Ice+Ice+Ice)", "ManaCost", 18f, "Стоимость в мане (если мана включена)."); Icicle.Damage = B("Spell 01 - Icicle (Ice+Ice+Ice)", "Damage", 5f, "Урон каждому врагу на пути (5 = 500%)."); Icicle.Proc = B("Spell 01 - Icicle (Ice+Ice+Ice)", "ProcCoefficient", 1f, "Proc coefficient попадания."); Icicle.Speed = B("Spell 01 - Icicle (Ice+Ice+Ice)", "Speed", 90f, "Скорость сосульки, м/с."); Icicle.Range = B("Spell 01 - Icicle (Ice+Ice+Ice)", "Range", 90f, "Дальность полёта, м."); Icicle.Radius = B("Spell 01 - Icicle (Ice+Ice+Ice)", "Radius", 1.2f, "Толщина сосульки для попаданий, м."); Icicle.StunDuration = B("Spell 01 - Icicle (Ice+Ice+Ice)", "StunDuration", 1.5f, "Оглушение обычных врагов, с (штатное оглушение; боссов и мини-боссов не оглушает)."); Vanish.Cooldown = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "Cooldown", 18f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Vanish.ManaCost = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "ManaCost", 32f, "Стоимость в мане."); Vanish.Duration = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "Duration", 3f, "Длительность невидимости (штатная маскировка Cloak), с."); Vanish.Radius = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "Radius", 10f, "Радиус горения вокруг игрока, м."); Vanish.TickInterval = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "TickInterval", 0.5f, "Период тиков горения, с."); Vanish.TickDamage = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "TickDamage", 0.6f, "Урон за тик (0.6 = 60%). Каждый тик ещё и поджигает (штатный Burn, +50% урона со временем)."); Vanish.TickProc = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "TickProcCoefficient", 0.3f, "Proc coefficient периодического тика."); Vanish.CloakSpeed = B("Spell 02 - Vanish (Ice+Ice+Lightning)", "CloakSpeed", value: false, "Дополнительно давать штатный бафф скорости невидимости (CloakSpeed, как у Old War Stealthkit)."); IceWall.Cooldown = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "Cooldown", 15f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); IceWall.ManaCost = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "ManaCost", 28f, "Стоимость в мане."); IceWall.Duration = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "Duration", 5f, "Время жизни стены, с."); IceWall.SpikeCount = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "SpikeCount", 11, "Число ледяных шпилей в ряду (кристаллы разной формы, стоят вплотную)."); IceWall.Distance = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "Distance", 7f, "Расстояние от игрока до стены, м."); IceWall.Spacing = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "Spacing", 1.45f, "Расстояние между шпилями, м."); IceWall.SpikeRadius = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "SpikeRadius", 2.6f, "Радиус действия шпиля (толчок и гашение снарядов), м."); IceWall.SpawnDamage = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "SpawnDamage", 3f, "Урон при появлении стены, один раз каждому врагу (3 = 300%)."); IceWall.Proc = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "ProcCoefficient", 0.8f, "Proc coefficient урона при появлении (урон по площади)."); IceWall.PushSpeed = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "PushSpeed", 14f, "Скорость, с которой шпили выталкивают врагов, м/с."); IceWall.EraseProjectiles = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "EraseEnemyProjectiles", value: true, "Гасить вражеские снаряды, влетающие в шпили."); IceWall.AimPlacement = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "AimPlacement", value: true, "Выбирать место стены, как у Snapfreeze: удерживайте кнопку каста — на земле видна разметка стены, отпустите — стена встаёт там. Если место не годится (небо, крутой склон, слишком далеко), каст отменяется, сферы остаются. Выключено — стена сразу встаёт перед игроком на Distance м."); IceWall.MaxDistance = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "MaxDistance", 0f, "Максимальная дальность выбора места, м. 0 — как у Snapfreeze."); IceWall.AimDuration = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "AimDuration", 0.3f, "Минимальное время прицеливания, с (делится на скорость атаки). Короткое нажатие ставит стену после него."); IceWall.BreakSpread = B("Spell 03 - Ice Wall (Ice+Ice+Fire)", "BreakSpread", 1.2f, "Шпили ломаются не разом: разброс момента разрушения, с (случайный порядок в этом окне после Duration)."); Vortex.Cooldown = B("Spell 04 - Vortex (Lightning x3)", "Cooldown", 15f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Vortex.ManaCost = B("Spell 04 - Vortex (Lightning x3)", "ManaCost", 22f, "Стоимость в мане."); Vortex.Range = B("Spell 04 - Vortex (Lightning x3)", "Range", 70f, "Максимальная дальность точки прицела, м."); Vortex.PullDuration = B("Spell 04 - Vortex (Lightning x3)", "PullDuration", 1f, "Сколько секунд вихрь стягивает врагов до взрыва."); Vortex.PullRadius = B("Spell 04 - Vortex (Lightning x3)", "PullRadius", 13f, "Радиус стягивания, м."); Vortex.PullSpeed = B("Spell 04 - Vortex (Lightning x3)", "PullSpeed", 16f, "Скорость стягивания к центру, м/с."); Vortex.Damage = B("Spell 04 - Vortex (Lightning x3)", "Damage", 7.5f, "Урон взрыва (7.5 = 750%)."); Vortex.Radius = B("Spell 04 - Vortex (Lightning x3)", "Radius", 10f, "Радиус взрыва, м."); Vortex.Proc = B("Spell 04 - Vortex (Lightning x3)", "ProcCoefficient", 1f, "Proc coefficient взрыва."); Tornado.Cooldown = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "Cooldown", 11f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Tornado.ManaCost = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "ManaCost", 25f, "Стоимость в мане."); Tornado.Speed = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "Speed", 14f, "Скорость торнадо, м/с."); Tornado.Duration = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "Duration", 4f, "Время жизни, с."); Tornado.Radius = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "Radius", 5f, "Радиус захвата, м."); Tornado.TickInterval = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "TickInterval", 0.5f, "Период ударов, с."); Tornado.TickDamage = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "TickDamage", 0.6f, "Урон за удар (0.6 = 60%; 8 ударов = 480%)."); Tornado.TickProc = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "TickProcCoefficient", 0.3f, "Proc coefficient периодического удара."); Tornado.DragStrength = B("Spell 05 - Tornado (Lightning+Lightning+Ice)", "DragStrength", 6f, "Сила подтягивания пойманных врагов к центру, м/с (сверх скорости самого торнадо)."); Mark.Cooldown = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "Cooldown", 18f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Mark.ManaCost = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "ManaCost", 18f, "Стоимость в мане."); Mark.Duration = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "Duration", 8f, "Длительность метки, с."); Mark.AttackSpeed = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "AttackSpeed", 0.5f, "Бонус к скорости атаки (0.5 = +50%, складывается с предметами как штатные бонусы)."); Mark.MoveSpeed = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "MoveSpeed", 0.1f, "Бонус к скорости передвижения (0.1 = +10%)."); Mark.AllyRange = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "AllyRange", 60f, "Дальность выбора союзника под прицелом, м. Нет союзника под прицелом — метка на себя."); Mark.AllyAimAngle = B("Spell 06 - Mark (Lightning+Lightning+Fire)", "AllyAimAngle", 12f, "Угол от прицела, в котором ищется союзник, градусы."); Imps.Cooldown = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "Cooldown", 24f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Imps.ManaCost = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "ManaCost", 15f, "Стоимость в мане."); Imps.Count = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "Count", 2, "Число призываемых существ."); Imps.Duration = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "Duration", 30f, "Время жизни, с. Новый каст убивает прежних."); Imps.HealthFraction = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "HealthFraction", 0.333f, "Здоровье существа как доля максимального здоровья игрока (добирается штатным предметом BoostHp)."); Imps.DamageFraction = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "DamageFraction", 0.5f, "Базовый урон существа как доля урона игрока (добирается штатным BoostDamage). Proc coefficient их атак — штатный у выбранного монстра."); Imps.MasterPrefab = B("Spell 07 - Fire Imps (Fire+Fire+Ice)", "MasterPrefab", "RoR2/Base/Wisp/WispMaster.prefab", "Addressables-ключ мастера призыва. По умолчанию малый сгусток (летает и стреляет огнём). Можно, например, RoR2/Base/Imp/ImpMaster.prefab (но бес дерётся в ближнем бою)."); Meteor.Cooldown = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "Cooldown", 14f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Meteor.ManaCost = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "ManaCost", 32f, "Стоимость в мане."); Meteor.FallTime = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "FallTime", 0.55f, "Время падения из-за спины до земли, с."); Meteor.LandDistance = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "LandDistance", 7f, "Точка падения перед игроком, м."); Meteor.LandDamage = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "LandDamage", 2f, "Урон удара о землю (2 = 200%)."); Meteor.LandRadius = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "LandRadius", 6f, "Радиус удара о землю, м."); Meteor.RollSpeed = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "RollSpeed", 12f, "Скорость качения, м/с."); Meteor.RollDuration = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "RollDuration", 2.5f, "Время качения до взрыва, с."); Meteor.BurnRadius = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "BurnRadius", 5f, "Радиус ожогов вокруг катящегося метеорита, м."); Meteor.TickInterval = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "TickInterval", 0.25f, "Период ожогов при качении, с."); Meteor.TickDamage = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "TickDamage", 0.4f, "Урон ожога за тик (0.4 = 40%), с поджогом."); Meteor.TickProc = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "TickProcCoefficient", 0.3f, "Proc coefficient ожогов при качении."); Meteor.Damage = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "Damage", 6f, "Урон финального взрыва (6 = 600%; вместе с ударом о землю 800%)."); Meteor.Radius = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "Radius", 10f, "Радиус финального взрыва, м."); Meteor.Proc = B("Spell 08 - Meteor (Fire+Fire+Lightning)", "ProcCoefficient", 1f, "Proc coefficient удара о землю и финального взрыва."); SunBeam.Cooldown = B("Spell 09 - Sun Beam (Fire x3)", "Cooldown", 20f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); SunBeam.ManaCost = B("Spell 09 - Sun Beam (Fire x3)", "ManaCost", 28f, "Стоимость в мане."); SunBeam.Range = B("Spell 09 - Sun Beam (Fire x3)", "Range", 200f, "Максимальная дальность точки прицела, м."); SunBeam.Delay = B("Spell 09 - Sun Beam (Fire x3)", "Delay", 2f, "Подготовка луча до взрыва, с (штатный визуал орбитального зонда рассчитан на 2 с)."); SunBeam.Damage = B("Spell 09 - Sun Beam (Fire x3)", "Damage", 12f, "Урон взрыва (12 = 1200%)."); SunBeam.Radius = B("Spell 09 - Sun Beam (Fire x3)", "Radius", 8f, "Радиус взрыва, м."); SunBeam.Proc = B("Spell 09 - Sun Beam (Fire x3)", "ProcCoefficient", 1f, "Proc coefficient взрыва."); Wave.Cooldown = B("Spell 10 - Wave (Ice+Lightning+Fire)", "Cooldown", 15f, "Откат, с. Сокращается предметами, ускоряющими все навыки."); Wave.ManaCost = B("Spell 10 - Wave (Ice+Lightning+Fire)", "ManaCost", 45f, "Стоимость в мане."); Wave.Speed = B("Spell 10 - Wave (Ice+Lightning+Fire)", "Speed", 30f, "Скорость фронта волны, м/с."); Wave.MinRange = B("Spell 10 - Wave (Ice+Lightning+Fire)", "MinRange", 15f, "Минимальная дальность волны, м (если прицел ближе)."); Wave.MaxRange = B("Spell 10 - Wave (Ice+Lightning+Fire)", "MaxRange", 45f, "Максимальная дальность волны, м."); Wave.Radius = B("Spell 10 - Wave (Ice+Lightning+Fire)", "Radius", 4.5f, "Полуширина фронта, м."); Wave.Damage = B("Spell 10 - Wave (Ice+Lightning+Fire)", "Damage", 4.5f, "Урон каждому задетому (4.5 = 450%)."); Wave.Proc = B("Spell 10 - Wave (Ice+Lightning+Fire)", "ProcCoefficient", 0.8f, "Proc coefficient (урон по площади)."); Wave.PushSpeed = B("Spell 10 - Wave (Ice+Lightning+Fire)", "PushSpeed", 22f, "Скорость отбрасывания задетых врагов, м/с (боссов и мини-боссов не двигает). Обезоруживание не реализовано."); Migrate(); } private static void Migrate() { int value = General.ConfigVersion.Value; if (value >= 2) { return; } if (value < 2) { List<KeyValuePair<ConfigEntryBase, object>> obj = new List<KeyValuePair<ConfigEntryBase, object>> { Old((ConfigEntryBase)(object)Icicle.Cooldown, 3f), Old((ConfigEntryBase)(object)Vanish.Cooldown, 12f), Old((ConfigEntryBase)(object)IceWall.Cooldown, 10f), Old((ConfigEntryBase)(object)Vortex.Cooldown, 10f), Old((ConfigEntryBase)(object)Tornado.Cooldown, 7f), Old((ConfigEntryBase)(object)Mark.Cooldown, 12f), Old((ConfigEntryBase)(object)Imps.Cooldown, 15f), Old((ConfigEntryBase)(object)Meteor.Cooldown, 9f), Old((ConfigEntryBase)(object)SunBeam.Cooldown, 14f), Old((ConfigEntryBase)(object)Wave.Cooldown, 10f), Old((ConfigEntryBase)(object)IceWall.SpikeCount, 7), Old((ConfigEntryBase)(object)IceWall.Spacing, 2.4f), Old((ConfigEntryBase)(object)Meteor.LandRadius, 5f), Old((ConfigEntryBase)(object)Meteor.BurnRadius, 4f), Old((ConfigEntryBase)(object)Meteor.Radius, 9f) }; int num = 0; foreach (KeyValuePair<ConfigEntryBase, object> item in obj) { if (Same(item.Key.BoxedValue, item.Value)) { item.Key.BoxedValue = item.Key.DefaultValue; num++; } } if (num > 0) { WeavePlugin.Log.LogInfo((object)("Config: " + num + " values moved from the 1.0 defaults to the new ones.")); } } General.ConfigVersion.Value = 2; } private static KeyValuePair<ConfigEntryBase, object> Old(ConfigEntryBase entry, object oldDefault) { return new KeyValuePair<ConfigEntryBase, object>(entry, oldDefault); } private static bool Same(object a, object b) { if (a is float num && b is float num2) { return Mathf.Abs(num - num2) < 0.0001f; } return object.Equals(a, b); } private static ConfigEntry<T> B<T>(string section, string key, T value, string description) { return file.Bind<T>(section, key, value, description); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.averno.elementalweave", "ElementalWeave", "1.0.0")] public class WeavePlugin : BaseUnityPlugin { public const string Guid = "com.averno.elementalweave"; public const string Name = "ElementalWeave"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private void Awake() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; WeaveConfig.Bind(((BaseUnityPlugin)this).Config); WeaveAssets.Init(); WeaveBuffs.Init(); SpellBook.Init(); WeaveSkills.Init(); WeavePassive.Init(); WeaveTokens.Init(); OrbSync.Register(); new Harmony("com.averno.elementalweave").PatchAll(typeof(WeavePlugin).Assembly); RiskOfOptionsCompat.Init(); Log.LogInfo((object)"Elemental Weave loaded: Artificer can now weave ice, lightning and fire."); } private void Update() { OrbKeys.Tick(); WeaveHud.Tick(); } } } namespace ElementalWeave.UI { [HarmonyPatch(typeof(LoadoutPanelController), "Rebuild")] internal static class LoadoutOrbKeys { private static readonly FieldInfo RowsField = AccessTools.Field(typeof(LoadoutPanelController), "rows"); private static readonly FieldInfo DisplayField = AccessTools.Field(typeof(LoadoutPanelController), "currentDisplayData"); private static FieldInfo rowPanelField; private static bool warned; private static void Postfix(LoadoutPanelController __instance) { try { Attach(__instance); } catch (Exception ex) { if (!warned) { warned = true; WeavePlugin.Log.LogWarning((object)("Orb key buttons not added to the loadout panel: " + ex.Message)); } } } private static void Attach(LoadoutPanelController panel) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_011b: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) DisplayData val = (DisplayData)DisplayField.GetValue(panel); CharacterBody bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(val.bodyIndex); IList list = RowsField.GetValue(panel) as IList; if (!Object.op_Implicit((Object)(object)bodyPrefabBodyComponent) || list == null || val.userProfile == null) { return; } GenericSkill[] components = ((Component)bodyPrefabBodyComponent).GetComponents<GenericSkill>(); SkillLocator component = ((Component)bodyPrefabBodyComponent).GetComponent<SkillLocator>(); int num = 0; for (int i = 0; i < components.Length; i++) { GenericSkill val2 = components[i]; if (val2.hideInLoadoutSelect) { continue; } if (num >= list.Count) { break; } object obj = list[num++]; OrbSkillDef orbSkillDef = (Object.op_Implicit((Object)(object)val2.skillFamily) ? val2.skillFamily.variants.Select((Variant v) => v.skillDef).OfType<OrbSkillDef>().FirstOrDefault() : null); if (Object.op_Implicit((Object)(object)orbSkillDef)) { if (rowPanelField == null) { rowPanelField = AccessTools.Field(obj.GetType(), "rowPanelTransform"); } object? value = rowPanelField.GetValue(obj); OrbKeyButton.Create((RectTransform)((value is RectTransform) ? value : null), orbSkillDef.element, val.userProfile, val.bodyIndex, i, val2, ActionName((SkillSlot)((!Object.op_Implicit((Object)(object)component)) ? (-1) : ((int)component.FindSkillSlot(val2))))); } } } private static string ActionName(SkillSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown return (int)slot switch { 0 => "PrimarySkill", 1 => "SecondarySkill", 2 => "UtilitySkill", 3 => "SpecialSkill", _ => "", }; } } public class OrbKeyButton : MonoBehaviour { private const float ListenTimeout = 8f; private static KeyCode[] candidates; private Element element; private UserProfile profile; private BodyIndex bodyIndex; private int slotIndex; private GenericSkill slot; private string slotAction; private HGButton button; private CanvasGroup group; private TextMeshProUGUI caption; private TextMeshProUGUI label; private TextMeshProUGUI footnote; private MPEventSystemLocator eventSystemLocator; private bool listening; private float listenSince; public Element Element => element; private ConfigEntry<KeyboardShortcut> Entry => OrbKeys.EntryFor(element); internal static void Create(RectTransform rowPanel, Element element, UserProfile profile, BodyIndex bodyIndex, int slotIndex, GenericSkill slot, string slotAction) { //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) Transform val = (Object.op_Implicit((Object)(object)rowPanel) ? ((Transform)rowPanel).Find("ButtonContainer") : null); HGButton val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponentsInChildren<HGButton>(true).FirstOrDefault() : null); if (!Object.op_Implicit((Object)(object)val2)) { return; } GameObject val3 = Object.Instantiate<GameObject>(((Component)val2).gameObject, val, false); ((Object)val3).name = "ElementalWeaveOrbKey"; val3.transform.SetAsLastSibling(); HGButton component = val3.GetComponent<HGButton>(); Graphic targetGraphic = ((Selectable)component).targetGraphic; HashSet<Transform> hashSet = new HashSet<Transform>(); Component[] array = (Component[])(object)new Component[4] { (Component)targetGraphic, (Component)component.imageOnHover, (Component)component.imageOnInteractable, (Component)(Object.op_Implicit((Object)(object)component.hoverHighlightGameObject) ? component.hoverHighlightGameObject.transform : null) }; foreach (Component val4 in array) { Transform val5 = (Object.op_Implicit((Object)(object)val4) ? val4.transform : null); while (Object.op_Implicit((Object)(object)val5) && (Object)(object)val5 != (Object)(object)val3.transform) { hashSet.Add(val5); val5 = val5.parent; } } for (int num = val3.transform.childCount - 1; num >= 0; num--) { Transform child = val3.transform.GetChild(num); if (!hashSet.Contains(child)) { Object.DestroyImmediate((Object)(object)((Component)child).gameObject); } } ViewableTag component2 = val3.GetComponent<ViewableTag>(); if (Object.op_Implicit((Object)(object)component2)) { Object.DestroyImmediate((Object)(object)component2); } OrbKeyButton orbKeyButton = val3.AddComponent<OrbKeyButton>(); orbKeyButton.element = element; orbKeyButton.profile = profile; orbKeyButton.bodyIndex = bodyIndex; orbKeyButton.slotIndex = slotIndex; orbKeyButton.slot = slot; orbKeyButton.slotAction = slotAction; orbKeyButton.button = component; orbKeyButton.eventSystemLocator = val3.GetComponentInParent<MPEventSystemLocator>(); orbKeyButton.Build(targetGraphic); } private void Build(Graphic graphic) { //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_003e: 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_0070: Expected O, but got Unknown //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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0162: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0200: 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_01e7: 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_00c2: 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_00cd: Unknown result type (might be due to invalid IL or missing references) group = ((Component)this).gameObject.GetComponent<CanvasGroup>() ?? ((Component)this).gameObject.AddComponent<CanvasGroup>(); ColorBlock colors = ((Selectable)button).colors; ((ColorBlock)(ref colors)).colorMultiplier = 1f; ((Selectable)button).colors = colors; ((UnityEventBase)((Button)button).onClick).RemoveAllListeners(); ((UnityEvent)((Button)button).onClick).AddListener(new UnityAction(Toggle)); ((Selectable)button).interactable = true; ((MPButton)button).disablePointerClick = false; ((MPButton)button).disableGamepadClick = false; Color val = Elements.ColorOf(element); Image val2 = (Image)(object)((graphic is Image) ? graphic : null); if (val2 != null && Object.op_Implicit((Object)(object)WeaveAssets.UiKeycap)) { val2.sprite = WeaveAssets.UiKeycap; ((Graphic)val2).color = Color.Lerp(val, Color.white, 0.25f); } RectTransform parent = (RectTransform)((Component)this).transform; caption = Text("Caption", parent, new Vector2(0.05f, 0.7f), new Vector2(0.95f, 0.96f), val, 18f); label = Text("Key", parent, new Vector2(0.06f, 0.22f), new Vector2(0.94f, 0.74f), Color.white, 40f); footnote = Text("Footnote", parent, new Vector2(0.05f, 0.03f), new Vector2(0.95f, 0.24f), new Color(0.65f, 0.68f, 0.75f, 1f), 15f); string text = Language.GetString(OrbToken(element)); string text2 = Language.GetString("ELEMENTALWEAVE_KEY_TITLE") + ": " + text; string text3 = Language.GetString("ELEMENTALWEAVE_KEY_HELP"); TooltipProvider component = ((Component)this).GetComponent<TooltipProvider>(); if (Object.op_Implicit((Object)(object)component)) { component.titleColor = val; component.overrideTitleText = text2; component.overrideBodyText = text3; } Color val3 = val; val3.a = 0.2f; button.hoverToken = Language.GetStringFormatted("LOGBOOK_HOVER_DESCRIPTION_FORMAT", new object[3] { text2, text3, ColorUtility.ToHtmlStringRGBA(val3) }); Refresh(); } private static string OrbToken(Element element) { return element switch { Element.Ice => "ELEMENTALWEAVE_ORB_ICE_NAME", Element.Lightning => "ELEMENTALWEAVE_ORB_LIGHTNING_NAME", _ => "ELEMENTALWEAVE_ORB_FIRE_NAME", }; } private static TextMeshProUGUI Text(string name, RectTransform parent, Vector2 min, Vector2 max, Color color, float maxSize) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_003d: 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_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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }) { layer = ((Component)parent).gameObject.layer }; RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parent, false); val2.anchorMin = min; val2.anchorMax = max; Vector2 offsetMin = (val2.offsetMax = Vector2.zero); val2.offsetMin = offsetMin; HGTextMeshProUGUI obj = val.AddComponent<HGTextMeshProUGUI>(); ((TMP_Text)obj).alignment = (TextAlignmentOptions)514; ((TMP_Text)obj).enableWordWrapping = false; ((Graphic)obj).raycastTarget = false; ((TMP_Text)obj).richText = false; ((Graphic)obj).color = color; ((TMP_Text)obj).enableAutoSizing = true; ((TMP_Text)obj).fontSizeMin = 6f; ((TMP_Text)obj).fontSizeMax = maxSize; return (TextMeshProUGUI)(object)obj; } private void Toggle() { listening = !listening; listenSince = Time.unscaledTime; Refresh(); } private void Update() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (profile != null && Object.op_Implicit((Object)(object)slot) && Object.op_Implicit((Object)(object)slot.skillFamily)) { uint skillVariant = profile.loadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, slotIndex); bool flag = skillVariant < slot.skillFamily.variants.Length && slot.skillFamily.variants[skillVariant].skillDef is OrbSkillDef; group.alpha = ((flag || listening) ? 1f : 0.5f); } if (listening) { Listen(); } Refresh(); } private void Listen() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Invalid comparison between Unknown and I4 //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Invalid comparison between Unknown and I4 //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime - listenSince > 8f) { listening = false; } else { if (Time.unscaledTime - listenSince < 0.1f) { return; } if (candidates == null) { candidates = ((KeyCode[])Enum.GetValues(typeof(KeyCode))).Where((KeyCode k) => (int)k != 0 && (int)k < 330).Distinct().ToArray(); } KeyCode[] array = candidates; foreach (KeyCode val in array) { if (!OrbKeys.KeyDownReader(val)) { continue; } if ((int)val == 323) { if (!PointerOver()) { listening = false; } } else if ((int)val == 27) { listening = false; } else if ((int)val == 8 || (int)val == 127) { Entry.Value = KeyboardShortcut.Empty; listening = false; } else { Assign(val); listening = false; } break; } } } private void Assign(KeyCode key) { //IL_0042: 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_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_0020: 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_0029: Unknown result type (might be due to invalid IL or missing references) Element element = Element.Ice; while ((int)element <= 3) { ConfigEntry<KeyboardShortcut> val = OrbKeys.EntryFor(element); if (element != this.element && val != null) { KeyboardShortcut value = val.Value; if (((KeyboardShortcut)(ref value)).MainKey == key) { val.Value = KeyboardShortcut.Empty; } } element++; } Entry.Value = new KeyboardShortcut(key, Array.Empty<KeyCode>()); Util.PlaySound("Play_UI_menuClick", Object.op_Implicit((Object)(object)RoR2Application.instance) ? ((Component)RoR2Application.instance).gameObject : ((Component)this).gameObject); } private bool PointerOver() { //IL_0015: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown Canvas componentInParent = ((Component)this).GetComponentInParent<Canvas>(); Camera val = ((Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.rootCanvas.renderMode != 0) ? componentInParent.rootCanvas.worldCamera : null); return RectTransformUtility.RectangleContainsScreenPoint((RectTransform)((Component)this).transform, Vector2.op_Implicit(UnityInput.Current.mousePosition), val); } private void Refresh() { //IL_00fa: 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_008e: 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_009f: 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) if (!Object.op_Implicit((Object)(object)label)) { return; } if (listening) { ((TMP_Text)caption).text = Language.GetString("ELEMENTALWEAVE_KEY_WAIT"); ((TMP_Text)label).text = ((Mathf.Repeat(Time.unscaledTime, 0.8f) < 0.4f) ? "..." : ""); ((TMP_Text)footnote).text = "Esc / Backspace"; return; } ((TMP_Text)caption).text = Language.GetString("ELEMENTALWEAVE_KEY_CAPTION"); ConfigEntry<KeyboardShortcut> entry = Entry; if (entry != null) { KeyboardShortcut value = entry.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0) { ((TMP_Text)label).text = OrbKeys.Label(entry.Value); ((Graphic)label).color = Color.white; ((TMP_Text)footnote).text = ""; return; } } ((TMP_Text)label).text = SlotGlyph(); ((Graphic)label).color = new Color(0.6f, 0.63f, 0.7f, 1f); ((TMP_Text)footnote).text = Language.GetString("ELEMENTALWEAVE_KEY_GAME"); } private string SlotGlyph() { if (!Object.op_Implicit((Object)(object)eventSystemLocator) || !Object.op_Implicit((Object)(object)eventSystemLocator.eventSystem) || string.IsNullOrEmpty(slotAction)) { return "-"; } string glyphString = Glyphs.GetGlyphString(eventSystemLocator, slotAction); if (!string.IsNullOrEmpty(glyphString) && !glyphString.Contains("<")) { return glyphString; } return "-"; } private void OnDisable() { listening = false; } } public class SkillBarExtras : MonoBehaviour { private HUD hud; private readonly bool[] relabelled = new bool[4]; private GameObject teleportIcon; private SkillIcon teleportSkillIcon; private readonly Vector3[] corners = (Vector3[])(object)new Vector3[4]; private void Awake() { hud = ((Component)this).GetComponent<HUD>(); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)teleportIcon)) { Object.Destroy((Object)(object)teleportIcon); } } private void LateUpdate() { if (Object.op_Implicit((Object)(object)hud) && hud.skillIcons != null) { CharacterBody body = (Object.op_Implicit((Object)(object)hud.targetBodyObject) ? hud.targetBodyObject.GetComponent<CharacterBody>() : null); bool flag = WeaveConfig.Keys.GamepadUsesSlotButtons.Value && OrbKeys.UsesGamepad(hud.localUserViewer); for (int i = 0; i < hud.skillIcons.Length && i < relabelled.Length; i++) { SkillIcon val = hud.skillIcons[i]; Element element = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.targetSkill) && val.targetSkill.skillDef is OrbSkillDef orbSkillDef) ? orbSkillDef.element : Element.None); bool flag2 = element != Element.None && OrbKeys.HasKey(element) && !flag; Relabel(val, i, flag2 ? OrbKeys.EntryFor(element) : null); } UpdateTeleportIcon(body); } } private void Relabel(SkillIcon icon, int index, ConfigEntry<KeyboardShortcut> key) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)icon)) { return; } InputBindingDisplayController[] componentsInChildren = ((Component)icon).GetComponentsInChildren<InputBindingDisplayController>(true); if (key != null) { string text = OrbKeys.Label(key.Value); InputBindingDisplayController[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { TextMeshProUGUI component = ((Component)array[i]).GetComponent<TextMeshProUGUI>(); if (Object.op_Implicit((Object)(object)component) && ((TMP_Text)component).text != text) { ((TMP_Text)component).SetText(text, true); } } relabelled[index] = true; } else if (relabelled[index]) { relabelled[index] = false; InputBindingDisplayController[] array = componentsInChildren; foreach (InputBindingDisplayController obj in array) { ((Behaviour)obj).enabled = false; ((Behaviour)obj).enabled = true; } } } private void UpdateTeleportIcon(CharacterBody body) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0223: 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_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) TeleportPassive teleportPassive = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent<TeleportPassive>() : null); if (!Object.op_Implicit((Object)(object)teleportPassive) || !Object.op_Implicit((Object)(object)teleportPassive.slot) || !body.hasEffectiveAuthority || !WeaveConfig.Teleport.ShowHudIcon.Value) { if (Object.op_Implicit((Object)(object)teleportIcon)) { teleportIcon.SetActive(false); } return; } SkillIcon val = Template(); if (!Object.op_Implicit((Object)(object)val)) { return; } if (!Object.op_Implicit((Object)(object)teleportIcon)) { teleportIcon = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)val).transform.parent, false); ((Object)teleportIcon).name = "ElementalWeaveTeleportIcon"; (teleportIcon.GetComponent<LayoutElement>() ?? teleportIcon.AddComponent<LayoutElement>()).ignoreLayout = true; teleportSkillIcon = teleportIcon.GetComponent<SkillIcon>(); teleportSkillIcon.targetSkillSlot = (SkillSlot)(-1); InputBindingDisplayController[] componentsInChildren = teleportIcon.GetComponentsInChildren<InputBindingDisplayController>(true); foreach (InputBindingDisplayController obj in componentsInChildren) { obj.actionName = "Jump"; ((Behaviour)obj).enabled = false; ((Behaviour)obj).enabled = true; } } teleportIcon.SetActive(true); teleportSkillIcon.targetSkill = teleportPassive.slot; teleportSkillIcon.playerCharacterMasterController = val.playerCharacterMasterController; SkillIcon val2 = hud.skillIcons[0]; RectTransform val3 = (RectTransform)(Object.op_Implicit((Object)(object)val2) ? /*isinst with value type is only supported in some contexts*/: null); Transform transform = teleportIcon.transform; RectTransform val4 = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val4)) { ((Transform)val4).localScale = ((Transform)val3).localScale * 0.8f; val3.GetWorldCorners(corners); float num = corners[2].x - corners[1].x; float num2 = corners[1].y - corners[0].y; Vector3 val5 = corners[1]; val4.pivot = new Vector2(0.5f, 0.5f); ((Transform)val4).position = val5 + new Vector3((0f - num) * 0.78f, num2 * 0.9f, 0f); } } private SkillIcon Template() { for (int num = hud.skillIcons.Length - 1; num >= 0; num--) { if (Object.op_Implicit((Object)(object)hud.skillIcons[num])) { return hud.skillIcons[num]; } } return null; } } internal static class WeaveHud { internal static void Tick() { foreach (HUD readOnlyInstance in HUD.readOnlyInstanceList) { if (Object.op_Implicit((Object)(object)readOnlyInstance)) { if (!Object.op_Implicit((Object)(object)((Component)readOnlyInstance).GetComponent<SkillBarExtras>())) { ((Component)readOnlyInstance).gameObject.AddComponent<SkillBarExtras>(); } if (WeaveConfig.General.ShowHud.Value && !Object.op_Implicit((Object)(object)((Component)readOnlyInstance).GetComponent<WeaveHudPanel>())) { ((Component)readOnlyInstance).gameObject.AddComponent<WeaveHudPanel>(); } } } } } public class WeaveHudPanel : MonoBehaviour { private sealed class SpellSlot { private const float Stiffness = 320f; private const float Damping = 19f; private const float PopImpulse = 11f; internal readonly RectTransform rect; internal readonly Image sweep; internal readonly TextMeshProUGUI timer; internal bool wasPending; private readonly Image glow; private readonly Image frame; private readonly Image flash; private float scale = 1f; private float velocity; private float flashAlpha; internal SpellSlot(RectTransform parent, int index, float x, Sprite sprite) { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0092: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) rect = NewRect("Spell" + index, (Transform)(object)parent); rect.anchorMin = (rect.anchorMax = Vector2.zero); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchoredPosition = new Vector2(x + 15f, 15f); rect.sizeDelta = new Vector2(30f, 30f); glow = NewImage("Glow", (Transform)(object)rect, WeaveAssets.UiGlow, Clear(PendingGold)); Centre(((Graphic)glow).rectTransform, 62.999996f); frame = NewImage("Frame", (Transform)(object)rect, WeaveAssets.UiSquare, Clear(PendingGold)); Centre(((Graphic)frame).rectTransform, 34f); Image val = NewImage("Icon", (Transform)(object)rect, sprite, Color.white); Stretch(((Graphic)val).rectTransform); sweep = NewImage("Sweep", (Transform)(object)((Graphic)val).rectTransform, WeaveAssets.UiSquare, new Color(0f, 0f, 0f, 0.7f)); Stretch(((Graphic)sweep).rectTransform); sweep.type = (Type)3; sweep.fillMethod = (FillMethod)4; sweep.fillOrigin = 2; sweep.fillClockwise = false; flash = NewImage("Flash", (Transform)(object)((Graphic)val).rectTransform, WeaveAssets.UiSquare, new Color(1f, 1f, 1f, 0f)); Stretch(((Graphic)flash).rectTransform); timer = NewText("Timer", (Transform)(object)((Graphic)val).rectTransform, 13f, (TextAlignmentOptions)514); Stretch(((TMP_Text)timer).rectTransform); } internal void Pop() { velocity += 11f; flashAlpha = 1f; } internal void Animate(bool pending, float dt, float time) { //IL_0066: 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_00ba: 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_00db: 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) float num = (pending ? 1.45f : 1f); velocity += (320f * (num - scale) - 19f * velocity) * dt; scale += velocity * dt; ((Transform)rect).localScale = new Vector3(scale, scale, 1f); float num2 = Mathf.Clamp01((scale - 1f) / 0.45000005f); ((Graphic)glow).color = Alpha(PendingGold, num2 * (0.5f + 0.15f * Mathf.Sin(time * 5f)) + flashAlpha * 0.5f); ((Graphic)frame).color = Alpha(PendingGold, Mathf.Max(num2, flashAlpha)); flashAlpha = Mathf.MoveTowards(flashAlpha, 0f, dt * 3f); ((Graphic)flash).color = new Color(1f, 1f, 1f, flashAlpha * 0.75f); } } private sealed class OrbPip { internal readonly Vector2 center; private readonly int index; private readonly RectTransform rect; private readonly Image glow; private readonly Image ball; private readonly Image inner; private readonly Image shine; private Element shown; private float pop; private float spawnA; private float spawnB; private float boltTimer; private float innerFlash; internal OrbPip(RectTransform parent, int index, Vector2 center) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_016f: Unknown result type (might be due to invalid IL or missing references) this.index = index; this.center = center; rect = NewRect("Orb" + index, (Transform)(object)parent); rect.anchorMin = (rect.anchorMax = Vector2.zero); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchoredPosition = center; rect.sizeDelta = new Vector2(26f, 26f); glow = NewImage("Glow", (Transform)(object)rect, WeaveAssets.UiGlow, Color.clear); Centre(((Graphic)glow).rectTransform, 59.8f); ball = NewImage("Ball", (Transform)(object)rect, WeaveAssets.UiRing, Color.white); Stretch(((Graphic)ball).rectTransform); inner = NewImage("Inner", (Transform)(object)rect, null, Color.clear); Centre(((Graphic)inner).rectTransform, 16.12f); shine = NewImage("Shine", (Transform)(object)rect, WeaveAssets.UiGlow, Color.clear); Centre(((Graphic)shine).rectTransform, 10.92f); ((Graphic)shine).rectTransform.anchoredPosition = new Vector2(-4.42f, 5.2000003f); Show(Element.None); } private void Show(Element element) { //IL_004b: 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_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) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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) shown = element; bool flag = element == Element.None; ball.sprite = (flag ? WeaveAssets.UiRing : WeaveAssets.UiOrbBall); ((Graphic)ball).color = (Color)(flag ? new Color(1f, 1f, 1f, 0.22f) : Elements.ColorOf(element)); ((Graphic)shine).color = (Color)(flag ? Color.clear : new Color(1f, 1f, 1f, 0.7f)); inner.sprite = (Sprite)(element switch { Element.Fire => WeaveAssets.UiFlame, Element.Ice => WeaveAssets.UiSnowflake, _ => WeaveAssets.UiGlow, }); ((Transform)((Graphic)inner).rectTransform).localRotation = Quaternion.identity; Centre(((Graphic)inner).rectTransform, 26f * ((element == Element.Fire) ? 0.66f : 0.62f)); if (element == Element.Fire) { ((Graphic)inner).rectTransform.sizeDelta = new Vector2(13f, 17.16f); } if (flag) { ((Graphic)inner).color = Color.clear; ((Graphic)glow).color = Color.clear; } } internal void Animate(Element orb, float dt, float time, OrbFx fx, Vector2? next, bool nextIsLightning) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_00c5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: 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_03fc: 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_0445: 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_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: 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_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032a: 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_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0338: 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_0342: 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_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: 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_01c0: 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_01cf: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) if (orb != shown) { if (shown != Element.None) { fx.Burst(shown, center); } Show(orb); if (orb != Element.None) { pop = 1f; } } pop = Mathf.MoveTowards(pop, 0f, dt * 4f); float num = 1f + 0.55f * pop * pop; if (shown == Element.None) { ((Transform)rect).localScale = Vector3.one; return; } Color color = Elements.ColorOf(shown); float num2 = (float)index * 1.7f; switch (shown) { case Element.Ice: ((Transform)rect).localScale = Vector3.one * num; ((Graphic)glow).color = Alpha(color, 0.45f + 0.1f * Mathf.Sin(time * 2.2f + num2) + pop * 0.5f); ((Graphic)inner).color = new Color(1f, 1f, 1f, 0.8f); ((Transform)((Graphic)inner).rectTransform).localRotation = Quaternion.Euler(0f, 0f, (0f - time) * 25f - num2 * 30f); spawnA += dt * 7f; while (spawnA >= 1f) { fx.Snowflake(center, 1f); spawnA -= 1f; } spawnB += dt * 3f; while (spawnB >= 1f) { fx.Glint(center + Random.insideUnitCircle * 26f * 0.6f); spawnB -= 1f; } break; case Element.Lightning: { float num5 = Mathf.PerlinNoise(time * 9f, num2); ((Transform)rect).localScale = Vector3.one * (num * (0.96f + 0.06f * num5)); ((Graphic)glow).color = Alpha(color, 0.3f + 0.35f * num5 + innerFlash * 0.4f + pop * 0.5f); innerFlash = Mathf.MoveTowards(innerFlash, 0f, dt * 6f); ((Graphic)inner).color = new Color(1f, 1f, 1f, 0.25f + 0.3f * num5 + innerFlash * 0.6f); boltTimer -= dt; if (!(boltTimer <= 0f)) { break; } boltTimer = Random.Range(0.07f, 0.28f); innerFlash = 1f; if (next.HasValue && nextIsLightning && Random.value < 0.4f) { Vector2 val = next.Value - center; Vector2 normalized = ((Vector2)(ref val)).normalized; fx.Bolt(center + normalized * 26f * 0.42f, next.Value - normalized * 26f * 0.42f, color, 3f); break; } fx.OutwardBolt(center, color); if (Random.value < 0.45f) { fx.OutwardBolt(center, color); } break; } case Element.Fire: { float num3 = Mathf.PerlinNoise(time * 7f, num2 + 10f); ((Transform)rect).localScale = Vector3.one * (num * (0.97f + 0.05f * num3)); ((Graphic)glow).color = Alpha(color, 0.4f + 0.3f * num3 + pop * 0.5f); ((Graphic)inner).color = new Color(1f, 0.93f, 0.6f, 0.65f + 0.3f * num3); float num4 = Mathf.Sin(time * 11f + num2) * 6f; ((Transform)((Graphic)inner).rectTransform).localRotation = Quaternion.Euler(0f, 0f, num4); ((Transform)((Graphic)inner).rectTransform).localScale = new Vector3(1f, 0.9f + 0.25f * num3, 1f); spawnA += dt * 22f; while (spawnA >= 1f) { fx.Flame(center, 1f); spawnA -= 1f; } spawnB += dt * 3.5f; while (spawnB >= 1f) { fx.Ember(center); spawnB -= 1f; } break; } } } } private sealed class OrbFx { private sealed class Particle { internal Image image; internal RectTransform rect; internal bool active; internal Vector2 position; internal Vector2 velocity; internal Vector2 acceleration; internal float age; internal float life; internal float size0; internal float size1; internal float aspect; internal float rotation; internal float spin; internal float wobble; internal float wobbleSpeed; internal float phase; internal Color color0; internal Color color1; } private sealed class Arc { internal readonly Image[] glow = (Image[])(object)new Image[4]; internal readonly Image[] core = (Image[])(object)new Image[4]; internal readonly Vector2[] points = (Vector2[])(object)new Vector2[5]; internal bool active; internal bool rerolled; internal Vector2 from; internal Vector2 to; internal float age; internal float life; internal float jitter; internal Color color; } private const int BoltSegments = 4; private static readonly Color SnowWhite = new Color(0.92f, 0.98f, 1f, 0.95f); private static readonly Color SnowEnd = new Color(0.55f, 0.85f, 1f, 0f); private static readonly Color FlameHot = new Color(1f, 0.93f, 0.55f, 0.95f); private static readonly Color FlameEnd = new Color(0.85f, 0.15f, 0.04f, 0f); private static readonly Color EmberHot = new Color(1f, 0.82f, 0.4f, 1f); private static readonly Color EmberEnd = new Color(1f, 0.35f, 0.1f, 0f); private readonly RectTransform layer; private readonly List<Particle> particles = new List<Particle>(); private readonly List<Arc> arcs = new List<Arc>(); internal OrbFx(RectTransform layer) { this.layer = layer; } internal void Clear() { foreach (Particle particle in particles) { Hide(particle); } foreach (Arc arc in arcs) { HideArc(arc); } } internal void Snowflake(Vector2 center, float speed) { //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_0008: 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_0024: 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_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_004f: 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_0063: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; float num = Random.Range(8f, 11f); Spawn(WeaveAssets.UiSnowflake, center + normalized * 26f * 0.42f, (normalized * Random.Range(10f, 17f) + new Vector2(0f, -3f)) * speed, new Vector2(0f, -12f), Random.Range(1f, 1.5f), num, num * 0.5f, 1f, SnowWhite, SnowEnd, Random.Range(-140f, 140f), 1.5f, 3f); } internal void Glint(Vector2 position) { //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_0025: 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) Spawn(WeaveAssets.UiGlow, position, Vector2.zero, Vector2.zero, 0.35f, 9f, 0f, 1f, Color.white, new Color(0.7f, 0.9f, 1f, 0f), 0f, 0f, 0f); } internal void Flame(Vector2 center, float speed) { //IL_0000: 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_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_004a: 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_006f: 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_009d: 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) Vector2 position = center + new Vector2(Random.Range(-0.3f, 0.3f), Random.Range(-0.05f, 0.3f)) * 26f; float size = Random.Range(11f, 15f); Spawn(WeaveAssets.UiFlame, position, new Vector2(Random.Range(-3f, 3f), Random.Range(22f, 34f)) * speed, new Vector2(0f, 16f), Random.Range(0.4f, 0.65f), size, 3f, 0.75f, FlameHot, FlameEnd, 0f, 1.8f, 14f).rotation = Random.Range(-12f, 12f); } internal void Ember(Vector2 center) { //IL_0006: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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) Spawn(WeaveAssets.UiGlow, center + new Vector2(Random.Range(-0.3f, 0.3f), 0.3f) * 26f, new Vector2(Random.Range(-6f, 6f), Random.Range(20f, 32f)), Vector2.zero, Random.Range(0.7f, 1.1f), 5f, 2f, 1f, EmberHot, EmberEnd, 0f, 3f, 9f); } internal void OutwardBolt(Vector2 center, Color color) { //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_0008: 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_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_0015: 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_0029: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: 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_0072: 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_0075: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00c0: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; Vector2 val = center + normalized * 26f * 0.4f; Vector2 val2 = val + Vector2.op_Implicit(Quaternion.Euler(0f, 0f, Random.Range(-25f, 25f)) * Vector2.op_Implicit(normalized)) * Random.Range(12f, 20f); Bolt(val, val2, color, 4.5f); for (int i = 0; i < 2; i++) { Spawn(WeaveAssets.UiGlow, val2, Random.insideUnitCircle * 25f, Vector2.zero, 0.25f, 6f, 0f, 1f, Color.white, Alpha(color, 0f), 0f, 0f, 0f); } } internal void Bolt(Vector2 from, Vector2 to, Color color, float jitter) { //IL_00e8: 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_00ef: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) Arc arc = null; foreach (Arc arc2 in arcs) { if (!arc2.active) { arc = arc2; break; } } if (arc == null) { if (arcs.Count >= 12) { return; } arc = new Arc(); for (int i = 0; i < 4; i++) { arc.glow[i] = NewImage("ArcGlow", (Transform)(object)layer, WeaveAssets.UiSquare, Color.clear); arc.core[i] = NewImage("ArcCore", (Transform)(object)layer, WeaveAssets.UiSquare, Color.clear); Segment(((Graphic)arc.glow[i]).rectTransform); Segment(((Graphic)arc.core[i]).rectTransform); } arcs.Add(arc); } arc.active = true; arc.rerolled = false; arc.from = from; arc.to = to; arc.age = 0f; arc.life = Random.Range(0.1f, 0.18f); arc.jitter = jitter; arc.color = color; Jag(arc); } internal void Burst(Element element, Vector2 center) { //IL_001a: 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_004c: 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) switch (element) { case Element.Ice: { for (int j = 0; j < 8; j++) { Snowflake(center, 2.6f); } break; } case Element.Lightning: { for (int k = 0; k < 3; k++) { OutwardBolt(center, Elements.LightningColor); } break; } case Element.Fire: { for (int i = 0; i < 6; i++) { Flame(center, 1.8f); Ember(center); } break; } } } internal void Update(float dt) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0078: 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_0084: 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_008e: 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) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0248: 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) foreach (Particle particle in particles) { if (particle.active) { particle.age += dt; if (particle.age >= particle.life) { Hide(particle); continue; } float num = particle.age / particle.life; particle.velocity += particle.acceleration * dt; particle.position += particle.velocity * dt; particle.rotation += particle.spin * dt; float num2 = Mathf.Lerp(particle.size0, particle.size1, num); particle.rect.anchoredPosition = particle.position + new Vector2(particle.wobble * Mathf.Sin(particle.phase + particle.age * particle.wobbleSpeed), 0f); particle.rect.sizeDelta = new Vector2(num2 * particle.aspect, num2); ((Transform)particle.rect).localRotation = Quaternion.Euler(0f, 0f, particle.rotation); Color color = Color.Lerp(particle.color0, particle.color1, num); color.a *= Mathf.Clamp01(num / 0.12f); ((Graphic)particle.image).color = color; } } foreach (Arc arc in arcs) { if (!arc.active) { continue; } arc.age += dt; if (arc.age >= arc.life) { HideArc(arc); continue; } if (!arc.rerolled && arc.age >= arc.life * 0.5f) { arc.rerolled = true; Jag(arc); } float num3 = 1f - Mathf.Pow(arc.age / arc.life, 2f); for (int i = 0; i < 4; i++) { ((Graphic)arc.glow[i]).color = Alpha(arc.color, 0.5f * num3); ((Graphic)arc.core[i]).color = new Color(1f, 1f, 1f, num3); } } } private void Jag(Arc arc) { //IL_0001: 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_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_0019: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_007b: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) Vector2 val = arc.to - arc.from; Vector2 val2 = new Vector2(0f - val.y, val.x); Vector2 normalized = ((Vector2)(ref val2)).normalized; for (int i = 0; i <= 4; i++) { float num = (float)i / 4f; float num2 = ((i == 0 || i == 4) ? 0f : (Random.Range(-1f, 1f) * arc.jitter)); arc.points[i] = arc.from + val * num + normalized * num2; } for (int j = 0; j < 4; j++) { Lay(((Graphic)arc.glow[j]).rectTransform, arc.points[j], arc.points[j + 1], 6f); Lay(((Graphic)arc.core[j]).rectTransform, arc.points[j], arc.points[j + 1], 2f); } } private static void Segment(RectTransform rect) { //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_0008: 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_001f: Unknown result type (might be due to invalid IL or missing references) Vector2 anchorMin = (rect.anchorMax = Vector2.zero); rect.anchorMin = anchorMin; rect.pivot = new Vector2(0f, 0.5f); } private static void Lay(RectTransform rect, Vector2 a, Vector2 b, float width) { //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_0009: 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_0035: 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_004c: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; rect.anchoredPosition = a; rect.sizeDelta = new Vector2(((Vector2)(ref val)).magnitude + width * 0.3f, width); ((Transform)rect).localRotation = Quaternion.Euler(0f, 0f, Mathf.Atan2(val.y, val.x) * 57.29578f); } private Particle Spawn(Sprite sprite, Vector2 position, Vector2 velocity, Vector2 acceleration, float life, float size0, float size1, float aspect, Color color0, Color color1, float spin, float wobble, float wobbleSpeed) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01dc: Unknown result type (might be due to invalid IL or missing references) Particle particle = null; foreach (Particle particle2 in particles) { if (!particle2.active) { particle = particle2;