Decompiled source of GrimdarkRounds v3.5.0
plugins/GrimdarkRounds.dll
Decompiled 5 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Photon.Pun; using RarityLib.Utils; using TMPro; using UnboundLib; using UnboundLib.Cards; using UnboundLib.GameModes; using UnboundLib.Networking; using UnityEngine; using UnityEngine.TextCore; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("3.5.0.0")] namespace GrimdarkRounds; internal enum Affliction { Burn, Poison, Slow, Shock, Bleed, Decay, Warp } internal readonly struct Ultimate { internal readonly string Ru; internal readonly string En; internal readonly string DetailRu; internal readonly string DetailEn; internal readonly Affliction Effect; internal readonly float Radius; internal string Name => Localization.Text(Ru, En); internal string Detail => Localization.Text(DetailRu, DetailEn); internal Ultimate(string ru, string en, string detailRu, string detailEn, Affliction effect, float radius) { Ru = ru; En = en; DetailRu = detailRu; DetailEn = detailEn; Effect = effect; Radius = radius; } } internal static class BattleSystems { internal static readonly Dictionary<Ability, Ultimate> Ultimates = new Dictionary<Ability, Ultimate> { [Ability.Mortarion] = new Ultimate("Сад Нургла", "Garden of Nurgle", "Поднимает облако яда в указанной точке.", "Raises a poison cloud at the aimed position.", Affliction.Poison, 4.4f), [Ability.Vulkan] = new Ultimate("Горнило Ноктюрна", "Nocturne Forge", "Поджигает землю и врагов.", "Ignites the ground and enemies.", Affliction.Burn, 3.3f), [Ability.Imotekh] = new Ultimate("Гроза Саутеха", "Sautekh Tempest", "Разворачивает поле молний, замедляющее стрельбу.", "Creates a lightning field that slows enemy fire.", Affliction.Shock, 4.5f), [Ability.Magnus] = new Ultimate("Око Просперо", "Eye of Prospero", "Варп-аномалия стягивает врагов и ослабляет их выстрелы.", "A warp anomaly pulls enemies in and weakens their shots.", Affliction.Warp, 4f), [Ability.SilentKing] = new Ultimate("Погребальный пилон", "Sepulchral Pylon", "Некронское поле разлагает материю и снижает лечение.", "A Necron field decays matter and suppresses healing.", Affliction.Decay, 4f), [Ability.Angron] = new Ultimate("Мясорубка Кхорна", "Khorne's Slaughter", "Кровавая волна ранит и отбрасывает ближайших врагов.", "A blood wave wounds and knocks back nearby foes.", Affliction.Bleed, 4.9f), [Ability.Trazyn] = new Ultimate("Камера вне времени", "Timeless Vault", "Создаёт поле сильного замедления.", "Creates a field of heavy slowing.", Affliction.Slow, 4f) }; internal static readonly string[] Ru = new string[7] { "Горение", "Яд", "Замедление", "Разряд", "Кровотечение", "Разложение", "Варп-искажение" }; internal static readonly string[] En = new string[7] { "Burn", "Poison", "Slow", "Shock", "Bleed", "Decay", "Warp Distortion" }; internal static readonly Color[] Colors = (Color[])(object)new Color[7] { new Color(1f, 0.53f, 0.18f), new Color(0.66f, 0.92f, 0.15f), new Color(0.39f, 0.85f, 1f), new Color(0.46f, 0.7f, 1f), new Color(1f, 0.29f, 0.28f), new Color(0.27f, 1f, 0.46f), new Color(0.95f, 0.45f, 1f) }; internal static void Inflict(Player source, Player target, Ability id, Affliction status, float seconds, float damage) { if (Combat.Active && Combat.Owns(source) && Combat.Alive(target) && Combat.Enemy(source, target) && !target.data.block.IsBlocking()) { if (Combat.Owns(target)) { Apply(source, target, id, status, seconds, damage); return; } NetworkingManager.RPC(typeof(BattleSystems), "Receive", new object[7] { Plugin.Point, source.data.view.ViewID, target.data.view.ViewID, (int)id, (int)status, seconds, damage }); } } [UnboundRPC] private static void Receive(int point, int sourceId, int targetId, int ability, int status, float seconds, float damage) { if (Combat.Active && point == Plugin.Point && ability >= 0 && ability < 100 && status >= 0 && status < Ru.Length && seconds > 0f && seconds <= 4f && damage >= 0f && damage <= 12f && HeroRules.TryGet((Ability)ability, out var _)) { Player val = Combat.Find(sourceId); Player val2 = Combat.Find(targetId); if (Combat.Owns(val2) && Combat.Alive(val2) && Combat.Enemy(val, val2) && !val2.data.block.IsBlocking()) { Apply(val, val2, (Ability)ability, (Affliction)status, seconds, damage); } } } private static void Apply(Player source, Player target, Ability id, Affliction status, float seconds, float damage) { Combat.Attach(target).AddAffliction(source, id, status, seconds, damage); HeroVisuals.Attach(id, target, (int)(7 + status), seconds); } } public sealed class CombatState : MonoBehaviour { private struct TimedStatus { internal Ability Id; internal Player Source; internal float Until; internal float Tick; internal float Damage; } private struct HeroField { internal Ability Ability; internal Power Power; internal Vector2 Position; internal Vector2 Axis; internal float Born; internal float Expires; internal float Next; internal float Radius; internal float Damage; internal float Interval; internal int Pulses; internal Player Target; } private readonly TimedStatus[] statuses = new TimedStatus[7]; private float ultimateCharge; private float ultimateOpened; private float nextUltimatePulse; private Ability ultimateId = Ability.Count; private Vector2 ultimateCenter; private int ultimatePulses; private readonly HashSet<Ability> deck = new HashSet<Ability>(); private readonly int[] factions = new int[Progression.Factions.Length]; private readonly bool[] evolved = new bool[100]; private readonly bool[] linked = new bool[100]; private float buildHealth; private float nextHeal; private float buildHp; private float buildDamage; private float buildRate; private float buildMove; private float buildHeal; private float appliedMovement = 1f; private readonly bool[] shownEvolution = new bool[100]; private readonly float[] ready = new float[100]; private readonly List<Ability> choices = new List<Ability>(); private int point = -1; private int slot; private int charges; private Ability active = Ability.Count; private HeroRule activeRule; private float ends; private float frozen; private float freezeStart; private float slowed; private float ward; private float nextTick; private float saveHealth; private bool locked; private bool revivedThisPoint; private Vector2 anchor; private Vector2 direction; private Vector2 frozenAt; private readonly Queue<(float Time, Vector2 Position, float Health)> history = new Queue<(float, Vector2, float)>(); private float sampleAt; private float buildSampleAt; private float movementFactor = 1f; private float sizeFactor = 1f; private const int MaxFields = 12; private readonly List<HeroField> fields = new List<HeroField>(); private Ability sharedChoice = Ability.Count; private int scrapShots; internal float UltimateCharge => ultimateCharge; internal float ShockRate { get { if (!Afflicted(Affliction.Shock)) { return 1f; } return 1.28f; } } internal float WarpDamage { get { if (!Afflicted(Affliction.Warp)) { return 1f; } return 0.78f; } } internal float HealingFactor { get { if (!Afflicted(Affliction.Decay)) { return 1f; } return 0.55f; } } internal float FormationDamage => 1f + buildDamage; internal float FormationRate => 1f + buildRate; internal float FormationMove => 1f + buildMove; internal Player Player { get; private set; } private float Now => Time.time; private float Max => Player.data.maxHealth; internal bool Acting { get { if (Combat.Active && Combat.Alive(Player)) { return Combat.Owns(Player); } return false; } } internal bool Frozen { get { if (Combat.Active && point == Plugin.Point && Now >= freezeStart) { return Now < frozen; } return false; } } internal bool Flying { get { if (Active(out var rule)) { return rule.Flight; } return false; } } internal bool Boosting { get { if (Active(out var rule)) { if (rule.Power != Power.Roar && rule.Power != Power.Berserk && rule.Power != Power.Tactics && rule.Power != Power.Forge && rule.Power != Power.Implants) { return rule.Power == Power.Rush; } return true; } return false; } } internal float GunDamage { get { if (!Active(out var rule) || rule.Power != Power.Berserk) { if (!Active(out rule) || rule.Power != Power.Roar) { return 1f; } return 1.27f; } return 1.48f; } } internal bool HasAny { get { if (Combat.Alive(Player)) { return Player.data.currentCards.Any((CardInfo c) => Object.op_Implicit((Object)(object)c) && Object.op_Implicit((Object)(object)((Component)c).GetComponent<GrimdarkCard>())); } return false; } } internal Ability Selected { get { if (choices.Count != 0) { return choices[slot % choices.Count]; } return Ability.Count; } } internal float Remaining => Mathf.Max(0f, ends - Now); internal Vector2 Aim { get { //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_002c: 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) Vector2 val = Vector2.op_Implicit(Player.data.aimDirection); if (!(((Vector2)(ref val)).sqrMagnitude > 0.04f)) { return Vector2.right; } return ((Vector2)(ref val)).normalized; } } internal Ability WeaponHero { get { if (sharedChoice != Ability.Count && Has(sharedChoice)) { return sharedChoice; } HeroRule rule; return (from c in (Player?.data?.currentCards)?.Where((CardInfo c) => Object.op_Implicit((Object)(object)c)) select ((Component)c).GetComponent<GrimdarkCard>() into c where Object.op_Implicit((Object)(object)c) && HeroRules.TryGet(c.Ability, out rule) select c.Ability).DefaultIfEmpty(Ability.Count).Min() ?? Ability.Count; } } private bool Afflicted(Affliction status) { return statuses[(int)status].Until > Now; } internal IEnumerable<int> StatusIds() { for (int i = 0; i < statuses.Length; i++) { if (statuses[i].Until > Now) { yield return i; } } } internal void AddAffliction(Player source, Ability id, Affliction status, float duration, float damage) { if (point != Plugin.Point) { ResetState(); } ref TimedStatus reference = ref statuses[(int)status]; float num = ((status == Affliction.Burn) ? 0.33f : 0.55f); bool flag = reference.Until > Now; if (!flag || damage >= reference.Damage) { reference.Source = source; reference.Id = id; reference.Damage = damage; } reference.Tick = (flag ? reference.Tick : (Now + num)); reference.Until = Mathf.Max(reference.Until, Now + duration); } private void ResetExpansion() { Array.Clear(statuses, 0, statuses.Length); ultimateCharge = (ultimateOpened = (nextUltimatePulse = 0f)); ultimatePulses = 0; ultimateId = Ability.Count; } internal void ChargeFromDamage(float damage) { if (Acting && damage > 0f && deck.Any(BattleSystems.Ultimates.ContainsKey)) { ultimateCharge = Mathf.Clamp01(ultimateCharge + Mathf.Min(0.14f, damage / Mathf.Max(1f, Max) * 0.55f)); } } private bool TryUltimate() { //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_0070: 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_007b: 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_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) //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_00e8: 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) Ability selected = Selected; if (selected == Ability.Count || !BattleSystems.Ultimates.TryGetValue(selected, out var value)) { return false; } if (ultimateCharge < 0.999f || ultimatePulses != 0) { return true; } ultimateCharge = 0f; ultimateId = selected; ultimateOpened = (nextUltimatePulse = Now); bool flag = value.Effect == Affliction.Bleed; ultimateCenter = (flag ? Vector2.op_Implicit(((Component)this).transform.position) : ForwardPoint(Vector2.op_Implicit(((Component)this).transform.position), Aim, 5f)); ultimatePulses = (flag ? 1 : 5); HeroVisuals.Emit(selected, Vector2.op_Implicit(((Component)this).transform.position), ultimateCenter, 1, 0.62f); HeroVisuals.Emit(selected, ultimateCenter, ultimateCenter + Vector2.right * value.Radius, (int)(7 + value.Effect), flag ? 1f : 4.3f); UpdateUltimate(); return true; } private void UpdateUltimate() { //IL_009b: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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) if (ultimatePulses <= 0 || Now < nextUltimatePulse) { return; } if (!Has(ultimateId) || Now > ultimateOpened + 4.4f) { ultimatePulses = 0; return; } Ultimate ultimate = BattleSystems.Ultimates[ultimateId]; float radius = ((ultimate.Effect == Affliction.Poison) ? (ultimate.Radius * Mathf.Lerp(0.64f, 1f, (float)(5 - ultimatePulses) / 4f)) : ultimate.Radius); bool flag = ultimate.Effect == Affliction.Bleed; foreach (Player item in Combat.Nearby(Player, ultimateCenter, radius).Take(6)) { if (!item.data.block.IsBlocking()) { float damage = (flag ? 6f : ((ultimate.Effect == Affliction.Burn || ultimate.Effect == Affliction.Poison || ultimate.Effect == Affliction.Decay) ? 4f : 0f)); BattleSystems.Inflict(Player, item, ultimateId, ultimate.Effect, flag ? 2.4f : 1.2f, damage); if (ultimate.Effect == Affliction.Warp) { Combat.Pull(Player, item, ultimateCenter, 5f); } Combat.Bonus(Player, item, flag ? 36f : 7f, ultimateId, flag ? 13f : 0f); if (ultimate.Effect == Affliction.Shock) { Visuals.Lightning(ultimateId, ultimateCenter, Vector2.op_Implicit(((Component)item).transform.position)); } } } ultimatePulses--; nextUltimatePulse = Now + 0.85f; } private void UpdateExpansion() { if (deck.Any(BattleSystems.Ultimates.ContainsKey)) { ultimateCharge = Mathf.Clamp01(ultimateCharge + Time.deltaTime / 22f); } UpdateUltimate(); for (int i = 0; i < statuses.Length; i++) { ref TimedStatus reference = ref statuses[i]; if (reference.Until <= Now) { reference = default(TimedStatus); } else if (!(reference.Damage <= 0f) && !(reference.Tick > Now)) { reference.Tick = Now + ((i == 0) ? 0.33f : 0.55f); if (Combat.Enemy(reference.Source, Player)) { Combat.Bonus(reference.Source, Player, reference.Damage, reference.Id, 0f, periodic: true, scale: false); } if (!Acting) { break; } } } } internal int CountFaction(int faction) { return factions[faction]; } internal static bool DefensiveEvolution(Ability id) { if (id != Ability.TerminatorArmor && id != Ability.Chitin) { return id == Ability.Necrodermis; } return true; } internal bool Evolved(Ability id) { return evolved[(int)id]; } internal bool Linked(Ability id) { return linked[(int)id]; } internal float SpecialPower(Ability id) { return 1f + (Evolved(id) ? 0.12f : 0f) + (Linked(id) ? 0.12f : 0f) + ((factions[Progression.Faction(id)] >= 5) ? Progression.Factions[Progression.Faction(id)].Second : 0f); } internal void ReadBuild() { //IL_0234: 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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) deck.Clear(); Array.Clear(factions, 0, factions.Length); Array.Clear(linked, 0, linked.Length); if (!Object.op_Implicit((Object)(object)Player) || (Object)(object)Player.data == (Object)null) { return; } foreach (CardInfo currentCard in Player.data.currentCards) { if (Object.op_Implicit((Object)(object)currentCard)) { GrimdarkCard component = ((Component)currentCard).GetComponent<GrimdarkCard>(); if (component != null && deck.Add(component.Ability)) { factions[Progression.Faction(component.Ability)]++; } } } buildHp = (buildDamage = (buildRate = (buildMove = (buildHeal = 0f)))); for (int i = 0; i < factions.Length; i++) { if (factions[i] >= 3) { Formation formation = Progression.Factions[i]; buildHp += formation.Hp; buildDamage += formation.Damage; buildRate += formation.Rate; buildMove += formation.Speed; buildHeal += formation.Regen; } } foreach (Ability evolf in Progression.Evolves) { bool flag = deck.Contains(evolf) && factions[Progression.Faction(evolf)] >= 4; if (flag) { if (DefensiveEvolution(evolf)) { buildHp += 0.05f; } else { buildDamage += 0.035f; } if (!shownEvolution[(int)evolf] && Acting) { shownEvolution[(int)evolf] = true; HeroVisuals.Emit(evolf, Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)this).transform.position) + Vector2.right * 1.8f, 2, 0.48f); } } else { shownEvolution[(int)evolf] = false; } evolved[(int)evolf] = flag; } (Ability, Ability, string, string)[] pairs = Progression.Pairs; for (int j = 0; j < pairs.Length; j++) { (Ability, Ability, string, string) tuple = pairs[j]; if (deck.Contains(tuple.Item1) && deck.Contains(tuple.Item2)) { linked[(int)tuple.Item1] = (linked[(int)tuple.Item2] = true); } } buildHp = Mathf.Min(buildHp, 0.3f); buildDamage = Mathf.Min(buildDamage, 0.3f); buildRate = Mathf.Min(buildRate, 0.25f); buildMove = Mathf.Min(buildMove, 0.22f); buildHeal = Mathf.Min(buildHeal, 3f); } private void UpdateFormation() { if (!Mathf.Approximately(appliedMovement, FormationMove)) { CharacterStatModifiers stats = Player.data.stats; stats.movementSpeed *= FormationMove / appliedMovement; appliedMovement = FormationMove; } float num = Mathf.Max(1f, Max - buildHealth); float num2 = Mathf.Max(0f, num * buildHp); if (!Mathf.Approximately(buildHealth, num2)) { Player.data.maxHealth = num + num2; Player.data.health = Mathf.Min(Max, Player.data.health + Mathf.Max(0f, num2 - buildHealth)); buildHealth = num2; } if (Now >= nextHeal) { nextHeal = Now + 1f; Heal(buildHeal); } } private void ResetFormation() { if (buildHealth > 0f && Object.op_Implicit((Object)(object)Player) && Object.op_Implicit((Object)(object)Player.data)) { Player.data.maxHealth = Mathf.Max(1f, Max - buildHealth); Player.data.health = Mathf.Min(Player.data.health, Max); } if (appliedMovement != 1f && Object.op_Implicit((Object)(object)Player) && Object.op_Implicit((Object)(object)Player.data) && Object.op_Implicit((Object)(object)Player.data.stats)) { CharacterStatModifiers stats = Player.data.stats; stats.movementSpeed /= appliedMovement; } appliedMovement = 1f; buildHealth = (nextHeal = 0f); Array.Clear(shownEvolution, 0, shownEvolution.Length); Array.Clear(evolved, 0, evolved.Length); } private HeroRule Improved(Ability id, HeroRule rule) { if (!Evolved(id) && !Linked(id)) { return rule; } float num = 1f + (Evolved(id) ? 0.12f : 0f) + (Linked(id) ? 0.1f : 0f); return new HeroRule { Power = rule.Power, Cooldown = rule.Cooldown, Damage = rule.Damage, Duration = rule.Duration * num, Range = rule.Range * num, NameRu = rule.NameRu, NameEn = rule.NameEn, DescRu = rule.DescRu, DescEn = rule.DescEn }; } internal bool Has(Ability key) { if (Object.op_Implicit((Object)(object)Player)) { return Player.data.currentCards.Any(delegate(CardInfo c) { if (Object.op_Implicit((Object)(object)c)) { GrimdarkCard component = ((Component)c).GetComponent<GrimdarkCard>(); if (component != null) { return component.Ability == key; } } return false; }); } return false; } internal float Cooldown(Ability key) { return Mathf.Max(0f, ready[(int)key] - Now); } internal bool Active(out HeroRule rule) { rule = activeRule; if (rule != null) { return Now < ends; } return false; } private void Awake() { Player = ((Component)this).GetComponent<Player>(); ResetState(); } private void OnDisable() { ResetState(resetCooldowns: false); } internal void ResetState(bool resetCooldowns = true) { DropBuffs(); ResetFormation(); ResetExpansion(); HeroVisuals.Clear(Player); point = Plugin.Point; active = Ability.Count; activeRule = null; ends = (frozen = (freezeStart = (slowed = (ward = (nextTick = (sampleAt = 0f)))))); locked = false; slot = (charges = (scrapShots = 0)); sharedChoice = Ability.Count; fields.Clear(); history.Clear(); if (resetCooldowns) { Array.Clear(ready, 0, ready.Length); revivedThisPoint = false; } } internal void Invalidate(Ability ability) { if (active == ability) { EndMode(finish: false); } fields.RemoveAll((HeroField f) => f.Ability == ability); Choices(); } private void Choices() { choices.Clear(); if (!Object.op_Implicit((Object)(object)Player) || (Object)(object)Player.data == (Object)null) { return; } foreach (CardInfo currentCard in Player.data.currentCards) { if (Object.op_Implicit((Object)(object)currentCard)) { GrimdarkCard component = ((Component)currentCard).GetComponent<GrimdarkCard>(); if (component != null && HeroRules.TryGet(component.Ability, out var _) && !choices.Contains(component.Ability)) { choices.Add(component.Ability); } } } choices.Sort(); if (slot >= choices.Count) { slot = 0; } } internal void BlockPressed() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00bd: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0103: 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_022f: 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_023f: 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_024a: 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) if (!Acting || Frozen) { return; } if (point != Plugin.Point) { ResetState(); } Choices(); ReadBuild(); if (Object.op_Implicit((Object)(object)Player.data.input) && Player.data.input.direction.y > 0.65f && TryUltimate()) { return; } if (Active(out var rule) && (rule.Flight || rule.Power == Power.Fate)) { if (rule.Power == Power.Dive) { Vector2 val = Vector2.op_Implicit(((Component)this).transform.position) + Vector2.down * 6f; RaycastHit2D val2 = Combat.FindWall(Vector2.op_Implicit(((Component)this).transform.position), val); Move(Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val2)).collider) ? (((RaycastHit2D)(ref val2)).point + Vector2.up * 0.8f) : val); } if (rule.Power == Power.Fate) { Move(anchor); Heal(Mathf.Clamp(saveHealth - Player.data.health, 0f, Max * 0.28f)); } EndMode(finish: true); } else { if (choices.Count == 0) { return; } if (choices.Count > 1 && Object.op_Implicit((Object)(object)Player.data.input) && Player.data.input.direction.y < -0.65f) { slot = (slot + 1) % choices.Count; ShareChoice(); return; } Ability selected = Selected; if (!(Now < ready[(int)selected]) && !Active(out var _) && HeroRules.TryGet(selected, out var rule3) && Cast(selected, Improved(selected, rule3))) { ready[(int)selected] = Now + rule3.Cooldown; HeroVisuals.Emit(selected, Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)this).transform.position) + Aim, 1, 0.28f); } } } private void Update() { //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) //IL_01ab: 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_01bb: 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) if (point != Plugin.Point) { ResetState(); } if (Now >= buildSampleAt) { buildSampleAt = Now + 0.25f; Choices(); ReadBuild(); } if (!Acting) { if (active != Ability.Count || fields.Count > 0) { EndMode(finish: false); fields.Clear(); } if (buildHealth > 0f || appliedMovement != 1f) { ResetFormation(); } return; } if (Now >= sampleAt) { sampleAt = Now + 0.25f; history.Enqueue((Now, Vector2.op_Implicit(((Component)this).transform.position), Player.data.health)); while (history.Count > 16) { history.Dequeue(); } } UpdateFormation(); UpdateExpansion(); if (active != Ability.Count && (!Has(active) || Now >= ends)) { EndMode(Has(active)); } if (Active(out var rule) && rule.Power == Power.Forge && charges == 1 && Now >= nextTick) { charges = 0; ward = Mathf.Max(ward, Max * 0.16f); Reload(); HeroVisuals.Emit(active, Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)this).transform.position), 2, 0.5f); } TickFields(); } private void Mode(Ability id, HeroRule rule, float shield = 0f, int shots = 0, float movement = 1f, float size = 1f) { //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_0032: 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) active = id; activeRule = rule; ends = Now + rule.Duration; anchor = Vector2.op_Implicit(((Component)this).transform.position); direction = Aim; saveHealth = Player.data.health; ward = shield * Max; charges = shots; nextTick = Now + rule.Duration * 0.5f; movementFactor = movement; sizeFactor = size; CharacterStatModifiers stats = Player.data.stats; stats.movementSpeed *= movement; CharacterStatModifiers stats2 = Player.data.stats; stats2.sizeMultiplier *= size; if (size != 1f) { Player.data.stats.WasUpdated(); } int style = (rule.Flight ? 3 : (IsHidden(rule.Power) ? 4 : 2)); HeroVisuals.Attach(id, Player, style, rule.Duration); } private void DropBuffs() { if (Object.op_Implicit((Object)(object)Player) && Object.op_Implicit((Object)(object)Player.data) && Object.op_Implicit((Object)(object)Player.data.stats)) { CharacterStatModifiers stats = Player.data.stats; stats.movementSpeed /= movementFactor; CharacterStatModifiers stats2 = Player.data.stats; stats2.sizeMultiplier /= sizeFactor; if (sizeFactor != 1f) { Player.data.stats.WasUpdated(); } } movementFactor = (sizeFactor = 1f); } private void EndMode(bool finish) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Ability id = active; HeroRule heroRule = activeRule; activeRule = null; active = Ability.Count; ends = (ward = 0f); charges = 0; DropBuffs(); HeroVisuals.Detach(Player); if (finish && Acting && heroRule != null) { HeroRule heroRule2 = heroRule; if (heroRule2.Power == Power.Dive || heroRule2.Power == Power.Ascend || heroRule2.Power == Power.Implants) { Burst(id, Vector2.op_Implicit(((Component)this).transform.position), heroRule2.Range, heroRule2.Damage, 12f); } } } private static bool IsHidden(Power power) { if (power != Power.Veil && power != Power.Hunt && power != Power.ShadowFlight) { return power == Power.Ambush; } return true; } internal Vector2 Incoming(Vector2 damage, Player attacker, bool lethal) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) if (!Active(out var rule) || !Combat.Enemy(Player, attacker)) { return damage; } Ability ability = active; float num = ((Vector2)(ref damage)).magnitude; if (rule.Power == Power.Ascend) { num *= 0.65f; } if ((rule.Power == Power.Barrier || rule.Power == Power.Anchor) && Vector2.Distance(Vector2.op_Implicit(((Component)this).transform.position), anchor) <= rule.Range) { num *= 0.64f; } if (ward > 0f) { float num2 = Mathf.Min(ward, num); num -= num2; ward -= num2; if (rule.Power == Power.Counter && charges > 0 && !Combat.Secondary) { charges = 0; Combat.Bonus(Player, attacker, rule.Damage, ability, 10f); HeroVisuals.Emit(ability, Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)attacker).transform.position), 1, 0.3f); } } if (rule.Power == Power.MindWard && charges > 0 && !Combat.Secondary) { charges--; Combat.Bonus(Player, attacker, Mathf.Min(18f, num * 0.35f), ability); num *= 0.58f; } if (lethal && num > Player.data.health && charges > 0 && !revivedThisPoint && (rule.Power == Power.Return || rule.Power == Power.Grace)) { charges = 0; revivedThisPoint = true; CharacterStatModifiers stats = Player.data.stats; stats.remainingRespawns++; if (rule.Power == Power.Return) { Combat.Bonus(Player, attacker, rule.Damage, ability, 8f); } else { Burst(ability, Vector2.op_Implicit(((Component)this).transform.position), rule.Range, rule.Damage, 6f); } HeroVisuals.Emit(ability, Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)this).transform.position), 2, 0.6f); } return ((Vector2)(ref damage)).normalized * num; } internal float Resistance() { float num = 1f; if (!Object.op_Implicit((Object)(object)Player) || (Object)(object)Player.data == (Object)null) { return num; } foreach (CardInfo currentCard in Player.data.currentCards) { if (!Object.op_Implicit((Object)(object)currentCard)) { continue; } GrimdarkCard component = ((Component)currentCard).GetComponent<GrimdarkCard>(); if (component == null) { continue; } CardBuff[] array = HeroRules.Buffs(component.Ability); for (int i = 0; i < array.Length; i++) { CardBuff cardBuff = array[i]; if (cardBuff.Kind == 'n') { num *= 1f - cardBuff.Amount / 100f; } } } if (Active(out var rule) && (rule.Power == Power.Berserk || rule.Power == Power.Implants)) { num *= 0.58f; } return Mathf.Max(0.2f, num); } internal void Stasis(float slowSeconds, float freezeSeconds, float delay) { //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_0068: Unknown result type (might be due to invalid IL or missing references) if (Acting) { if (point != Plugin.Point) { ResetState(); } slowed = Mathf.Max(slowed, Now + slowSeconds); if (freezeSeconds > 0f) { frozen = Mathf.Max(frozen, Now + freezeSeconds); frozenAt = Vector2.op_Implicit(((Component)this).transform.position); } } } internal void Drive(ref Vector2 velocity) { //IL_0047: 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_0057: 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_002a: 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_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_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_00cb: 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_00db: 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_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_00f1: 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_00f3: 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_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) //IL_010d: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_012e: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0144: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: 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) if (!Acting) { return; } if (Frozen) { if (!locked) { frozenAt = Vector2.op_Implicit(((Component)this).transform.position); locked = true; } Player.data.playerVel.position = frozenAt; velocity = Vector2.zero; return; } if (Flying && Object.op_Implicit((Object)(object)Player.data.input)) { Vector2 val = Vector2.op_Implicit(Player.data.input.direction); if (Player.data.input.jumpIsPressed) { val.y = Mathf.Max(val.y, 0.95f); } Vector2 val2 = Vector2.ClampMagnitude(val, 1f) * 9.5f; Vector2 val3 = Vector2.op_Implicit(((Component)this).transform.position); Vector2 val4 = val3 + Vector2.right * val2.x * Time.fixedDeltaTime; Vector2 val5 = val3 + Vector2.up * val2.y * Time.fixedDeltaTime; RaycastHit2D val6; if (val2.x != 0f) { val6 = Combat.FindWall(val3, val4 + Vector2.right * Mathf.Sign(val2.x) * 0.38f); if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val6)).collider)) { val2.x = 0f; } } if (val2.y != 0f) { val6 = Combat.FindWall(val3, val5 + Vector2.up * Mathf.Sign(val2.y) * 0.46f); if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val6)).collider)) { val2.y = 0f; } } velocity = val2 * FormationMove; } if (Now < slowed || Afflicted(Affliction.Slow)) { velocity *= 0.62f; } } internal void SuccessfulShot() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0139: 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_0144: 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_0153: Unknown result type (might be due to invalid IL or missing references) if (!Acting || !Active(out var rule)) { return; } Ability ability = active; if (IsHidden(rule.Power)) { EndMode(finish: false); if (rule.Power == Power.ShadowFlight) { Burst(ability, anchor, rule.Range, rule.Damage, 7f); } if (rule.Power == Power.Hunt || rule.Power == Power.Ambush) { Player val = Nearest(Vector2.op_Implicit(((Component)this).transform.position), rule.Range); if (Object.op_Implicit((Object)(object)val)) { Combat.Bonus(Player, val, rule.Damage, ability, 7f); Combat.ApplyStasis(Player, val, ability, 1f, 0f); } } } if (charges > 0) { if (rule.Power == Power.Combo) { charges--; Beam(ability, Vector2.op_Implicit(((Component)this).transform.position), Aim, rule.Range, 0.9f, rule.Damage, 6f); } if (rule.Power == Power.Rush) { charges--; Move(Vector2.op_Implicit(((Component)this).transform.position) + Aim * 1.2f); } if (rule.Power == Power.Tactics) { charges--; } } } internal float ShotMultiplier() { if (!Active(out var rule)) { return 1f; } if (rule.Power == Power.Veil) { return 1.5f; } if (rule.Power == Power.Tactics && charges > 0) { return 1.22f; } return GunDamage; } private void Reload() { Gun val = Player.data.weaponHandler?.gun; if (Object.op_Implicit((Object)(object)val)) { GunAmmo componentInChildren = ((Component)val).GetComponentInChildren<GunAmmo>(); if (componentInChildren != null) { componentInChildren.ReloadAmmo(true); } } } private void Heal(float amount) { if (amount > 0f && Acting) { Player.data.healthHandler.Heal(Mathf.Min(amount, Mathf.Max(0f, Max - Player.data.health))); } } private Player Nearest(Vector2 position, float radius) { //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_0014: Unknown result type (might be due to invalid IL or missing references) return Combat.Nearby(Player, position, radius).OrderBy(delegate(Player p) { //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_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_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)p).transform.position - Vector2.op_Implicit(position); return ((Vector3)(ref val)).sqrMagnitude; }).FirstOrDefault(); } private Vector2 ForwardPoint(Vector2 origin, Vector2 axis, float distance) { //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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) RaycastHit2D val = Combat.FindWall(origin, origin + axis * distance); if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val)).collider)) { return origin + axis * distance; } return ((RaycastHit2D)(ref val)).point - axis * 0.55f; } private bool Move(Vector2 destination) { //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_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_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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_0062: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); Vector2 val2 = destination - val; Vector2 normalized = ((Vector2)(ref val2)).normalized; if (normalized == Vector2.zero) { return false; } for (int i = -1; i <= 1; i++) { Vector2 val3 = Vector2.Perpendicular(normalized) * (float)i * 0.35f; RaycastHit2D val4 = Combat.FindWall(val + val3, destination + val3 + 0.36f * normalized); if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val4)).collider)) { return false; } } Player.data.playerVel.position = destination; return true; } private bool Cast(Ability id, HeroRule rule) { //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_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_0019: 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_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_00f9: 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_0144: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_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_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: 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_0325: 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_033a: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_036f: 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_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: 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_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_042f: 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_043b: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052a: 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_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0591: 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_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0722: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: 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_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)this).transform.position); Vector2 aim = Aim; Vector2 val2 = ForwardPoint(val, aim, (rule.Power == Power.Artillery) ? 9f : 4f); switch (rule.Power) { case Power.Beam: Beam(id, val, aim, rule.Range, 0.75f, rule.Damage, 13f); break; case Power.Slash: Beam(id, val, aim, rule.Range, 1.6f, rule.Damage, 12f); break; case Power.Trap: Zone(id, rule, val2, aim, 0.12f, 48); break; case Power.Rewind: { (float, Vector2, float) tuple = (from x in history where Now - x.Time >= 1.5f && Now - x.Time <= 3.3f orderby Mathf.Abs(Now - x.Time - 2f) select x).FirstOrDefault(); if (tuple.Item1 == 0f) { return false; } bool num = Move(tuple.Item2); float num2 = Mathf.Min(Max * 0.3f, tuple.Item3 - Player.data.health); Heal(num2); if (!num && num2 <= 0f) { return false; } HeroVisuals.Emit(id, val, Vector2.op_Implicit(((Component)this).transform.position), 1, 0.45f); break; } case Power.Roar: Mode(id, rule, 0f, 0, 1.1f, 1.24f); Burst(id, val, rule.Range, rule.Damage, 14f); break; case Power.Tactics: Mode(id, rule, 0.22f, 3); Reload(); break; case Power.Veil: Move(val2); Mode(id, rule, 0f, 0, 1.15f); break; case Power.Flight: case Power.ShadowFlight: case Power.Dive: Mode(id, rule); break; case Power.Ascend: Mode(id, rule, 0.15f); break; case Power.Orb: case Power.Infect: HeroMissile.Launch(Player, id, rule, val, aim, null); break; case Power.Berserk: Mode(id, rule, 0f, 0, 1.32f, 1.31f); break; case Power.Gas: Zone(id, rule, val, aim, 0.7f, 10); break; case Power.Hunt: Mode(id, rule, 0f, 0, 1.24f); break; case Power.Flame: Zone(id, rule, val2, aim, 0.75f, 6); break; case Power.Twin: Beam(id, val, aim, rule.Range, 0.65f, rule.Damage, 11f); Zone(id, rule, val, aim, 0.42f, 1); break; case Power.Escape: Move(ForwardPoint(val, -aim, rule.Range)); Mode(id, rule, 0.25f, 0, 1.18f); HeroVisuals.Emit(id, val, val + Vector2.up * 0.1f, 2, 1.8f); break; case Power.Forge: Mode(id, rule, 0.16f, 1); Reload(); break; case Power.Storm: Zone(id, rule, val, aim, 1f, 4); break; case Power.Lattice: Mode(id, rule, 0.22f); Zone(id, rule, val2, aim, 1.3f, 3); break; case Power.Duel: { Vector2 destination = ForwardPoint(val, aim, rule.Range); Move(destination); if (Beam(id, val, aim, rule.Range, 1.35f, rule.Damage, 9f) > 0) { Heal(Max * 0.12f); } break; } case Power.Anchor: Mode(id, rule, 0.12f); Zone(id, rule, val, aim, 1.1f, 4); break; case Power.Counter: Mode(id, rule, 0.27f, 1); break; case Power.Barrier: Mode(id, rule, 0.24f); Zone(id, rule, val, aim, 0.45f, 12); break; case Power.Cone: Zone(id, rule, val, aim, 0.75f, 4); break; case Power.Charge: { Move(ForwardPoint(val, aim, rule.Range)); Beam(id, val, aim, rule.Range, 1.22f, rule.Damage, 13f); Player val3 = Nearest(Vector2.op_Implicit(((Component)this).transform.position), 2.9f); if (Object.op_Implicit((Object)(object)val3)) { Combat.ApplyStasis(Player, val3, id, 0.85f, 0.28f); } break; } case Power.Artillery: Zone(id, rule, val2, aim, 0.95f, 3); break; case Power.Rush: Mode(id, rule, 0f, 3, 1.33f); break; case Power.Rift: Zone(id, rule, val2, aim, 0.65f, 8); break; case Power.Fan: { for (int i = -1; i <= 1; i++) { HeroMissile.Launch(Player, id, rule, val, Vector2.op_Implicit(Quaternion.Euler(0f, 0f, (float)i * 13f) * Vector2.op_Implicit(aim)), null); } break; } case Power.Return: case Power.Grace: Mode(id, rule, 0f, 1); break; case Power.Combo: Mode(id, rule, 0f, 4); break; case Power.Vortex: Zone(id, rule, val2, aim, 0.9f, 4); break; case Power.MindWard: Mode(id, rule, 0f, 2); break; case Power.Fate: Mode(id, rule); break; case Power.Surgery: Zone(id, rule, val, aim, 0.8f, 5); break; case Power.Implants: Mode(id, rule, 0f, 0, 1.15f); break; case Power.Ambush: Mode(id, rule, 0f, 0, 1.25f); break; case Power.Drones: Mode(id, rule, 0.16f); Zone(id, rule, val, aim, 1.1f, 5); break; case Power.Hive: Zone(id, rule, val, aim, 1.45f, 3); break; default: return false; } return true; } internal void PoisonZone(Ability id, Vector2 spot, float damage, float radius, float duration) { //IL_0028: 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) HeroRule rule = new HeroRule { Duration = duration, Range = radius, Damage = damage, Power = Power.Gas }; Zone(id, rule, spot, Vector2.right, 0.65f, Mathf.CeilToInt(duration / 0.65f)); } internal void MissileImpact(Ability id, HeroRule rule, Vector2 spot, Player hit) { //IL_004d: 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_0017: 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_00a5: 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) if (rule.Power == Power.Infect && Object.op_Implicit((Object)(object)hit)) { HeroField value = Zone(id, rule, spot, Vector2.right, 0.66f, 8); value.Target = hit; fields[fields.Count - 1] = value; return; } Burst(id, spot, rule.Range, rule.Damage, (rule.Power == Power.Orb) ? 14f : 5f); if (rule.Power == Power.Orb) { PoisonZone(id, spot, 5f, 2.4f, 3f); } if (rule.Power != Power.Fan) { return; } foreach (Player item in Combat.Nearby(Player, spot, rule.Range)) { Combat.Pull(Player, item, spot, 9f); } } private HeroField Zone(Ability id, HeroRule rule, Vector2 where, Vector2 aim, float interval, int pulses) { //IL_003a: 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_0042: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d1: Unknown result type (might be due to invalid IL or missing references) if (fields.Count == 12) { fields.RemoveAt(0); } HeroField heroField = new HeroField { Ability = id, Power = rule.Power, Position = where, Axis = aim, Born = Now, Expires = Now + rule.Duration, Next = Now + interval, Radius = rule.Range, Damage = rule.Damage, Interval = interval, Pulses = pulses }; fields.Add(heroField); if (rule.Power != Power.Twin) { HeroVisuals.Emit(id, where, where + Vector2.right * rule.Range, (rule.Power == Power.Gas) ? 5 : 2, rule.Duration); } return heroField; } private void TickFields() { for (int num = fields.Count - 1; num >= 0; num--) { HeroField heroField = fields[num]; if (Now > heroField.Expires || !Has(heroField.Ability) || heroField.Pulses <= 0) { fields.RemoveAt(num); } else if (!(Now < heroField.Next)) { heroField.Next = Now + heroField.Interval; heroField.Pulses--; if (FieldTick(heroField) || heroField.Pulses == 0) { fields.RemoveAt(num); } else { fields[num] = heroField; } } } } private bool FieldTick(HeroField f) { //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_0068: 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_003a: 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_0542: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: 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_01f5: 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_0204: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_058c: 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_022e: 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_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: 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_0392: Unknown result type (might be due to invalid IL or missing references) //IL_048f: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_0266: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: 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_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) Ability ability = f.Ability; Vector2 center = (Object.op_Implicit((Object)(object)f.Target) ? Vector2.op_Implicit(((Component)f.Target).transform.position) : ((f.Power == Power.Drones || f.Power == Power.Hive || f.Power == Power.Storm) ? Vector2.op_Implicit(((Component)this).transform.position) : f.Position)); float num = Mathf.Clamp01((Now - f.Born) / (f.Expires - f.Born)); float num2 = ((f.Power == Power.Gas) ? (f.Radius * Mathf.Lerp(0.28f, 1f, Mathf.Clamp01(num * 2.7f))) : f.Radius); switch (f.Power) { case Power.Trap: { Player val4 = Nearest(center, num2); if (!Object.op_Implicit((Object)(object)val4)) { return false; } Combat.ApplyStasis(Player, val4, ability, f.Damage + 0.8f, f.Damage); return true; } case Power.Twin: Beam(ability, center, f.Axis, num2, 0.78f, f.Damage, 11f); return true; case Power.Cone: Beam(ability, center, f.Axis, num2, 1.9f, f.Damage, 4f); break; case Power.Flame: Beam(ability, center - f.Axis * 3f, f.Axis, num2, 1.15f, f.Damage, 4f); break; case Power.Lattice: Burst(ability, center, num2 * (0.5f + num * 0.65f), f.Damage, 7f); break; case Power.Artillery: Burst(ability, center + Vector2.Perpendicular(f.Axis) * ((float)(f.Pulses - 1) * 1.1f), num2, f.Damage, 10f); break; case Power.Storm: foreach (Player item in Combat.Nearby(Player, center, num2).OrderBy(delegate(Player p) { //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_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_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val5 = ((Component)p).transform.position - Vector2.op_Implicit(center); return ((Vector3)(ref val5)).sqrMagnitude; }).Take(3)) { Combat.Bonus(Player, item, f.Damage, ability); Visuals.Lightning(ability, center, Vector2.op_Implicit(((Component)item).transform.position)); } break; case Power.Drones: { Player val3 = Nearest(center, num2); if (Object.op_Implicit((Object)(object)val3)) { Combat.Bonus(Player, val3, f.Damage, ability); HeroVisuals.Emit(ability, center + Vector2.up, Vector2.op_Implicit(((Component)val3).transform.position), 1, 0.2f); } break; } case Power.Hive: { Player val = Nearest(center, num2); if (Object.op_Implicit((Object)(object)val) && HeroRules.TryGet(ability, out var rule)) { HeroMissile.Launch(Player, ability, rule, center, Vector2.op_Implicit(((Component)val).transform.position - ((Component)this).transform.position), val); } break; } case Power.Rift: case Power.Vortex: foreach (Player item2 in Combat.Nearby(Player, center, num2)) { Combat.Pull(Player, item2, center, 11f); } if (f.Power == Power.Rift || f.Pulses == 0) { Burst(ability, center, num2, f.Damage, (f.Power != Power.Rift) ? 11 : 0); } break; case Power.Barrier: foreach (Player item3 in Combat.Nearby(Player, center, num2)) { Combat.Pull(Player, item3, center, -7f); } break; case Power.Surgery: { Vector2 val2 = Vector2.op_Implicit(((Component)this).transform.position) - center; if (((Vector2)(ref val2)).sqrMagnitude <= num2 * num2) { Heal(Max * 0.045f); } Burst(ability, center, num2, f.Damage, 0f, periodic: true); break; } case Power.Infect: if (num2 > 0f) { Burst(ability, center, num2, f.Damage, 0f, periodic: true); } else if (Combat.Alive(f.Target)) { Combat.Bonus(Player, f.Target, f.Damage, ability, 0f, periodic: true); } break; default: Burst(ability, center, num2, f.Damage, 0f, periodic: true); break; } return false; } private int Beam(Ability id, Vector2 start, Vector2 aim, float range, float width, float damage, float push) { //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_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) //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_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_0076: 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_0092: 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_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_00a1: Unknown result type (might be due to invalid IL or missing references) Vector2 val = ForwardPoint(start, aim, range); List<Player> list = new List<Player>(); if (Object.op_Implicit((Object)(object)PlayerManager.instance)) { foreach (Player player in PlayerManager.instance.players) { if (!Combat.Enemy(Player, player) || !Combat.Alive(player) || !Combat.Visible(start, player)) { continue; } Vector2 val2 = Vector2.op_Implicit(((Component)player).transform.position) - start; float num = Vector2.Dot(val2, aim); if (!(num < 0f) && !(num > Vector2.Distance(start, val))) { Vector2 val3 = val2 - num * aim; if (!(((Vector2)(ref val3)).sqrMagnitude > width * width)) { list.Add(player); } } } } foreach (Player item in list.Take(8)) { Combat.Bonus(Player, item, damage, id, push); } HeroVisuals.Emit(id, start, val, 1, 0.32f); return list.Count; } private void Burst(Ability id, Vector2 center, float radius, float damage, float push, bool periodic = false) { //IL_000f: 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_0055: 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_005c: 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) if (radius <= 0f) { return; } foreach (Player item in Combat.Nearby(Player, center, radius).Take(8)) { Combat.Bonus(Player, item, damage, id, push, periodic); } HeroVisuals.Emit(id, center, center + Vector2.right * radius, periodic ? 5 : 2, periodic ? 0.55f : 0.4f); } internal bool CountScrapShot() { return ++scrapShots % 4 == 0; } private void ShareChoice() { sharedChoice = Selected; if (PhotonNetwork.InRoom && !PhotonNetwork.OfflineMode) { NetworkingManager.RPC_Others(typeof(CombatState), "ApplyChoice", new object[3] { Plugin.Point, Player.data.view.ViewID, (int)sharedChoice }); } } [UnboundRPC] private static void ApplyChoice(int point, int source, int ability) { if (!Combat.Active || Plugin.Point != point || !HeroRules.TryGet((Ability)ability, out var _)) { return; } Player player = Combat.Find(source); if (Combat.Alive(player) && !Combat.Owns(player)) { CombatState combatState = Combat.Attach(player); if (combatState.point != point) { combatState.ResetState(); } if (combatState.Has((Ability)ability)) { combatState.sharedChoice = (Ability)ability; } } } internal void FollowUp(Ability id, Player target, float damage, int hits) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) HeroRule rule = new HeroRule { Duration = (float)hits * 0.35f + 0.15f, Range = 0f, Damage = damage, Power = Power.Infect }; HeroField value = Zone(id, rule, Vector2.op_Implicit(((Component)target).transform.position), Vector2.zero, 0.33f, hits); value.Target = target; fields[fields.Count - 1] = value; } } internal readonly struct Formation { internal readonly string Ru; internal readonly string En; internal readonly float Hp; internal readonly float Damage; internal readonly float Rate; internal readonly float Speed; internal readonly float Regen; internal readonly float Second; internal string Name => Localization.Text(Ru, En); internal Formation(string ru, string en, float hp, float damage, float rate, float speed, float regen, float second) { Ru = ru; En = en; Hp = hp; Damage = damage; Rate = rate; Speed = speed; Regen = regen; Second = second; } } internal static class Progression { internal static readonly Formation[] Factions = new Formation[10] { new Formation("Космодесант", "Space Marines", 0.08f, 0.04f, 0f, 0f, 0f, 0.1f), new Formation("Хаос", "Chaos", 0f, 0.1f, 0f, 0f, 0f, 0.16f), new Formation("Орки", "Orks", 0f, 0.06f, 0.08f, 0f, 0f, 0.14f), new Formation("Некроны", "Necrons", 0.12f, 0f, 0f, 0f, 1.5f, 0.15f), new Formation("Тираниды", "Tyranids", 0.06f, 0f, 0f, 0.08f, 0f, 0.12f), new Formation("Астра Милитарум", "Astra Militarum", 0f, 0.06f, 0.07f, 0f, 0f, 0.1f), new Formation("Эльдары", "Aeldari", 0f, 0f, 0f, 0.13f, 0f, 0.12f), new Formation("Тау", "T'au", 0f, 0.07f, 0.05f, 0f, 0f, 0.14f), new Formation("Адептус Механикус", "Adeptus Mechanicus", 0f, 0f, 0.1f, 0f, 0.8f, 0.12f), new Formation("Адепта Сороритас", "Adepta Sororitas", 0.09f, 0f, 0f, 0f, 1f, 0.12f) }; internal static readonly HashSet<Ability> Evolves = new HashSet<Ability> { Ability.Bolter, Ability.TerminatorArmor, Ability.Necrodermis, Ability.Dakka, Ability.Plasma, Ability.ShurikenCatapult, Ability.PulseCarbine, Ability.ArcRifle, Ability.SacredFlamer, Ability.Chitin, Ability.Warp, Ability.Sanguinius, Ability.Magnus, Ability.Mortarion, Ability.Ghazghkull, Ability.Imotekh, Ability.SilentKing, Ability.Farsight, Ability.Eldrad, Ability.Cawl, Ability.Celestine, Ability.Yarrick }; internal static readonly (Ability A, Ability B, string Ru, string En)[] Pairs = new(Ability, Ability, string, string)[6] { (Ability.Sanguinius, Ability.Dante, "Крылья Баала", "Wings of Baal"), (Ability.Magnus, Ability.Ahriman, "Архив Просперо", "Prospero Archive"), (Ability.Mortarion, Ability.Typhus, "Завет чумы", "Plague Covenant"), (Ability.Ghazghkull, Ability.Grotsnik, "Орочья сварка", "Ork Engineering"), (Ability.Trazyn, Ability.Imotekh, "Династический архив", "Dynastic Archive"), (Ability.Yarrick, Ability.Guilliman, "Оборона Империума", "Imperial Defence") }; internal static string Title(Ability id) { CardSpec cardSpec = Cards.Specs[(int)id]; return Localization.Text(cardSpec.RussianTitle ?? Localization.Legacy[(int)id].Title, cardSpec.Title); } internal static int Faction(Ability id) { return Cards.Specs[(int)id].Faction; } internal static string Explain(int faction) { Formation formation = Factions[faction]; List<string> list = new List<string>(); float hp; if (formation.Hp > 0f) { string stat = new CardBuff("h", formation.Hp * 100f).Display().stat; hp = formation.Hp; list.Add(stat + " " + hp.ToString("+0%")); } if (formation.Damage > 0f) { string stat2 = new CardBuff("d", formation.Damage * 100f).Display().stat; hp = formation.Damage; list.Add(stat2 + " " + hp.ToString("+0%")); } if (formation.Rate > 0f) { string stat3 = new CardBuff("f", formation.Rate * 100f).Display().stat; hp = formation.Rate; list.Add(stat3 + " " + hp.ToString("+0%")); } if (formation.Speed > 0f) { string stat4 = new CardBuff("m", formation.Speed * 100f).Display().stat; hp = formation.Speed; list.Add(stat4 + " " + hp.ToString("+0%")); } if (formation.Regen > 0f) { hp = formation.Regen; list.Add("+" + hp.ToString("0.#") + Localization.Text(" ОЗ/с", " HP/s")); } string[] obj = new string[5] { "3: ", string.Join(", ", list), "\n5: ", Localization.Text("урон и толчок способностей и особых снарядов ", "ability and special ammo damage and force "), null }; hp = formation.Second; obj[4] = hp.ToString("+0%"); return string.Concat(obj); } } internal static class Visuals { private static readonly Dictionary<int, Texture2D> atlases = new Dictionary<int, Texture2D>(); private static readonly Dictionary<int, Sprite> frames = new Dictionary<int, Sprite>(); private static readonly Color[] tierColors = (Color[])(object)new Color[6] { new Color(0.69f, 0.72f, 0.75f), new Color(0.78f, 0.52f, 0.29f), new Color(0.35f, 0.66f, 1f), new Color(0.75f, 0.42f, 1f), new Color(1f, 0.75f, 0.32f), new Color(1f, 0.76f, 0.92f) }; private static readonly string[] tierRu = new string[6] { "Обычная", "Необычная", "Редкая", "Эпическая", "Легендарная", "Мифическая" }; private static readonly string[] tierEn = new string[6] { "Common", "Uncommon", "Rare", "Epic", "Legendary", "Mythic" }; private static readonly string[] factionsEn = new string[10] { "Space Marines", "Chaos", "Orks", "Necrons", "Tyranids", "Astra Militarum", "Aeldari", "T’au", "Adeptus Mechanicus", "Adepta Sororitas" }; private static readonly Dictionary<Ability, Sprite> gallery = new Dictionary<Ability, Sprite>(); private static readonly Dictionary<Ability, GameObject> icons = new Dictionary<Ability, GameObject>(); private static readonly Dictionary<Ability, Sprite> sprites = new Dictionary<Ability, Sprite>(); private static readonly List<Object> resources = new List<Object>(); private static Material material; private static AudioClip[] accents; private static GameObject storage; private static int frame = -1; private static int spawned; internal static Color TierColor(Tier tier) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return tierColors[(int)tier]; } private static Sprite ReadArt(Ability ability) { //IL_0132: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown int num = (int)ability / 20; if (!atlases.TryGetValue(num, out var value)) { using Stream stream = typeof(Visuals).Assembly.GetManifestResourceStream($"Grimdark.Art.atlas{num}.png"); if (stream == null) { return null; } using (MemoryStream memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); value = new Texture2D(2, 2, (TextureFormat)4, false); if (!ImageConversion.LoadImage(value, memoryStream.ToArray(), true)) { Object.Destroy((Object)(object)value); return null; } } ((Object)value).name = $"Grimdark artwork page {num}"; ((Texture)value).wrapMode = (TextureWrapMode)1; ((Texture)value).filterMode = (FilterMode)1; atlases.Add(num, value); resources.Add((Object)(object)value); } int num2 = (int)ability % 20; float num3 = (float)((Texture)value).width / 4f; float num4 = (float)((Texture)value).height / 5f; float num5 = (float)(num2 % 4) * num3; float num6 = (float)(4 - num2 / 4) * num4; return Sprite.Create(value, new Rect(num5 + 2f, num6 + 2f, num3 - 4f, num4 - 4f), new Vector2(0.5f, 0.5f), num3); } internal static void DrawCollectionArt(Rect rect, Ability id) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //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_005a: 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) if ((int)Event.current.type != 7) { return; } if (!gallery.TryGetValue(id, out var value) || !Object.op_Implicit((Object)(object)value)) { value = ReadArt(id); if (!Object.op_Implicit((Object)(object)value)) { return; } gallery[id] = value; resources.Add((Object)(object)value); } Texture2D texture = value.texture; Rect textureRect = value.textureRect; GUI.DrawTextureWithTexCoords(rect, (Texture)(object)texture, new Rect(((Rect)(ref textureRect)).x / (float)((Texture)texture).width, ((Rect)(ref textureRect)).y / (float)((Texture)texture).height, ((Rect)(ref textureRect)).width / (float)((Texture)texture).width, ((Rect)(ref textureRect)).height / (float)((Texture)texture).height)); } private static void ApplyArtwork(GameObject icon, Image image, Ability ability, Sprite art) { //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_001e: 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_0033: 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_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_004b: 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_0094: 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) CardSpec cardSpec = Cards.Specs[(int)ability]; RectTransform val = (RectTransform)icon.transform; val.anchorMin = new Vector2(0.025f, 0.025f); val.anchorMax = new Vector2(0.975f, 0.975f); Vector2 offsetMin = (val.offsetMax = Vector2.zero); val.offsetMin = offsetMin; image.sprite = art; image.preserveAspect = false; ((Graphic)image).color = Color.white; Image val2 = Overlay(icon.transform, "Filigree"); val2.sprite = Frame(cardSpec.Faction, cardSpec.Tier); ((Graphic)val2).color = Color.white; string text = Localization.Text(Localization.Factions[cardSpec.Faction], factionsEn[cardSpec.Faction]); string text2 = Localization.Text(tierRu[(int)cardSpec.Tier], tierEn[(int)cardSpec.Tier]); Badge(icon.transform, text + " · " + text2, TierColor(cardSpec.Tier)); if (cardSpec.Tier >= Tier.Legendary) { ((Component)val2).gameObject.AddComponent<FrameShimmer>().Set(val2, cardSpec.Tier == Tier.Mythic); } } private static Image Overlay(Transform parent, string title) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0039: 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_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_004f: 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_0055: 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_005c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(title, new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent(parent, false); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; Vector2 offsetMin = (val2.offsetMax = Vector2.zero); val2.offsetMin = offsetMin; Image component = val.GetComponent<Image>(); ((Graphic)component).raycastTarget = false; return component; } private static void Badge(Transform parent, string value, Color color) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0022: 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_0055: 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_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_009c: 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_00b1: 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_00c6: 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_00cc: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) Image obj = Overlay(parent, "Faction and rarity"); RectTransform val = (RectTransform)((Component)obj).transform; val.anchorMin = new Vector2(0.05f, 0.025f); val.anchorMax = new Vector2(0.95f, 0.146f); ((Graphic)obj).color = new Color(0.015f, 0.02f, 0.028f, 0.94f); GameObject val2 = new GameObject("Faction label", new Type[2] { typeof(RectTransform), typeof(TextMeshProUGUI) }); RectTransform val3 = (RectTransform)val2.transform; ((Transform)val3).SetParent((Transform)(object)val, false); val3.anchorMin = new Vector2(0.015f, 0f); val3.anchorMax = new Vector2(0.985f, 1f); Vector2 offsetMin = (val3.offsetMax = Vector2.zero); val3.offsetMin = offsetMin; TextMeshProUGUI component = val2.GetComponent<TextMeshProUGUI>(); ((TMP_Text)component).text = value; ((Graphic)component).color = color; ((TMP_Text)component).alignment = (TextAlignmentOptions)514; ((TMP_Text)component).enableAutoSizing = true; ((TMP_Text)component).fontSizeMin = 8f; ((TMP_Text)component).fontSizeMax = 30f; ((TMP_Text)component).enableWordWrapping = false; ((Graphic)component).raycastTarget = false; } private static Sprite Frame(int faction, Tier rank) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //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_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_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: 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_00cf: 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_0101: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_012f: 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_013d: 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_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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) //IL_0275: Unknown result type (might be due to invalid IL or missing references) int key = (int)(faction * tierColors.Length + rank); if (frames.TryGetValue(key, out var value)) { return value; } Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); Color32[] array = (Color32[])(object)new Color32[16384]; Color val2 = tierColors[(int)rank]; Color val3 = Cards.Palette[faction]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { int num = Mathf.Min(j, 127 - j); int num2 = Mathf.Min(i, 127 - i); int num3 = Mathf.Min(num, num2); float num4 = 0.55f + 0.45f * Mathf.Sin((float)j * 1.71f + (float)i * 0.52f) * Mathf.Sin((float)i * 0.39f + (float)j * 0.42f); Color val4 = Color.clear; if (num3 == 0) { ((Color)(ref val4))..ctor(0.04f, 0.03f, 0.025f, 1f); } if (num3 == 1 || num3 == 4) { val4 = Color.Lerp(val2 * 0.35f, val2, num4); } if (num3 == 2 || num3 == 3) { val4 = Color.Lerp(new Color(0.04f, 0.035f, 0.05f), val3 * 0.6f, num4); } if (num3 >= 5 && num3 < 10) { ((Color)(ref val4))..ctor(0.02f, 0.015f, 0.026f, (10f - (float)num3) * 0.095f); } if (num + num2 < 34 && num < 23 && num2 < 23) { float num5 = Mathf.Sqrt((float)((num - 1) * (num - 1) + (num2 - 1) * (num2 - 1))); float num6 = Mathf.Atan2((float)num2, (float)num); bool num7 = Mathf.Abs(num5 - 19f) < 1f || Mathf.Abs(num5 - 23f) < 0.8f; int num8; if (num + num2 < 23) { switch (faction) { default: num8 = ((Mathf.Sin(num6 * (float)(7 + faction % 5) + num5 * 0.46f) > 0.76f) ? 1 : 0); break; case 3: case 7: num8 = (((num % 6 == 2 && num2 % 3 != 0) || (num2 % 6 == 2 && num % 3 != 0)) ? 1 : 0); break; case 2: num8 = (((num + 2 * num2) % 8 < 2) ? 1 : 0); break; } } else { num8 = 0; } bool flag = (byte)num8 != 0; if (num7 || flag) { val4 = Color.Lerp(val3, val2, ((rank >= Tier.Legendary) ? 0.68f : 0.42f) + num4 * 0.2f); } } val4.a = Mathf.Clamp01(val4.a); array[i * 128 + j] = Color32.op_Implicit(val4); } } val.SetPixels32(array); val.Apply(false, true); Sprite val5 = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f)); resources.Add((Object)(object)val); resources.Add((Object)(object)val5); frames.Add(key, val5); return val5; } internal static void Lightning(Ability ability, Vector2 start, Vector2 end) { //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_0036: 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) Bolt((int)ability, start, end); if (PhotonNetwork.InRoom && !PhotonNetwork.OfflineMode) { NetworkingManager.RPC_Others(typeof(Visuals), "Bolt", new object[3] { (int)ability, start, end }); } } [UnboundRPC] private static void Bolt(int ability, Vector2 start, Vector2 end) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_00b6: 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_00d3: 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_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_00de: 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_00e8: 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_0055: Expected O, but got Unknown //IL_00fd: 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_0101: 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_0114: 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_0130: 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 ref