using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: IgnoresAccessChecksTo("assembly_guiutils")] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: AssemblyCompany("Norns")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c72d205cdc20a34c85d34434e7954e2625ec15d2")] [assembly: AssemblyProduct("Norns")] [assembly: AssemblyTitle("Norns")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Norns { public sealed class ArcLightningVfxController : MonoBehaviour { private const int PointCount = 19; private const float RevealDuration = 0.065f; private const float HoldDuration = 0.145f; private const float FadeDuration = 0.16f; private const float RepathInterval = 0.032f; public LineRenderer OuterGlow; public LineRenderer MainChannel; public LineRenderer WhiteCore; public LineRenderer[] Branches; public Transform SourceGroup; public Transform TargetGroup; public Transform ResidualGroup; public Light ImpactLight; private readonly Vector3[] _points = (Vector3[])(object)new Vector3[19]; private Vector3[][] _branchPoints; private ParticleSystem[] _sourceParticles; private ParticleSystem[] _targetParticles; private ParticleSystem[] _residualParticles; private Vector3 _from; private Vector3 _to; private Vector3 _direction; private Vector3 _side; private Vector3 _up; private float _length; private float _delay; private float _startedAt; private float _nextRepathAt; private int _seed; private int _repath; private bool _initialized; private bool _sourcePlayed; private bool _impactPlayed; private void OnEnable() { _sourceParticles = ParticlesUnder(SourceGroup); _targetParticles = ParticlesUnder(TargetGroup); _residualParticles = ParticlesUnder(ResidualGroup); StopAndClear(_sourceParticles); StopAndClear(_targetParticles); StopAndClear(_residualParticles); SetLineVisible(OuterGlow, visible: false); SetLineVisible(MainChannel, visible: false); SetLineVisible(WhiteCore, visible: false); if (Branches != null) { LineRenderer[] branches = Branches; for (int i = 0; i < branches.Length; i++) { SetLineVisible(branches[i], visible: false); } } if ((Object)(object)ImpactLight != (Object)null) { ImpactLight.intensity = 0f; } _startedAt = Time.time; _initialized = false; _sourcePlayed = false; _impactPlayed = false; } public unsafe void Initialize(Vector3 from, Vector3 to, float delay, int chainIndex) { //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_0008: 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_000f: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) _from = from; _to = to; Vector3 val = to - from; _length = ((Vector3)(ref val)).magnitude; if (_length < 0.05f) { val = Vector3.forward * 0.05f; } _direction = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(_direction, Vector3.up); _side = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref _side)).sqrMagnitude < 0.01f) { val2 = Vector3.Cross(_direction, Vector3.right); _side = ((Vector3)(ref val2)).normalized; } val2 = Vector3.Cross(_side, _direction); _up = ((Vector3)(ref val2)).normalized; _delay = Mathf.Max(0f, delay); _seed = ((object)(*(Vector3*)(&from))/*cast due to .constrained prefix*/).GetHashCode() ^ (((object)(*(Vector3*)(&to))/*cast due to .constrained prefix*/).GetHashCode() * 397) ^ (chainIndex * 7919); _repath = 0; _nextRepathAt = 0f; _startedAt = Time.time; _initialized = true; _sourcePlayed = false; _impactPlayed = false; if ((Object)(object)SourceGroup != (Object)null) { SourceGroup.position = from; } if ((Object)(object)TargetGroup != (Object)null) { TargetGroup.position = to; } if ((Object)(object)ResidualGroup != (Object)null) { ResidualGroup.position = to; } if ((Object)(object)ImpactLight != (Object)null) { ((Component)ImpactLight).transform.position = to; } int num = ((Branches != null) ? Branches.Length : 0); _branchPoints = new Vector3[num][]; for (int i = 0; i < num; i++) { _branchPoints[i] = (Vector3[])(object)new Vector3[4]; } } private void Update() { if (!_initialized) { if (Time.time - _startedAt > 0.25f) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } float num = Time.time - _startedAt - _delay; if (!(num < 0f)) { float num2 = 0.21f; float num3 = num2 + 0.16f; if (!_sourcePlayed) { _sourcePlayed = true; Play(_sourceParticles); } if (num <= num2 && num >= _nextRepathAt) { RebuildPath(num); _nextRepathAt = num + 0.032f; } float reveal = Smooth01(num / 0.065f); float num4 = ((num <= num2) ? 1f : (1f - Smooth01((num - num2) / 0.16f))); float strobe = 0.88f + Mathf.Sin(num * 91f + (float)_seed * 0.001f) * 0.08f + Mathf.Sin(num * 143f + 1.7f) * 0.04f; DrawMainLines(reveal, num4, strobe); DrawBranches(reveal, num4); if (!_impactPlayed && num >= 0.053299997f) { PlayImpact(); } if ((Object)(object)ImpactLight != (Object)null) { float num5 = Mathf.Max(0f, num - 0.053299997f); float num6 = Mathf.Exp((0f - num5) * 18f) * 4.6f; float num7 = Mathf.Clamp01(1f - num5 / 0.24f) * 0.65f; ImpactLight.intensity = (_impactPlayed ? ((num6 + num7) * num4) : 0f); } if (num >= num3 + 0.34f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void RebuildPath(float localTime) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_00f5: 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_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_010c: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) _repath++; float num = Mathf.Clamp(_length * 0.075f, 0.18f, 0.86f); for (int i = 0; i < 19; i++) { float num2 = (float)i / 18f; float num3 = Mathf.Sin(num2 * (float)Math.PI); float num4 = Mathf.Sin(num2 * 16.2f + (float)_seed * 0.00031f + (float)_repath * 1.73f); float num5 = Mathf.Sin(num2 * 39.7f - (float)_seed * 0.00019f - (float)_repath * 2.31f); float num6 = Mathf.Sin(num2 * 27.1f + (float)_seed * 0.00047f + (float)_repath * 1.19f); float num7 = num4 * 0.68f + num5 * 0.32f; _points[i] = Vector3.Lerp(_from, _to, num2) + _side * num7 * num * num3 + _up * num6 * num * 0.58f * num3; } _points[0] = _from; _points[18] = _to; if (Branches != null) { for (int j = 0; j < Branches.Length; j++) { int num8 = Mathf.Clamp(3 + j * 2, 2, 16); Vector3 val = _points[num8]; float num9 = (((j & 1) == 0) ? 1f : (-1f)); float num10 = (float)_seed * 0.00023f + (float)j * 1.91f + (float)_repath * 0.74f; Vector3 val2 = _side * num9 * (0.72f + Mathf.Abs(Mathf.Sin(num10)) * 0.34f) + _up * Mathf.Sin(num10 * 1.37f) * 0.54f + _direction * (0.12f + (float)j * 0.025f); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num11 = Mathf.Clamp(_length * (0.1f + (float)j * 0.008f), 0.62f, 1.65f); Vector3[] obj = _branchPoints[j]; obj[0] = val; obj[1] = val + normalized * num11 * 0.34f + _up * Mathf.Sin(num10 + 0.8f) * 0.13f; obj[2] = val + normalized * num11 * 0.69f - _side * num9 * 0.12f; obj[3] = val + normalized * num11; } } } private void DrawMainLines(float reveal, float fade, float strobe) { //IL_0037: 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_0083: Unknown result type (might be due to invalid IL or missing references) int visible = Mathf.Clamp(Mathf.CeilToInt(reveal * 18f) + 1, 2, 19); DrawLine(OuterGlow, visible, new Color(0.16f, 0.42f, 1f, 0.24f * fade * strobe)); DrawLine(MainChannel, visible, new Color(0.28f, 0.76f, 1f, 0.82f * fade * strobe)); DrawLine(WhiteCore, visible, new Color(0.93f, 0.99f, 1f, fade)); } private void DrawLine(LineRenderer line, int visible, Color color) { //IL_0019: 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_0033: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)line == (Object)null)) { ((Renderer)line).enabled = true; line.positionCount = visible; line.startColor = color; line.endColor = color; for (int i = 0; i < visible; i++) { line.SetPosition(i, _points[i]); } } } private void DrawBranches(float reveal, float fade) { //IL_0095: 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_00c0: 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_00ce: 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) if (Branches == null) { return; } float num = fade * Smooth01((reveal - 0.26f) / 0.42f); Color val2 = default(Color); for (int i = 0; i < Branches.Length; i++) { LineRenderer val = Branches[i]; if (!((Object)(object)val == (Object)null)) { float num2 = 0.62f + Mathf.Sin((Time.time - _startedAt) * 107f + (float)i * 2.1f) * 0.24f; ((Color)(ref val2))..ctor(0.38f, 0.79f, 1f, Mathf.Clamp01(num * num2 * (1f - (float)i * 0.055f))); ((Renderer)val).enabled = val2.a > 0.015f; if (((Renderer)val).enabled) { val.positionCount = 4; val.startColor = val2; val.endColor = new Color(val2.r, val2.g, val2.b, 0f); val.SetPositions(_branchPoints[i]); } } } } private void PlayImpact() { //IL_0023: 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_0039: Unknown result type (might be due to invalid IL or missing references) _impactPlayed = true; Play(_targetParticles); Play(_residualParticles); Effects.InstantiateLocal("fx_chainlightning_hit", _to, Quaternion.identity, 4f); SpellAudio.PlayArcLightningHop(_to); } private static ParticleSystem[] ParticlesUnder(Transform root) { if (!((Object)(object)root == (Object)null)) { return ((Component)root).GetComponentsInChildren(true); } return (ParticleSystem[])(object)new ParticleSystem[0]; } private static void Play(ParticleSystem[] systems) { foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } private static void StopAndClear(ParticleSystem[] systems) { foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } private static void SetLineVisible(LineRenderer line, bool visible) { if ((Object)(object)line != (Object)null) { ((Renderer)line).enabled = visible; } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class ArcLightningChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public Light EffectLight; public float Lifetime = 0.88f; private ParticleSystem[] _particles; private Transform _handAnchor; private float _startedAt; private float _cancelAt = -1f; private void OnEnable() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) _particles = ((Component)this).GetComponentsInChildren(true); _startedAt = Time.time; _cancelAt = -1f; _handAnchor = FindNearestRightHand(((Component)this).transform.position); Active.Add(this); ParticleSystem[] particles = _particles; foreach (ParticleSystem obj in particles) { obj.Stop(true, (ParticleSystemStopBehavior)0); obj.Play(true); } if ((Object)(object)EffectLight != (Object)null) { EffectLight.intensity = 0f; } } private void OnDisable() { Active.Remove(this); } private void Update() { //IL_0021: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_006a: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if ((Object)(object)_handAnchor != (Object)null) { Vector3 val = _handAnchor.position + _handAnchor.forward * 0.14f; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val, 1f - Mathf.Exp((0f - Time.deltaTime) * 28f)); } float num2 = ((_cancelAt < 0f) ? 1f : Mathf.Clamp01(1f - (Time.time - _cancelAt) / 0.12f)); if ((Object)(object)EffectLight != (Object)null) { float num3 = Smooth01(num / 0.55f); float num4 = 0.88f + Mathf.Sin(num * 49f) * 0.12f; EffectLight.intensity = num3 * num4 * 1.25f * num2; } if (_cancelAt >= 0f) { if (Time.time - _cancelAt >= 0.14f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else if (num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void Cancel() { if (!(_cancelAt >= 0f)) { _cancelAt = Time.time; ParticleSystem[] particles = _particles; for (int i = 0; i < particles.Length; i++) { particles[i].Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position, float maximumDistance = 3.5f) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) ArcLightningChargeVfxController arcLightningChargeVfxController = null; float num = maximumDistance; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { ArcLightningChargeVfxController arcLightningChargeVfxController2 = Active[num2]; if ((Object)(object)arcLightningChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)arcLightningChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; arcLightningChargeVfxController = arcLightningChargeVfxController2; } } } arcLightningChargeVfxController?.Cancel(); } private static Transform FindNearestRightHand(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Player val = null; float num = 3.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null) || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)18); } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class BerserkerAuraVfxController : MonoBehaviour { public Transform FormationGroup; public Transform BodyGroup; public Transform GroundGroup; public Transform DissipationGroup; public ParticleSystem HeartbeatPulse; public Light AuraLight; public float Lifetime = 12f; public float HeartbeatInterval; public float BaseIntensity = 0.55f; private Player _player; private Transform _chest; private float _startedAt; private int _heartbeats; private bool _ending; private float _endStartedAt; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); _chest = BerserkerVfxSupport.ChestAnchor(_player); _startedAt = Time.time; _heartbeats = 0; _ending = false; BerserkerVfxSupport.Play(FormationGroup); BerserkerVfxSupport.Play(BodyGroup); BerserkerVfxSupport.Play(GroundGroup); BerserkerVfxSupport.StopAndClear(DissipationGroup); if ((Object)(object)AuraLight != (Object)null) { AuraLight.intensity = 0f; } } private void LateUpdate() { //IL_0015: 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_005b: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_player == (Object)null) { _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); _chest = BerserkerVfxSupport.ChestAnchor(_player); } float num = Time.time - _startedAt; Vector3 val = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.position : ((Component)this).transform.position); Quaternion rotation = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.rotation : ((Component)this).transform.rotation); Vector3 position = (((Object)(object)_chest != (Object)null) ? _chest.position : (val + Vector3.up * 1.32f)); ((Component)this).transform.position = val; if ((Object)(object)FormationGroup != (Object)null) { FormationGroup.position = position; FormationGroup.rotation = rotation; } if ((Object)(object)BodyGroup != (Object)null) { BodyGroup.position = position; BodyGroup.rotation = rotation; } if ((Object)(object)GroundGroup != (Object)null) { GroundGroup.position = val + Vector3.up * 0.05f; GroundGroup.rotation = rotation; } if ((Object)(object)DissipationGroup != (Object)null) { DissipationGroup.position = position; DissipationGroup.rotation = rotation; } if (HeartbeatInterval > 0.05f && !_ending) { int num2 = Mathf.FloorToInt(num / HeartbeatInterval); while (_heartbeats < num2) { _heartbeats++; ParticleSystem heartbeatPulse = HeartbeatPulse; if (heartbeatPulse != null) { heartbeatPulse.Emit(18); } } } if ((Object)(object)AuraLight != (Object)null) { ((Component)AuraLight).transform.position = position; float num3 = BerserkerVfxSupport.Smooth01(num / 0.32f); float num4 = 1f - BerserkerVfxSupport.Smooth01((num - Lifetime) / 0.55f); float num5 = ((HeartbeatInterval > 0.05f) ? (1f + Mathf.Pow(1f - Mathf.Repeat(num / HeartbeatInterval, 1f), 4f) * 0.55f) : (1f + Mathf.Sin(num * 1.9f) * 0.1f)); AuraLight.intensity = num3 * num4 * BaseIntensity * num5; } if (!_ending && num >= Lifetime) { _ending = true; _endStartedAt = Time.time; BerserkerVfxSupport.StopEmitting(FormationGroup); BerserkerVfxSupport.StopEmitting(BodyGroup); BerserkerVfxSupport.StopEmitting(GroundGroup); BerserkerVfxSupport.Play(DissipationGroup); } if (_ending && Time.time - _endStartedAt >= 1.45f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class BerserkerClass { public const string PassiveName = "Wrathbound"; public const float RendingWindow = 8f; public const float RendingDamage = 34f; public const float WarCryRadius = 8f; public const float WarCryDamage = 35f; public const float BloodstormRadius = 5f; public const float BloodstormDamage = 28f; public const int BloodstormPulses = 3; public const float BloodstormDuration = 1.2f; public const float BloodstormInterval = 0.4f; public const float BearskinDuration = 12f; public const float BearskinDamageReduction = 0.4f; public const float RageDuration = 12f; public const float RageLifeSteal = 0.15f; private static Player _statePlayer; private static float _rendingUntil; private static float _rendingExtraDamage; private static float _bearskinUntil; private static float _rageUntil; private static bool _rageWasActive; private static Player _animationAttackPlayer; private static float _suppressAnimationAttackUntil; public static readonly Spell[] Spells = new Spell[5] { new Spell { Name = "Rending Blow", Flavor = "the next edge bites deeper", UnlockLevel = 10, Cooldown = 5f, Resource = AbilityResource.Fury, ResourceCost = 20f, CastTime = 0f, BaseDamage = 34f, CastTrigger = null, Describe = (int lvl) => $"Your next melee hit within {8f:0} s tears for " + $"{Progression.Dmg(34f, lvl):0} additional slash damage and heavy stagger.", Cast = ArmRendingBlow }, new Spell { Name = "War Cry", Flavor = "your voice breaks the enemy line", UnlockLevel = 20, Cooldown = 14f, Resource = AbilityResource.Fury, ResourceCost = 30f, CastTime = 0f, BaseDamage = 35f, CastTrigger = "gpower", Describe = (int lvl) => $"A violent cry deals {Progression.Dmg(35f, lvl):0} blunt damage " + $"and drives enemies back within {8f:0} m.", Cast = CastWarCry }, new Spell { Name = "Bloodstorm", Flavor = "steel turns three times around you", UnlockLevel = 30, Cooldown = 18f, Resource = AbilityResource.Fury, ResourceCost = 45f, CastTime = 0f, BaseDamage = 28f, CastTrigger = null, Describe = (int lvl) => "Three sweeping strikes each deal " + $"{Progression.Dmg(28f, lvl):0} slash damage within {5f:0} m " + "as you spin with the blood-wind.", Cast = CastBloodstorm }, new Spell { Name = "Bearskin", Flavor = "hide and fury turn the enemy edge", UnlockLevel = 40, Cooldown = 60f, Resource = AbilityResource.Fury, ResourceCost = 55f, CastTime = 0f, BaseDamage = 0f, CastTrigger = "gpower", Describe = (int lvl) => $"Reduce incoming damage by {40f:0}% " + $"for {12f:0} s.", Cast = CastBearskin }, new Spell { Name = "Rage Unbound", Flavor = "there is no wound, only wrath", UnlockLevel = 50, Cooldown = 100f, Resource = AbilityResource.Fury, ResourceCost = 100f, CastTime = 1.5f, BaseDamage = 0f, CastTrigger = "gpower", Describe = (int lvl) => $"For {12f:0} s Fury stays full, Wrathbound is doubled, " + $"and melee damage heals {15.000001f:0}% of the health actually lost.", Cast = CastRageUnbound } }; public static string PassiveDescription(int level) { return "Wrathbound — melee hits and hostile wounds build Fury. Fury grants up to " + $"{MaximumMeleeBonus(level) * 100f:0}% physical melee damage and fades after " + $"{5f:0} s out of combat."; } public static float MaximumMeleeBonus(int level) { return 0.1f + 0.002f * (float)Mathf.Clamp(level, 1, 50); } public static void Update(Player player) { EnsureState(player); if (!((Object)(object)player == (Object)null)) { bool flag = IsRageUnbound(player); if (_rageWasActive && !flag) { BerserkerFury.EmptyAfterRageUnbound(); } _rageWasActive = flag; if (((Character)player).IsDead()) { _rendingUntil = 0f; _bearskinUntil = 0f; _rageUntil = 0f; } } } public static bool IsRageUnbound(Player player) { if ((Object)(object)player != (Object)null && player == _statePlayer) { return Time.time < _rageUntil; } return false; } private static void EnsureState(Player player) { if (player != _statePlayer) { _statePlayer = player; _rendingUntil = 0f; _rendingExtraDamage = 0f; _bearskinUntil = 0f; _rageUntil = 0f; _rageWasActive = false; _animationAttackPlayer = null; _suppressAnimationAttackUntil = 0f; } } public static void ResetState(Player player) { _statePlayer = player; _rendingUntil = 0f; _rendingExtraDamage = 0f; _bearskinUntil = 0f; _rageUntil = 0f; _rageWasActive = false; _animationAttackPlayer = null; _suppressAnimationAttackUntil = 0f; } public static void ModifyOutgoingMelee(Character target, Player attacker, HitData hit) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fc: 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_00e6: 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) EnsureState(attacker); float num = MaximumMeleeBonus(ClassSystem.GetLevel(attacker)) * BerserkerFury.Normalized; if (IsRageUnbound(attacker)) { num *= 2f; } float num2 = 1f + num; hit.m_damage.m_blunt *= num2; hit.m_damage.m_slash *= num2; hit.m_damage.m_pierce *= num2; if (!(Time.time >= _rendingUntil) && !(_rendingExtraDamage <= 0f)) { hit.m_damage.m_slash += _rendingExtraDamage; hit.m_staggerMultiplier = Mathf.Max(hit.m_staggerMultiplier, 2.2f); _rendingUntil = 0f; _rendingExtraDamage = 0f; PassiveEffects.RemoveRending(attacker); Vector3 b = ((hit.m_point != Vector3.zero) ? hit.m_point : (((Object)(object)target != (Object)null) ? target.GetCenterPoint() : ((Component)attacker).transform.position)); SpellFx.PlayShared(FxKind.RendingBlow, ((Component)attacker).transform.position, b); } } public static void ReduceIncomingDamage(Player player, float previousHealth, ref float health) { if (!((Object)(object)player == (Object)null) && ClassSystem.GetClass(player) == PlayerClass.Berserker) { EnsureState(player); if (!(health >= previousHealth) && !(Time.time >= _bearskinUntil)) { float num = previousHealth - health; health = previousHealth - num * 0.6f; } } } private static void ArmRendingBlow(Player player, int level) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) EnsureState(player); _rendingUntil = Time.time + 8f; _rendingExtraDamage = Progression.Dmg(34f, level); PassiveEffects.ApplyRending(player); SpellFx.PlayShared(FxKind.RendingEmpower, ((Component)player).transform.position, ((Component)player).transform.position); } private static void CastWarCry(Player player, int level) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) Vector3 position = ((Component)player).transform.position; float blunt = Progression.Dmg(35f, level); SpellFx.PlayShared(FxKind.WarCry, position, position); foreach (Character item in Effects.EnemiesInRange(position, 8f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_blunt = blunt }, null, 45f); } } private static void CastBloodstorm(Player player, int level) { //IL_0008: 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) SpellFx.PlayShared(FxKind.Bloodstorm, ((Component)player).transform.position, ((Component)player).transform.position); ((MonoBehaviour)Plugin.Instance).StartCoroutine(BloodstormRoutine(player, level)); } private static IEnumerator BloodstormRoutine(Player player, int level) { Quaternion startRotation = ((Component)player).transform.rotation; float damage = Progression.Dmg(28f, level); for (int pulse = 0; pulse < 3; pulse++) { if ((Object)(object)player == (Object)null) { yield break; } if (((Character)player).IsDead()) { ((Component)player).transform.rotation = startRotation; yield break; } TriggerWeaponSwing(player); float elapsed = 0f; bool dealtDamage = false; while (elapsed < 0.4f) { if ((Object)(object)player == (Object)null) { yield break; } if (((Character)player).IsDead() || ClassSystem.GetClass(player) != PlayerClass.Berserker) { ((Component)player).transform.rotation = startRotation; yield break; } float num = (float)pulse + Mathf.Clamp01(elapsed / 0.4f); ((Component)player).transform.rotation = startRotation * Quaternion.Euler(0f, num * 360f, 0f); if (!dealtDamage && elapsed >= 0.20799999f) { DealBloodstormPulse(player, damage); dealtDamage = true; } elapsed += Time.deltaTime; yield return null; } if (!dealtDamage) { DealBloodstormPulse(player, damage); } } ((Component)player).transform.rotation = startRotation; } private static void DealBloodstormPulse(Player player, float damage) { //IL_0006: 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_0038: Unknown result type (might be due to invalid IL or missing references) foreach (Character item in Effects.EnemiesInRange(((Component)player).transform.position, 5f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_slash = damage }, null, 12f); } } internal static void TriggerWeaponSwing(Player player) { if ((Object)(object)player == (Object)null) { return; } float stamina = player.GetStamina(); if (((Character)player).StartAttack((Character)null, false)) { _animationAttackPlayer = player; _suppressAnimationAttackUntil = Time.time + 0.9f; float num = stamina - player.GetStamina(); if (num > 0f) { ((Character)player).AddStamina(num); } } else { ItemData currentWeapon = ((Humanoid)player).GetCurrentWeapon(); string text = ((currentWeapon != null && currentWeapon.m_shared != null && currentWeapon.m_shared.m_attack != null) ? currentWeapon.m_shared.m_attack.m_attackAnimation : null); if (!string.IsNullOrEmpty(text) && (Object)(object)((Character)player).m_zanim != (Object)null) { ((Character)player).m_zanim.SetTrigger(text); } } } internal static bool SuppressAnimationAttack(Attack attack) { if (attack != null && Time.time < _suppressAnimationAttackUntil) { return (object)attack.m_character == _animationAttackPlayer; } return false; } private static void CastBearskin(Player player, int level) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) EnsureState(player); _bearskinUntil = Time.time + 12f; PassiveEffects.ApplyBearskin(player); SpellFx.PlayShared(FxKind.Bearskin, ((Component)player).transform.position, ((Component)player).transform.position); XpSystem.Message(player, "Bearskin — damage reduced"); } private static void CastRageUnbound(Player player, int level) { //IL_002f: 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) EnsureState(player); _rageUntil = Time.time + 12f; _rageWasActive = true; PassiveEffects.ApplyRageUnbound(player); BerserkerFury.FillForRageUnbound(); SpellFx.PlayShared(FxKind.RageUnbound, ((Component)player).transform.position, ((Component)player).transform.position); } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] internal static class BerserkerAnimationMeleePatch { private static bool Prefix(Attack __instance) { return !BerserkerClass.SuppressAnimationAttack(__instance); } } [HarmonyPatch(typeof(Attack), "DoAreaAttack")] internal static class BerserkerAnimationAreaPatch { private static bool Prefix(Attack __instance) { return !BerserkerClass.SuppressAnimationAttack(__instance); } } public static class BerserkerFury { public const float Maximum = 100f; public const float GraceDuration = 5f; public const float DecayPerSecond = 7.5f; private static Player _trackedPlayer; private static float _value; private static float _lastCombatAt = -999f; private static bool _wasDead; public static float Value => _value; public static float Normalized => Mathf.Clamp01(_value / 100f); public static void Update(Player player) { if (player != _trackedPlayer) { _trackedPlayer = player; _value = 0f; _lastCombatAt = -999f; _wasDead = false; } if ((Object)(object)player == (Object)null || ClassSystem.GetClass(player) != PlayerClass.Berserker) { _value = 0f; return; } if (((Character)player).IsDead()) { if (!_wasDead) { _value = 0f; } _wasDead = true; return; } _wasDead = false; if (MaximumIsLocked(player)) { _value = 100f; } else if (Time.time - _lastCombatAt > 5f) { _value = Mathf.MoveTowards(_value, 0f, 7.5f * Time.deltaTime); } } public static bool Has(float amount) { if (!MaximumIsLocked(Player.m_localPlayer)) { return _value + 0.001f >= Mathf.Max(0f, amount); } return true; } public static bool Spend(float amount) { if (!Has(amount)) { return false; } TouchCombat(); if (!MaximumIsLocked(Player.m_localPlayer)) { _value = Mathf.Max(0f, _value - Mathf.Max(0f, amount)); } return true; } public static void FillForRageUnbound() { _value = 100f; TouchCombat(); } public static void EmptyAfterRageUnbound() { _value = 0f; _lastCombatAt = Time.time; } public static void Reset(Player player) { _trackedPlayer = player; _value = 0f; _lastCombatAt = -999f; _wasDead = (Object)(object)player != (Object)null && ((Character)player).IsDead(); } public static void AddFromDamageDealt(float effectiveDamage) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ClassSystem.GetClass(localPlayer) != PlayerClass.Berserker || effectiveDamage <= 0.01f) { return; } Add(Mathf.Clamp(2f + Mathf.Sqrt(effectiveDamage) * 0.75f, 2f, 14f)); if (BerserkerClass.IsRageUnbound(localPlayer)) { float num = Mathf.Max(0f, ((Character)localPlayer).GetMaxHealth() - ((Character)localPlayer).GetHealth()); if (num > 0.01f) { ((Character)localPlayer).Heal(Mathf.Min(num, effectiveDamage * 0.15f), true); } } } public static void AddFromDamageTaken(float effectiveDamage) { if (!(effectiveDamage <= 0.01f)) { Add(Mathf.Clamp(4f + effectiveDamage * 0.12f, 4f, 18f)); } } private static void Add(float amount) { if (MaximumIsLocked(Player.m_localPlayer)) { _value = 100f; } else { _value = Mathf.Clamp(_value + Mathf.Max(0f, amount), 0f, 100f); } TouchCombat(); } private static void TouchCombat() { _lastCombatAt = Time.time; } private static bool MaximumIsLocked(Player player) { return BerserkerClass.IsRageUnbound(player); } internal static bool IsMeleeSkill(SkillType skill) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 if ((int)skill != 1 && (int)skill != 2 && (int)skill != 3 && (int)skill != 4 && (int)skill != 5 && (int)skill != 7) { return (int)skill == 11; } return true; } internal static bool IsValidCombatTarget(Character target, Player attacker) { if ((Object)(object)target == (Object)null || (Object)(object)attacker == (Object)null || target.IsPlayer() || target.IsTamed()) { return false; } string text = (((Object)(object)target.m_nview != (Object)null) ? target.m_nview.GetPrefabName() : ((Object)((Component)target).gameObject).name); if (!string.IsNullOrEmpty(text) && text.IndexOf("TrainingDummy", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } return BaseAI.IsEnemy(target, (Character)(object)attacker); } internal static void AwardDealtDamageFromWitness(long playerId, float effectiveDamage, SkillType skill) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (playerId != 0L && !(effectiveDamage <= 0.01f) && IsMeleeSkill(skill)) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && localPlayer.GetPlayerID() == playerId) { AddFromDamageDealt(effectiveDamage); } Network.BroadcastFuryHit(playerId, effectiveDamage); } } internal static void ReceiveRemoteHit(long playerId, float effectiveDamage) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && localPlayer.GetPlayerID() == playerId) { AddFromDamageDealt(effectiveDamage); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class BerserkerOutgoingDamagePatch { private static void Prefix(Character __instance, HitData hit) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (hit != null && BerserkerFury.IsMeleeSkill(hit.m_skill)) { Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer) && ClassSystem.GetClass(val) == PlayerClass.Berserker) { BerserkerClass.ModifyOutgoingMelee(__instance, val, hit); } } } } [HarmonyPatch(typeof(Character), "SetHealth")] public static class BerserkerIncomingDamagePatch { private static void Prefix(Character __instance, ref float health) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer)) { float health2 = ((Character)val).GetHealth(); if (!(health >= health2 - 0.01f)) { BerserkerSpecializations.ReduceIncomingDamage(val, health2, ref health); BerserkerClass.ReduceIncomingDamage(val, health2, ref health); } } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class BerserkerIncomingDamageWitnessPatch { private struct DamageState { public Player Player; public float HealthBefore; public bool Hostile; } private static void Prefix(Character __instance, HitData hit, out DamageState __state) { __state = default(DamageState); Player val = (Player)(object)((__instance is Player) ? __instance : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer) && hit != null && ClassSystem.GetClass(val) == PlayerClass.Berserker && !((Object)(object)((Character)val).m_nview == (Object)null) && ((Character)val).m_nview.IsOwner()) { Character attacker = hit.GetAttacker(); __state.Player = val; __state.HealthBefore = ((Character)val).GetHealth(); __state.Hostile = (Object)(object)attacker != (Object)null && (Object)(object)attacker != (Object)(object)val && BaseAI.IsEnemy(attacker, (Character)(object)val); } } private static void Postfix(DamageState __state) { if (__state.Hostile && !((Object)(object)__state.Player == (Object)null)) { BerserkerFury.AddFromDamageTaken(Mathf.Max(0f, __state.HealthBefore - ((Character)__state.Player).GetHealth())); } } } public static class BerserkerSpecializations { public const float ExecutionRange = 7f; public const float ExecutionDamage = 95f; public const float ExecutionLowHealthMultiplier = 1.5f; public const float EarthshatterRadius = 10f; public const float EarthshatterDamage = 75f; public const float EarthshatterRange = 24f; public const float EarthshatterApexHeight = 15f; public const float EarthshatterDiveVelocity = 28f; public const float WarbandRadius = 15f; public const float WarbandDuration = 18f; public const float WarbandDamageReduction = 0.25f; private static Player _warbandPlayer; private static float _warbandUntil; public static readonly BerserkerSpecialization[] All = new BerserkerSpecialization[3] { BerserkerSpecialization.Ravager, BerserkerSpecialization.Jotunn, BerserkerSpecialization.Warlord }; private static readonly Spell RavagerSpell = new Spell { Name = "Executioner's Wake", Flavor = "the wounded fall where your edge passes", UnlockLevel = 50, Cooldown = 60f, Resource = AbilityResource.Fury, ResourceCost = 70f, CastTime = 0f, BaseDamage = 95f, CastTrigger = null, Describe = (int lvl) => $"Cleave a wide path for {Progression.Dmg(95f, lvl):0} slash damage; " + $"foes below 35% health suffer {1.5f:0.0}x damage.", Cast = CastExecutionersWake }; private static readonly Spell JotunnSpell = new Spell { Name = "Earthshatter", Flavor = "the ground remembers the feet of giants", UnlockLevel = 50, Cooldown = 70f, Resource = AbilityResource.Fury, ResourceCost = 80f, CastTime = 0f, BaseDamage = 75f, CastTrigger = null, Describe = (int lvl) => $"Leap up to {24f:0} m toward the aim, then plunge down like " + "Yagluth's meteor. The impact deals " + $"{Progression.Dmg(75f, lvl):0} blunt damage within {10f:0} m " + "and immense knockback.", Cast = CastEarthshatter }; private static readonly Spell WarlordSpell = new Spell { Name = "Warband's Oath", Flavor = "all who stand with you become one shield", UnlockLevel = 50, Cooldown = 90f, Resource = AbilityResource.Fury, ResourceCost = 60f, CastTime = 0f, BaseDamage = 0f, CastTrigger = "gpower", Describe = (int lvl) => $"You and nearby players within {15f:0} m take " + $"{25f:0}% less damage for {18f:0} s.", Cast = CastWarbandsOath }; public static void ResetState(Player player) { _warbandPlayer = player; _warbandUntil = 0f; } public static Spell SpellFor(BerserkerSpecialization specialization) { return specialization switch { BerserkerSpecialization.Ravager => RavagerSpell, BerserkerSpecialization.Jotunn => JotunnSpell, BerserkerSpecialization.Warlord => WarlordSpell, _ => null, }; } public static string NameOf(BerserkerSpecialization specialization) { return specialization switch { BerserkerSpecialization.Ravager => "Ravager", BerserkerSpecialization.Jotunn => "Jötunn", BerserkerSpecialization.Warlord => "Warlord", _ => "Unwoven", }; } public static string DescriptionOf(BerserkerSpecialization specialization) { return specialization switch { BerserkerSpecialization.Ravager => "Finish wounded enemies with merciless sweeping blows.", BerserkerSpecialization.Jotunn => "Carry the weight of giants and break the battlefield.", BerserkerSpecialization.Warlord => "Turn your fury into an oath that protects the warband.", _ => "Choose whether your fury destroys, endures, or commands.", }; } public static Color AccentOf(BerserkerSpecialization specialization) { //IL_0025: 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_004f: 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) return (Color)(specialization switch { BerserkerSpecialization.Ravager => new Color(0.96f, 0.18f, 0.12f), BerserkerSpecialization.Jotunn => new Color(0.52f, 0.76f, 0.92f), BerserkerSpecialization.Warlord => new Color(0.94f, 0.68f, 0.24f), _ => ClassArt.AccentOf(PlayerClass.Berserker), }); } public static string ShortNameOf(BerserkerSpecialization specialization) { return specialization switch { BerserkerSpecialization.Ravager => "RAVAGE", BerserkerSpecialization.Jotunn => "JÖTUNN", BerserkerSpecialization.Warlord => "WARLORD", _ => "—", }; } private static void CastExecutionersWake(Player player, int level) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; Vector3 val = Effects.AimDirection(player); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = ((Component)player).transform.forward; } ((Vector3)(ref val)).Normalize(); Vector3 b = position + val * 7f; ((Component)player).transform.rotation = Quaternion.LookRotation(val, Vector3.up); BerserkerClass.TriggerWeaponSwing(player); SpellFx.PlayShared(FxKind.ExecutionersWake, position, b); ((MonoBehaviour)Plugin.Instance).StartCoroutine(ExecutionersWakeDamage(player, level, val)); } private static IEnumerator ExecutionersWakeDamage(Player player, int level, Vector3 forward) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(0.2f); if ((Object)(object)player == (Object)null || ((Character)player).IsDead() || ClassSystem.GetClass(player) != PlayerClass.Berserker) { yield break; } Vector3 position = ((Component)player).transform.position; float num = Progression.Dmg(95f, level); foreach (Character item in Effects.EnemiesInRange(position, 7f, (Character)(object)player)) { Vector3 val = ((Component)item).transform.position - position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f) || !(Vector3.Dot(forward, ((Vector3)(ref val)).normalized) < 0.57f)) { float slash = ((((item.GetMaxHealth() > 0f) ? (item.GetHealth() / item.GetMaxHealth()) : 1f) <= 0.35f) ? (num * 1.5f) : num); Effects.DealDamage(player, item, new DamageTypes { m_slash = slash }, null, 30f); } } } private static void CastEarthshatter(Player player, int level) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0063: 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) Vector3 val = EarthshatterTarget(player); Vector3 val2 = val - ((Component)player).transform.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = ((Component)player).transform.forward; } ((Vector3)(ref val2)).Normalize(); ((Component)player).transform.rotation = Quaternion.LookRotation(val2, Vector3.up); ((MonoBehaviour)Plugin.Instance).StartCoroutine(EarthshatterLeap(player, level, val)); } private static Vector3 EarthshatterTarget(Player player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; Vector3 val = Effects.SurfacePoint(Effects.AimPoint(player, 24f)); Vector3 val2 = val - position; val2.y = 0f; if (((Vector3)(ref val2)).magnitude > 24f) { val = Effects.SurfacePoint(position + ((Vector3)(ref val2)).normalized * 24f); } return val; } private static IEnumerator EarthshatterLeap(Player player, int level, Vector3 targetSurface) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || ((Character)player).IsDead() || ClassSystem.GetClass(player) != PlayerClass.Berserker || (Object)(object)((Character)player).m_body == (Object)null) { yield break; } if ((Object)(object)((Character)player).m_zanim != (Object)null) { ((Character)player).m_zanim.SetTrigger("jump"); } Vector3 start = ((Character)player).m_body.position; float num = Mathf.Clamp(start.y - Effects.SurfacePoint(start).y, 0.05f, 0.8f); Vector3 target = targetSurface + Vector3.up * num; Vector3 apex = Vector3.Lerp(start, target, 0.44f); apex.y = Mathf.Max(start.y, target.y) + 15f; float elapsed = 0f; while (elapsed < 0.9f) { yield return (object)new WaitForFixedUpdate(); if (!CanContinueEarthshatter(player)) { yield break; } elapsed += Time.fixedDeltaTime; float num2 = Mathf.Clamp01(elapsed / 0.9f); float num3 = num2 * num2 * (3f - 2f * num2); MoveEarthshatterBody(player, Vector3.Lerp(start, apex, num3)); } float holdUntil = Time.time + 0.1f; while (Time.time < holdUntil) { yield return (object)new WaitForFixedUpdate(); if (!CanContinueEarthshatter(player)) { yield break; } MoveEarthshatterBody(player, apex); } SpellFx.PlayShared(FxKind.EarthshatterDive, ((Component)player).transform.position, targetSurface); Vector3 diveStart = ((Character)player).m_body.position; float diveDuration = Mathf.Clamp(Vector3.Distance(diveStart, target) / 28f, 0.46f, 0.82f); elapsed = 0f; while (elapsed < diveDuration) { yield return (object)new WaitForFixedUpdate(); if (!CanContinueEarthshatter(player)) { yield break; } elapsed += Time.fixedDeltaTime; float num4 = Mathf.Clamp01(elapsed / diveDuration); float num5 = num4 * num4; MoveEarthshatterBody(player, Vector3.Lerp(diveStart, target, num5)); } if (!CanContinueEarthshatter(player)) { yield break; } MoveEarthshatterBody(player, target); yield return (object)new WaitForFixedUpdate(); if (!CanContinueEarthshatter(player)) { yield break; } ((Character)player).m_maxAirAltitude = ((Component)player).transform.position.y; ((Character)player).m_body.linearVelocity = Vector3.zero; Vector3 val = Effects.SurfacePoint(targetSurface); SpellFx.PlayShared(FxKind.Earthshatter, val, val); float blunt = Progression.Dmg(75f, level); foreach (Character item in Effects.EnemiesInRange(val, 10f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_blunt = blunt }, null, 75f); } } private static void MoveEarthshatterBody(Player player, Vector3 position) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0038: 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) float num = Mathf.Max(0.001f, Time.fixedDeltaTime); ((Character)player).m_body.linearVelocity = (position - ((Character)player).m_body.position) / num; ((Character)player).m_body.MovePosition(position); ((Character)player).m_maxAirAltitude = ((Component)player).transform.position.y; } private static bool CanContinueEarthshatter(Player player) { if ((Object)(object)player != (Object)null && !((Character)player).IsDead() && (Object)(object)((Character)player).m_body != (Object)null) { return ClassSystem.GetClass(player) == PlayerClass.Berserker; } return false; } private static void CastWarbandsOath(Player player, int level) { //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_000c: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; ApplyWarbandLocal(position); Network.BroadcastWarband(position); SpellFx.PlayShared(FxKind.WarbandsOath, position, position); } public static void ApplyWarbandLocal(Vector3 center) { //IL_001e: 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) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead() && !(Vector3.Distance(((Component)localPlayer).transform.position, center) > 15f)) { _warbandPlayer = localPlayer; _warbandUntil = Mathf.Max(_warbandUntil, Time.time + 18f); PassiveEffects.ApplyWarband(localPlayer); XpSystem.Message(localPlayer, "Warband's Oath — damage reduced"); } } public static void ReduceIncomingDamage(Player player, float previousHealth, ref float health) { if (!((Object)(object)player == (Object)null) && player == _warbandPlayer && !(Time.time >= _warbandUntil) && !(health >= previousHealth)) { float num = previousHealth - health; health = previousHealth - num * 0.75f; } } } internal static class BerserkerVfxSupport { public static Player FindNearestPlayer(Vector3 position, float maximumDistance = 4.5f) { //IL_0022: 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) Player result = null; float num = maximumDistance; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } public static Transform ChestAnchor(Player player) { if ((Object)(object)player == (Object)null) { return null; } Animator componentInChildren = ((Component)player).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)54) ?? componentInChildren.GetBoneTransform((HumanBodyBones)8) ?? componentInChildren.GetBoneTransform((HumanBodyBones)7); } public static void Play(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } public static void StopEmitting(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)1); } } } public static void StopAndClear(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } public static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } public static float Flash(float elapsed, float attack, float decay) { if (elapsed < 0f) { return 0f; } if (elapsed < attack) { return Smooth01(elapsed / Mathf.Max(0.0001f, attack)); } return 1f - Smooth01((elapsed - attack) / Mathf.Max(0.0001f, decay)); } } public static class BerserkerWeapons { public const string UruzCleaverPrefab = "NornsUruzCleaver"; private static bool _hooked; private static bool _created; public static void Register() { if (!_hooked) { _hooked = true; PrefabManager.OnVanillaPrefabsAvailable += Create; } } public static void Shutdown() { if (_hooked) { PrefabManager.OnVanillaPrefabsAvailable -= Create; } _hooked = false; } private static void Create() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0127: 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_0136: 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_0156: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= Create; _hooked = false; if (_created) { return; } try { ItemConfig val = new ItemConfig(); val.Name = "Uruz Cleaver"; val.Description = "A brutal two-handed cleaver of flint, bone and bound wood. Its first rune teaches young Berserkers to put both hands behind every blow."; val.CraftingStation = CraftingStations.Workbench; val.RepairStation = CraftingStations.Workbench; val.MinStationLevel = 1; val.Weight = 4.5f; val.Icon = LoadIcon("uruz_cleaver.jpg"); val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("Wood", 12, 4, true), new RequirementConfig("Flint", 8, 4, true), new RequirementConfig("LeatherScraps", 4, 2, true), new RequirementConfig("DeerHide", 2, 1, true) }; ItemConfig val2 = val; CustomItem val3 = new CustomItem("NornsUruzCleaver", "Battleaxe", val2); if ((Object)(object)val3.ItemPrefab == (Object)null || (Object)(object)val3.ItemDrop == (Object)null) { Plugin.Log.LogError((object)"Impossibile clonare Battleaxe per Uruz Cleaver."); return; } SharedData shared = val3.ItemDrop.m_itemData.m_shared; shared.m_itemType = (ItemType)14; shared.m_skillType = (SkillType)7; shared.m_damages = new DamageTypes { m_slash = 24f, m_blunt = 4f }; shared.m_damagesPerLevel = new DamageTypes { m_slash = 3f, m_blunt = 1f }; shared.m_attackForce = 55f; shared.m_backstabBonus = 3f; shared.m_blockPower = 12f; shared.m_blockPowerPerLevel = 3f; shared.m_deflectionForce = 20f; shared.m_deflectionForcePerLevel = 5f; shared.m_timedBlockBonus = 2f; shared.m_maxQuality = 4; shared.m_useDurability = true; shared.m_maxDurability = 140f; shared.m_durabilityPerLevel = 45f; shared.m_movementModifier = -0.08f; if (shared.m_attack != null) { shared.m_attack = shared.m_attack.Clone(); shared.m_attack.m_attackStamina = 12f; } if (shared.m_secondaryAttack != null) { shared.m_secondaryAttack = shared.m_secondaryAttack.Clone(); shared.m_secondaryAttack.m_attackStamina = 18f; } NornsStaffModels.ReplaceVanillaVisual(val3.ItemPrefab, NornsStaffModels.Style.UruzCleaver); if (!ItemManager.Instance.AddItem(val3)) { Plugin.Log.LogError((object)"Jotunn ha rifiutato Uruz Cleaver."); return; } _created = true; Plugin.Log.LogInfo((object)"Uruz Cleaver iniziale registrata."); } catch (Exception arg) { Plugin.Log.LogError((object)$"Registrazione di Uruz Cleaver fallita: {arg}"); } } private static Sprite LoadIcon(string fileName) { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return null; } string text = Path.Combine(directoryName, "art", "items", fileName); if (!File.Exists(text)) { Plugin.Log.LogWarning((object)("Icona arma Berserker non trovata: " + text)); return null; } return AssetUtils.LoadSpriteFromFile(text); } } public sealed class BlackHoleVfxController : MonoBehaviour { public const float DefaultActiveDuration = 6f; public const float DefaultResidualDuration = 1.2f; public Transform GroundFieldGroup; public Transform GroundVortexGroup; public Transform GroundVortexCounterGroup; public Transform SingularityGroup; public Transform AccretionGroup; public Transform AccretionCounterGroup; public Transform GravityFlowGroup; public Light EffectLight; public float ActiveDuration = 6f; public float ResidualDuration = 1.2f; private Vector3 _groundFieldScale; private Quaternion _groundVortexRotation; private Quaternion _groundVortexCounterRotation; private Vector3 _singularityScale; private Vector3 _singularityPosition; private Vector3 _accretionScale; private Vector3 _counterScale; private Vector3 _gravityFlowScale; private Camera _camera; private float _startedAt; private bool _implosionPlayed; private void OnEnable() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0035: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00b9: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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) _groundFieldScale = (((Object)(object)GroundFieldGroup != (Object)null) ? GroundFieldGroup.localScale : Vector3.one); _groundVortexRotation = (((Object)(object)GroundVortexGroup != (Object)null) ? GroundVortexGroup.localRotation : Quaternion.identity); _groundVortexCounterRotation = (((Object)(object)GroundVortexCounterGroup != (Object)null) ? GroundVortexCounterGroup.localRotation : Quaternion.identity); _singularityScale = (((Object)(object)SingularityGroup != (Object)null) ? SingularityGroup.localScale : Vector3.one); _singularityPosition = (((Object)(object)SingularityGroup != (Object)null) ? SingularityGroup.localPosition : Vector3.zero); _accretionScale = (((Object)(object)AccretionGroup != (Object)null) ? AccretionGroup.localScale : Vector3.one); _counterScale = (((Object)(object)AccretionCounterGroup != (Object)null) ? AccretionCounterGroup.localScale : Vector3.one); _gravityFlowScale = (((Object)(object)GravityFlowGroup != (Object)null) ? GravityFlowGroup.localScale : Vector3.one); _camera = Camera.main; _startedAt = Time.time; _implosionPlayed = false; Apply(0f); } private void Update() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; Apply(num); if (!_implosionPlayed && num >= ActiveDuration) { _implosionPlayed = true; SpellAudio.PlayBlackHoleImplosion(((Component)this).transform.position); } if (num >= ActiveDuration + ResidualDuration + 0.15f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Apply(float elapsed) { //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) float num = Smooth01(elapsed / 0.46f); float num2 = Smooth01((elapsed - (ActiveDuration - 1.2f)) / 0.75f); float num3 = Smooth01((elapsed - (ActiveDuration - 0.45f)) / 0.45f); float num4 = Mathf.Clamp01((elapsed - ActiveDuration) / Mathf.Max(0.01f, ResidualDuration)); float num5 = Mathf.Sin(elapsed * 2.35f) * 0.012f + Mathf.Sin(elapsed * 4.77f + 0.8f) * 0.007f; float num6 = Mathf.Repeat(elapsed, 0.5f) / 0.5f; float num7 = Mathf.Pow(1f - num6, 5f) * num * (1f - num2) * 0.014f; float num8 = Smooth01(elapsed / 0.42f); float num9 = Mathf.Max(0.001f, Mathf.Lerp(0.1f, 1f, num8) * (1f - num3)); float num10 = Mathf.Max(0.001f, Mathf.Lerp(0.05f, 1f + num5 + num2 * 0.035f, num) * (1f - num7) * (1f - num3)); float num11 = Mathf.Max(0.001f, Mathf.Lerp(0.04f, 1f, Smooth01((elapsed - 0.08f) / 0.42f)) * (1f + num7 * 1.8f) * (1f - num3)); float num12 = Mathf.Max(0.001f, Mathf.Lerp(0.18f, 1f, Smooth01((elapsed - 0.12f) / 0.48f)) * (1f - num3)); if ((Object)(object)GroundFieldGroup != (Object)null) { GroundFieldGroup.localScale = _groundFieldScale * num9; } if ((Object)(object)GroundVortexGroup != (Object)null) { float num13 = elapsed * 10.5f + Mathf.Sin(elapsed * 1.28f) * 3.8f + Mathf.Sin(elapsed * 2.73f + 0.6f) * 1.6f + num2 * num2 * 34f; GroundVortexGroup.localRotation = _groundVortexRotation * Quaternion.Euler(0f, num13, 0f); } if ((Object)(object)GroundVortexCounterGroup != (Object)null) { float num14 = (0f - elapsed) * 16.5f + Mathf.Sin(elapsed * 1.91f + 1.4f) * 2.2f - num2 * num2 * 50f; GroundVortexCounterGroup.localRotation = _groundVortexCounterRotation * Quaternion.Euler(0f, num14, 0f); } if ((Object)(object)SingularityGroup != (Object)null) { float num15 = Mathf.Lerp(-1.72f, 0f, num); float num16 = Mathf.Sin(elapsed * 1.83f) * 0.025f * num * (1f - num2); SingularityGroup.localPosition = _singularityPosition + Vector3.up * (num15 + num16 - num3 * 0.18f); SingularityGroup.localScale = _singularityScale * num10; } if ((Object)(object)GravityFlowGroup != (Object)null) { GravityFlowGroup.localScale = _gravityFlowScale * num12; } if ((Object)(object)AccretionGroup != (Object)null) { AccretionGroup.localScale = _accretionScale * num11; float roll = elapsed * 18f + Mathf.Sin(elapsed * 1.71f) * 4.2f + num2 * num2 * 42f; AccretionGroup.rotation = FacingRotation(roll); } if ((Object)(object)AccretionCounterGroup != (Object)null) { AccretionCounterGroup.localScale = _counterScale * num11; float roll2 = (0f - elapsed) * 7.5f + Mathf.Sin(elapsed * 2.29f + 1.1f) * 2.6f - num2 * num2 * 18f; AccretionCounterGroup.rotation = FacingRotation(roll2); } if ((Object)(object)EffectLight != (Object)null) { float num17 = Mathf.Sin(Mathf.Clamp01(elapsed / 0.2f) * (float)Math.PI); float num18 = num2 * (0.1f + Mathf.Abs(Mathf.Sin(elapsed * 7.1f)) * 0.08f); float num19 = Mathf.Sin(Mathf.Clamp01((elapsed - ActiveDuration) / 0.1f) * (float)Math.PI) * 0.72f; float num20 = ((elapsed < ActiveDuration) ? (0.1f + num5 * 2f + num7 * 1.4f) : 0f); EffectLight.intensity = Mathf.Max(0f, (num17 * 0.42f + num20 + num18 + num19) * (1f - num4)); } } private Quaternion FacingRotation(float roll) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)_camera == (Object)null) { _camera = Camera.main; } if ((Object)(object)_camera == (Object)null) { return Quaternion.AngleAxis(roll, Vector3.forward); } Vector3 val = ((Component)_camera).transform.position - ((Component)this).transform.position; if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = Vector3.forward; } return Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) * Quaternion.AngleAxis(roll, Vector3.forward); } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class BlackHoleChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public float Lifetime = 1.65f; private ParticleSystem[] _particles; private float _startedAt; private float _cancelAt = -1f; private void OnEnable() { _particles = ((Component)this).GetComponentsInChildren(true); _startedAt = Time.time; Active.Add(this); } private void OnDisable() { Active.Remove(this); } private void Update() { if (_cancelAt >= 0f) { if (Time.time - _cancelAt >= 0.24f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else if (Time.time - _startedAt >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void Cancel() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (_cancelAt >= 0f) { return; } _cancelAt = Time.time; if (_particles == null) { return; } ParticleSystem[] particles = _particles; foreach (ParticleSystem val in particles) { if (!((Object)(object)val == (Object)null)) { EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).enabled = false; val.Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position, float maximumDistance = 3f) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) BlackHoleChargeVfxController blackHoleChargeVfxController = null; float num = maximumDistance; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { BlackHoleChargeVfxController blackHoleChargeVfxController2 = Active[num2]; if ((Object)(object)blackHoleChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)blackHoleChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; blackHoleChargeVfxController = blackHoleChargeVfxController2; } } } blackHoleChargeVfxController?.Cancel(); } } public sealed class BloodHarvestVfxController : MonoBehaviour { public Transform FormationGroup; public Transform GroundRiteGroup; public Transform PulseGroup; public Transform SustainGroup; public Transform ResidualGroup; public Transform[] GroundAnchors; public LineRenderer[] HarvestTethers; public Light RitualLight; public float Radius = 8f; public int PulseCount = 5; public float PulseInterval = 0.68f; public float Lifetime = 3.48f; private readonly List _targets = new List(); private float _startedAt; private bool _residualStarted; private void OnEnable() { _startedAt = Time.time; _residualStarted = false; CacheTargets(); ProjectGroundAnchors(); SetTethers(enabled: false, 0f); Play(FormationGroup); Play(GroundRiteGroup); Play(PulseGroup); Play(SustainGroup); StopAndClear(ResidualGroup); if ((Object)(object)RitualLight != (Object)null) { ((Behaviour)RitualLight).enabled = true; RitualLight.intensity = 0f; } } private void Update() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; float num2 = Mathf.Max(0f, (float)(PulseCount - 1) * PulseInterval + 0.18f); float num3 = Smooth01(num / 0.28f); float num4 = Smooth01(Mathf.Clamp01((Lifetime - num) / 0.58f)); float num5 = Mathf.Repeat(num, PulseInterval); int num6 = Mathf.FloorToInt(num / PulseInterval); float num7 = ((num6 < PulseCount && num5 < 0.24f) ? Mathf.Sin(Mathf.Clamp01(num5 / 0.24f) * (float)Math.PI) : 0f); num7 = Mathf.Pow(Mathf.Max(0f, num7), 1.45f); if ((Object)(object)GroundRiteGroup != (Object)null) { GroundRiteGroup.localScale = Vector3.one * num3 * num4; GroundRiteGroup.localRotation = Quaternion.identity; } if ((Object)(object)PulseGroup != (Object)null) { PulseGroup.localScale = Vector3.one * (0.96f + num7 * 0.08f); } UpdateTethers(num, num6, num5, num7, num4); if ((Object)(object)RitualLight != (Object)null) { RitualLight.color = Color.Lerp(new Color(0.31f, 0.006f, 0.012f), new Color(0.78f, 0.035f, 0.025f), num7); RitualLight.intensity = num3 * num4 * (0.08f + num7 * 0.48f); } if (!_residualStarted && num >= num2) { _residualStarted = true; StopEmitting(SustainGroup); Play(ResidualGroup); } if (num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void CacheTargets() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) _targets.Clear(); List list = Effects.EnemiesInRange(((Component)this).transform.position, Radius); for (int i = 0; i < list.Count; i++) { if (_targets.Count >= 8) { break; } if ((Object)(object)list[i] != (Object)null) { _targets.Add(list[i]); } } } private void ProjectGroundAnchors() { //IL_0026: 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_003b: 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_0048: 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_005d: 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_0064: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c4: 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_00cb: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (GroundAnchors == null) { return; } for (int i = 0; i < GroundAnchors.Length; i++) { Transform val = GroundAnchors[i]; if (!((Object)(object)val == (Object)null)) { Vector3 val2 = val.position - ((Component)this).transform.position; Vector3 forward = val.forward; Effects.TrySurfaceFrame(((Component)this).transform.position + val2, out var surface, out var normal); Vector3 val3 = Vector3.ProjectOnPlane(forward, normal); if (((Vector3)(ref val3)).sqrMagnitude < 0.001f) { val3 = Vector3.ProjectOnPlane(((Component)this).transform.forward, normal); } if (((Vector3)(ref val3)).sqrMagnitude < 0.001f) { val3 = Vector3.Cross(normal, Vector3.right); } val.SetPositionAndRotation(surface + normal * (0.052f + (float)(i % 4) * 0.009f), Quaternion.LookRotation(((Vector3)(ref val3)).normalized, normal)); } } } private void UpdateTethers(float elapsed, int pulseIndex, float pulseTime, float beat, float fade) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_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_00cf: 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_00fb: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) if (HarvestTethers == null) { return; } bool flag = pulseIndex < PulseCount && pulseTime < 0.26f && beat > 0.015f; Vector3 val = ((Component)this).transform.position + Vector3.up * 0.24f; for (int i = 0; i < HarvestTethers.Length; i++) { LineRenderer val2 = HarvestTethers[i]; Character val3 = ((i < _targets.Count) ? _targets[i] : null); if (!flag || (Object)(object)val3 == (Object)null || val3.IsDead()) { if ((Object)(object)val2 != (Object)null) { ((Renderer)val2).enabled = false; } continue; } ((Renderer)val2).enabled = true; Vector3 centerPoint = val3.GetCenterPoint(); Vector3 val4 = val - centerPoint; Vector3 val5 = Vector3.Cross(((Vector3)(ref val4)).normalized, Vector3.up); if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = Vector3.right; } float num = Smooth01(Mathf.Clamp01(pulseTime / 0.18f)); Vector3 val6 = Vector3.Lerp(centerPoint, val, num); for (int j = 0; j < val2.positionCount; j++) { float num2 = (float)j / (float)(val2.positionCount - 1); float num3 = Mathf.Sin(num2 * (float)Math.PI); float num4 = Mathf.Sin(num2 * 10.4f + elapsed * 9.5f + (float)i * 1.7f) * 0.055f * num3; Vector3 val7 = Vector3.Lerp(centerPoint, val6, num2) + val5 * num4 + Vector3.up * (num3 * (0.08f + 0.025f * (float)(i % 3))); val2.SetPosition(j, val7); } Color endColor = (val2.startColor = ((i % 3 == 0) ? new Color(0.66f, 0.035f, 0.028f, 0.34f * beat * fade) : new Color(0.3f, 0.006f, 0.012f, 0.24f * beat * fade))); endColor.a *= 0.16f; val2.endColor = endColor; } } private void SetTethers(bool enabled, float alpha) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) if (HarvestTethers == null) { return; } LineRenderer[] harvestTethers = HarvestTethers; foreach (LineRenderer val in harvestTethers) { if (!((Object)(object)val == (Object)null)) { ((Renderer)val).enabled = enabled; Color startColor = val.startColor; startColor.a = alpha; val.startColor = startColor; val.endColor = startColor; } } } private static void Play(Transform group) { if (!((Object)(object)group == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { obj.Stop(true, (ParticleSystemStopBehavior)0); obj.Play(true); } } } private static void StopAndClear(Transform group) { if (!((Object)(object)group == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Stop(true, (ParticleSystemStopBehavior)0); } } } private static void StopEmitting(Transform group) { if (!((Object)(object)group == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Stop(true, (ParticleSystemStopBehavior)1); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class BloodHarvestChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public Transform ChargeGroup; public Light ChargeLight; public float Lifetime = 1.28f; private Transform _hand; private float _startedAt; private bool _cancelled; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _hand = FindNearestRightHand(((Component)this).transform.position); _startedAt = Time.time; _cancelled = false; Active.Add(this); if ((Object)(object)ChargeLight != (Object)null) { ChargeLight.intensity = 0f; } if ((Object)(object)ChargeGroup != (Object)null) { ParticleSystem[] componentsInChildren = ((Component)ChargeGroup).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(true); } } } private void OnDisable() { Active.Remove(this); } private void Update() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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) float num = Time.time - _startedAt; if ((Object)(object)_hand != (Object)null) { ((Component)this).transform.position = _hand.position; } float num2 = Smooth01(num / 0.22f); float num3 = Smooth01((num - 0.92f) / 0.28f); float num4 = (_cancelled ? Mathf.Clamp01(1f - num * 4f) : (1f - num3)); if ((Object)(object)ChargeGroup != (Object)null) { float num5 = 0.94f + Mathf.Sin(num * 8.4f) * 0.06f; ChargeGroup.localScale = Vector3.one * Mathf.Max(0.001f, num2 * num4 * num5); ChargeGroup.localRotation = Quaternion.Euler(0f, num * 31f, 0f); } if ((Object)(object)ChargeLight != (Object)null) { ChargeLight.intensity = num2 * num4 * (0.12f + num3 * 0.34f); } if (_cancelled || num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject, _cancelled ? 0.12f : 0.32f); } } public void Cancel() { _cancelled = true; _startedAt = 0f; if ((Object)(object)ChargeGroup != (Object)null) { ParticleSystem[] componentsInChildren = ((Component)ChargeGroup).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) BloodHarvestChargeVfxController bloodHarvestChargeVfxController = null; float num = 4f; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { BloodHarvestChargeVfxController bloodHarvestChargeVfxController2 = Active[num2]; if ((Object)(object)bloodHarvestChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)bloodHarvestChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; bloodHarvestChargeVfxController = bloodHarvestChargeVfxController2; } } } bloodHarvestChargeVfxController?.Cancel(); } private static Transform FindNearestRightHand(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Player val = null; float num = 4f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null) || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)18); } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class BloodstormVfxController : MonoBehaviour { public Transform SweepGroup; public Transform BodyGroup; public Transform GroundGroup; public ParticleSystem PulseSpatter; public ParticleSystem PulseArc; public Transform DissipationGroup; public Light StormLight; public float Lifetime = 1.2f; private Player _player; private Transform _rightHand; private float _startedAt; private int _pulsesEmitted; private bool _ending; private float _endStartedAt; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); BindHand(); _startedAt = Time.time; _pulsesEmitted = 0; _ending = false; BerserkerVfxSupport.Play(SweepGroup); BerserkerVfxSupport.Play(BodyGroup); BerserkerVfxSupport.Play(GroundGroup); BerserkerVfxSupport.StopAndClear(DissipationGroup); if ((Object)(object)StormLight != (Object)null) { StormLight.intensity = 0f; } } private void BindHand() { Animator val = (((Object)(object)_player != (Object)null) ? ((Component)_player).GetComponentInChildren() : null); _rightHand = (((Object)(object)val != (Object)null && val.isHuman) ? val.GetBoneTransform((HumanBodyBones)18) : null); } private void LateUpdate() { //IL_0015: 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_0050: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00ee: 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_00f9: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_player == (Object)null) { _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); BindHand(); } float num = Time.time - _startedAt; Vector3 val = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.position : ((Component)this).transform.position); Quaternion rotation = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.rotation : ((Component)this).transform.rotation); ((Component)this).transform.position = val; if ((Object)(object)BodyGroup != (Object)null) { BodyGroup.position = val + Vector3.up * 0.95f; BodyGroup.rotation = rotation; } if ((Object)(object)GroundGroup != (Object)null) { GroundGroup.position = val + Vector3.up * 0.06f; } if ((Object)(object)SweepGroup != (Object)null) { float num2 = (((Object)(object)_rightHand != (Object)null) ? Mathf.Clamp(_rightHand.position.y - val.y, 0.75f, 1.45f) : 1.05f); SweepGroup.position = val + Vector3.up * num2; SweepGroup.rotation = rotation; } int num3 = Mathf.Clamp(Mathf.FloorToInt((num + 0.192f) / 0.4f), 0, 3); while (_pulsesEmitted < num3) { _pulsesEmitted++; ParticleSystem pulseArc = PulseArc; if (pulseArc != null) { pulseArc.Emit(14); } ParticleSystem pulseSpatter = PulseSpatter; if (pulseSpatter != null) { pulseSpatter.Emit(20); } } if ((Object)(object)StormLight != (Object)null) { ((Component)StormLight).transform.position = val + Vector3.up * 1f; float num4 = BerserkerVfxSupport.Smooth01(num / 0.16f); float num5 = 1f - BerserkerVfxSupport.Smooth01((num - Lifetime) / 0.34f); StormLight.intensity = num4 * num5 * (0.85f + Mathf.Sin(num * 16.4f) * 0.18f); } if (!_ending && num >= Lifetime) { _ending = true; _endStartedAt = Time.time; BerserkerVfxSupport.StopEmitting(SweepGroup); BerserkerVfxSupport.StopEmitting(BodyGroup); BerserkerVfxSupport.StopEmitting(GroundGroup); BerserkerVfxSupport.Play(DissipationGroup); } if (_ending && Time.time - _endStartedAt >= 1.35f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class Casting { private const float ChannelMoveTolerance = 0.4f; private const string MageStaffRequiredMessage = "Equip a magical staff to cast Mage spells"; private const string BerserkerWeaponRequiredMessage = "Equip a two-handed melee weapon to use Berserker abilities"; private static int channelDamageRevision; private static Player _spellReleasePlayer; private static float _suppressStaffProjectileUntil = -999f; private const float StaffProjectileSuppressionWindow = 1.1f; public static bool IsChanneling { get; private set; } public static string ChannelName { get; private set; } public static float ChannelProgress { get; private set; } public static float GestureStartedAt { get; private set; } = -999f; internal static void NotifyEffectiveChannelDamage(Player player, float healthLost) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)Player.m_localPlayer) && !(healthLost <= 0.01f)) { channelDamageRevision++; } } public static void UpdateInput(Player player) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || ((Character)player).IsDead() || IsChanneling || !ClassSystem.HasClass(player) || ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus())) { return; } for (int i = 0; i < 6; i++) { if (NornsConfig.AbilityShortcuts[i] != null) { KeyboardShortcut value = NornsConfig.AbilityShortcuts[i].Value; if (((KeyboardShortcut)(ref value)).IsDown()) { TryCast(player, i); break; } } } } public static float CooldownRemaining(int slot) { return CooldownRemaining(Player.m_localPlayer, slot); } private static float CooldownRemaining(Player player, int slot) { if (slot < 0 || slot >= 6) { return 0f; } long num = ClassSystem.GetCooldownUntilUtc(player, slot) - DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); return Mathf.Max(0f, (float)num / 1000f); } private static void TryCast(Player player, int slot) { Spell spell = Spell.Slot(player, slot); if (spell == null) { return; } int level = ClassSystem.GetLevel(player); if (level < spell.UnlockLevel) { XpSystem.Message(player, $"{spell.Name} requires level {spell.UnlockLevel}"); return; } if (!HasRequiredCastingWeapon(player)) { XpSystem.Message(player, WeaponRequiredMessage(player)); return; } string text = spell.BlockReason?.Invoke(player); if (!string.IsNullOrEmpty(text)) { XpSystem.Message(player, text); } else if (CooldownRemaining(player, slot) > 0f) { XpSystem.Message(player, $"{spell.Name} — {CooldownRemaining(player, slot):0.0}s"); } else if (!HasResource(player, spell)) { XpSystem.Message(player, "Not enough " + spell.ResourceName); } else if (spell.CastTime <= 0f) { Resolve(player, slot, spell, level); } else { ((MonoBehaviour)Plugin.Instance).StartCoroutine(Channel(player, slot, spell, level)); } } private static void Resolve(Player player, int slot, Spell spell, int level) { SpendResource(player, spell); long unixMilliseconds = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + (long)Math.Ceiling(spell.Cooldown * 1000f); ClassSystem.SetCooldownUntilUtc(player, slot, unixMilliseconds); PlayCastAnimation(player, spell.CastTrigger); spell.Cast(player, level); } private static void PlayCastAnimation(Player player, string trigger) { if (string.IsNullOrEmpty(trigger) || (Object)(object)player == (Object)null || (Object)(object)((Character)player).m_zanim == (Object)null) { return; } try { if (trigger == "gpower") { GestureStartedAt = Time.time; } if (trigger == "staff_fireball0") { _spellReleasePlayer = player; _suppressStaffProjectileUntil = Time.time + 1.1f; } ((Character)player).m_zanim.SetTrigger(trigger); } catch { } } internal static bool SuppressStaffProjectile(Attack attack) { if (attack != null && Time.time < _suppressStaffProjectileUntil) { return (object)attack.m_character == _spellReleasePlayer; } return false; } private static IEnumerator Channel(Player player, int slot, Spell spell, int level) { IsChanneling = true; ChannelName = spell.Name; ChannelProgress = 0f; if (spell.HoldChannelPose) { SetChannelPose(player, spell, active: true); } PlayChannelFx(player, spell.ChannelFx); Vector3 anchor = ((Component)player).transform.position; int startingDamageRevision = channelDamageRevision; float elapsed = 0f; bool interrupted = false; string interruptionReason = null; while (elapsed < spell.CastTime) { if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { interrupted = true; interruptionReason = "death"; break; } if (!HasRequiredCastingWeapon(player)) { interrupted = true; interruptionReason = "weapon"; break; } Vector3 val = ((Component)player).transform.position - anchor; val.y = 0f; if (((Vector3)(ref val)).magnitude > 0.4f) { interrupted = true; interruptionReason = "movement"; break; } if (channelDamageRevision != startingDamageRevision) { interrupted = true; interruptionReason = "damage"; break; } elapsed += Time.deltaTime; ChannelProgress = Mathf.Clamp01(elapsed / spell.CastTime); yield return null; } IsChanneling = false; ChannelName = null; ChannelProgress = 0f; if (spell.HoldChannelPose) { SetChannelPose(player, spell, active: false); } if (interrupted) { PlayChannelFx(player, spell.ChannelCancelFx); PlayCastAnimation(player, "attack_abort"); XpSystem.Message(player, interruptionReason switch { "damage" => spell.Name + " interrupted by damage", "movement" => spell.Name + " interrupted by movement", "weapon" => WeaponRequiredMessage(player), _ => spell.Name + " interrupted", }); Plugin.Log.LogDebug((object)(spell.Name + " channel interrupted: " + (interruptionReason ?? "unknown") + ".")); } else if (!HasRequiredCastingWeapon(player)) { XpSystem.Message(player, WeaponRequiredMessage(player)); } else if (!HasResource(player, spell)) { XpSystem.Message(player, "Not enough " + spell.ResourceName); } else { Resolve(player, slot, spell, level); } } private static void PlayChannelFx(Player player, FxKind? cue) { //IL_0020: 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) if (cue.HasValue && !((Object)(object)player == (Object)null)) { SpellFx.PlayShared(cue.Value, ((Component)player).transform.position, Effects.CastOrigin(player)); } } private static bool HasRequiredCastingWeapon(Player player) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //IL_005d: 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_0066: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 if ((Object)(object)player == (Object)null) { return false; } PlayerClass playerClass = ClassSystem.GetClass(player); if (playerClass != PlayerClass.Mage && playerClass != PlayerClass.Berserker) { return true; } ItemData currentWeapon = ((Humanoid)player).GetCurrentWeapon(); if (currentWeapon == null || currentWeapon.m_shared == null) { return false; } SkillType skillType = currentWeapon.m_shared.m_skillType; if (playerClass == PlayerClass.Mage) { if ((int)skillType != 9) { return (int)skillType == 10; } return true; } if (!BerserkerFury.IsMeleeSkill(skillType)) { return false; } ItemType itemType = currentWeapon.m_shared.m_itemType; if ((int)itemType != 14) { return (int)itemType == 22; } return true; } private static string WeaponRequiredMessage(Player player) { if (ClassSystem.GetClass(player) != PlayerClass.Berserker) { return "Equip a magical staff to cast Mage spells"; } return "Equip a two-handed melee weapon to use Berserker abilities"; } private static bool HasResource(Player player, Spell spell) { if (spell.Resource == AbilityResource.Fury) { return BerserkerFury.Has(spell.ResourceCost); } return ((Character)player).HaveEitr(spell.ResourceCost); } private static void SpendResource(Player player, Spell spell) { if (spell.Resource == AbilityResource.Fury) { BerserkerFury.Spend(spell.ResourceCost); } else { ((Character)player).UseEitr(spell.ResourceCost); } } private static void SetChannelPose(Player player, Spell spell, bool active) { if ((Object)(object)player == (Object)null || (Object)(object)((Character)player).m_zanim == (Object)null) { return; } try { ((Character)player).m_zanim.SetBool("staff_charging", active); } catch { } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class CastingDamageInterruptWitnessPatch { private struct DamageState { public Player Player; public float HealthBefore; } private static void Prefix(Character __instance, HitData hit, out DamageState __state) { __state = default(DamageState); Player val = (Player)(object)((__instance is Player) ? __instance : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer) && hit != null && !((Object)(object)((Character)val).m_nview == (Object)null) && ((Character)val).m_nview.IsOwner()) { __state.Player = val; __state.HealthBefore = ((Character)val).GetHealth(); } } private static void Postfix(DamageState __state) { if (!((Object)(object)__state.Player == (Object)null)) { float healthLost = Mathf.Max(0f, __state.HealthBefore - ((Character)__state.Player).GetHealth()); Casting.NotifyEffectiveChannelDamage(__state.Player, healthLost); } } } public static class ClassArt { private class Palette { public Color Inner; public Color Outer; public Color Glow; public Color Core; public Color Accent; } public const int PortraitSize = 512; public const int RingSize = 512; private static readonly Dictionary Palettes = new Dictionary { { PlayerClass.Mage, new Palette { Inner = new Color(0.14f, 0.19f, 0.35f), Outer = new Color(0.02f, 0.03f, 0.07f), Glow = new Color(0.32f, 0.7f, 1f), Core = new Color(0.9f, 0.97f, 1f), Accent = new Color(0.58f, 0.84f, 1f) } }, { PlayerClass.Berserker, new Palette { Inner = new Color(0.3f, 0.075f, 0.045f), Outer = new Color(0.055f, 0.018f, 0.014f), Glow = new Color(1f, 0.18f, 0.06f), Core = new Color(1f, 0.78f, 0.36f), Accent = new Color(0.96f, 0.34f, 0.17f) } } }; private static readonly Palette Fallback = new Palette { Inner = new Color(0.16f, 0.15f, 0.13f), Outer = new Color(0.04f, 0.04f, 0.03f), Glow = new Color(0.95f, 0.75f, 0.35f), Core = new Color(1f, 0.95f, 0.82f), Accent = new Color(0.9f, 0.78f, 0.52f) }; private static readonly Dictionary PortraitCache = new Dictionary(); private static readonly Dictionary RingCache = new Dictionary(); private static readonly HashSet CustomArt = new HashSet(); private static readonly string[] ArtExtensions = new string[3] { ".png", ".jpg", ".jpeg" }; private const float CoreThickness = 0.9f; private const float CoreSoftness = 1.1f; private const float HaloThickness = 1.6f; private const float HaloSoftness = 6.5f; private static readonly float[][] Runes = new float[24][] { new float[12] { 0.35f, 0f, 0.35f, 1f, 0.35f, 0.85f, 0.8f, 0.65f, 0.35f, 0.55f, 0.8f, 0.35f }, new float[12] { 0.2f, 0f, 0.2f, 1f, 0.2f, 1f, 0.8f, 0.72f, 0.8f, 0.72f, 0.8f, 0f }, new float[12] { 0.25f, 0f, 0.25f, 1f, 0.25f, 0.78f, 0.72f, 0.5f, 0.72f, 0.5f, 0.25f, 0.22f }, new float[12] { 0.3f, 0f, 0.3f, 1f, 0.3f, 1f, 0.78f, 0.76f, 0.3f, 0.62f, 0.78f, 0.38f }, new float[16] { 0.25f, 0f, 0.25f, 1f, 0.25f, 1f, 0.72f, 0.84f, 0.72f, 0.84f, 0.25f, 0.55f, 0.25f, 0.55f, 0.78f, 0f }, new float[8] { 0.25f, 0.5f, 0.78f, 1f, 0.25f, 0.5f, 0.78f, 0f }, new float[8] { 0.18f, 0f, 0.82f, 1f, 0.18f, 1f, 0.82f, 0f }, new float[12] { 0.28f, 0f, 0.28f, 1f, 0.28f, 1f, 0.76f, 0.78f, 0.76f, 0.78f, 0.28f, 0.56f }, new float[12] { 0.24f, 0f, 0.24f, 1f, 0.76f, 0f, 0.76f, 1f, 0.24f, 0.66f, 0.76f, 0.34f }, new float[8] { 0.3f, 0f, 0.3f, 1f, 0.1f, 0.32f, 0.88f, 0.72f }, new float[4] { 0.5f, 0f, 0.5f, 1f }, new float[16] { 0.3f, 0.55f, 0.55f, 0.82f, 0.55f, 0.82f, 0.3f, 1f, 0.7f, 0.45f, 0.45f, 0.18f, 0.45f, 0.18f, 0.7f, 0f }, new float[12] { 0.38f, 0.08f, 0.38f, 0.92f, 0.38f, 0.92f, 0.76f, 1f, 0.38f, 0.08f, 0.02f, 0f }, new float[12] { 0.3f, 0f, 0.3f, 1f, 0.3f, 1f, 0.76f, 0.82f, 0.3f, 0f, 0.76f, 0.18f }, new float[12] { 0.5f, 0f, 0.5f, 1f, 0.5f, 0.68f, 0.14f, 1f, 0.5f, 0.68f, 0.86f, 1f }, new float[12] { 0.76f, 1f, 0.3f, 0.74f, 0.3f, 0.74f, 0.72f, 0.4f, 0.72f, 0.4f, 0.24f, 0f }, new float[12] { 0.5f, 0f, 0.5f, 1f, 0.5f, 1f, 0.18f, 0.68f, 0.5f, 1f, 0.82f, 0.68f }, new float[20] { 0.28f, 0f, 0.28f, 1f, 0.28f, 1f, 0.74f, 0.8f, 0.74f, 0.8f, 0.28f, 0.54f, 0.28f, 0.54f, 0.74f, 0.3f, 0.74f, 0.3f, 0.28f, 0.06f }, new float[16] { 0.24f, 0f, 0.24f, 1f, 0.76f, 0f, 0.76f, 1f, 0.24f, 1f, 0.5f, 0.62f, 0.5f, 0.62f, 0.76f, 1f }, new float[16] { 0.18f, 0f, 0.18f, 1f, 0.82f, 0f, 0.82f, 1f, 0.18f, 1f, 0.82f, 0.46f, 0.82f, 1f, 0.18f, 0.46f }, new float[8] { 0.34f, 0f, 0.34f, 1f, 0.34f, 1f, 0.76f, 0.7f }, new float[16] { 0.5f, 0.05f, 0.86f, 0.5f, 0.86f, 0.5f, 0.5f, 0.95f, 0.5f, 0.95f, 0.14f, 0.5f, 0.14f, 0.5f, 0.5f, 0.05f }, new float[16] { 0.18f, 0f, 0.18f, 1f, 0.82f, 0f, 0.82f, 1f, 0.18f, 0f, 0.82f, 1f, 0.18f, 1f, 0.82f, 0f }, new float[24] { 0.5f, 1f, 0.82f, 0.62f, 0.82f, 0.62f, 0.5f, 0.32f, 0.5f, 0.32f, 0.18f, 0.62f, 0.18f, 0.62f, 0.5f, 1f, 0.5f, 0.32f, 0.84f, 0f, 0.5f, 0.32f, 0.16f, 0f } }; public static bool IsCustom(PlayerClass cls) { Portrait(cls); return CustomArt.Contains(cls); } public static Color AccentOf(PlayerClass cls) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return PaletteOf(cls).Accent; } private static Palette PaletteOf(PlayerClass cls) { if (!Palettes.TryGetValue(cls, out var value)) { return Fallback; } return value; } public static Texture2D Portrait(PlayerClass cls) { if (PortraitCache.TryGetValue(cls, out var value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = LoadOverride(cls); if ((Object)(object)val != (Object)null) { CustomArt.Add(cls); } else { val = BuildPortrait(cls); } PortraitCache[cls] = val; return val; } private static Texture2D LoadOverride(PlayerClass cls) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return null; } string path = Path.Combine(directoryName, "art"); string text = cls.ToString().ToLowerInvariant(); string[] artExtensions = ArtExtensions; foreach (string text2 in artExtensions) { string text3 = Path.Combine(path, text + text2); if (File.Exists(text3)) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (TryLoadImage(val, File.ReadAllBytes(text3))) { ((Texture)val).wrapMode = (TextureWrapMode)1; Plugin.Log.LogInfo((object)$"Illustrazione personalizzata caricata per {cls}: {text3}"); return val; } } } return null; } catch (Exception ex) { Plugin.Log.LogWarning((object)$"Illustrazione personalizzata per {cls} non caricata: {ex.Message}"); return null; } } internal static bool TryLoadImage(Texture2D texture, byte[] data) { MethodInfo methodInfo = Type.GetType("UnityEngine.ImageConversion, UnityEngine.ImageConversionModule")?.GetMethod("LoadImage", BindingFlags.Static | BindingFlags.Public, null, new Type[2] { typeof(Texture2D), typeof(byte[]) }, null); if (methodInfo == null) { return false; } return (bool)methodInfo.Invoke(null, new object[2] { texture, data }); } private static Texture2D BuildPortrait(PlayerClass cls) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_0145: 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) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) Palette palette = PaletteOf(cls); int num = 512; float[] array = new float[num * num]; float[] array2 = new float[num * num]; DrawStave(array, array2, num, cls); Color[] array3 = (Color[])(object)new Color[num * num]; float num2 = (float)num * 0.5f; Random random = new Random((int)(7411 + cls)); for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { int num3 = i * num + j; float num4 = ((float)j + 0.5f - num2) / num2; float num5 = ((float)i + 0.5f - num2) / num2; float num6 = Mathf.Sqrt(num4 * num4 + num5 * num5); Color val = Color.Lerp(palette.Inner, palette.Outer, Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num6))); float num7 = Mathf.Clamp01(1f - 0.55f * num6 * num6); val *= num7; array3[num3] = val; } } ScatterStars(array3, num, random, palette); for (int k = 0; k < array3.Length; k++) { Color val2 = array3[k]; val2 += palette.Glow * array[k] * 0.85f; val2 = Color.Lerp(val2, palette.Core, array2[k]); val2.a = 1f; array3[k] = val2; } return Finalize(array3, num); } private static void ScatterStars(Color[] pixels, int size, Random random, Palette palette) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //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) int num = size / 3; for (int i = 0; i < num; i++) { int num2 = random.Next(size); int num3 = random.Next(size); float num4 = 0.25f + (float)random.NextDouble() * 0.55f; for (int j = -1; j <= 1; j++) { for (int k = -1; k <= 1; k++) { int num5 = num2 + k; int num6 = num3 + j; if (num5 >= 0 && num6 >= 0 && num5 < size && num6 < size) { float num7 = ((k == 0 && j == 0) ? 1f : 0.25f); ref Color reference = ref pixels[num6 * size + num5]; reference += palette.Core * num4 * num7 * 0.5f; } } } } } public static Texture2D RuneRing(PlayerClass cls) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_008a: 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) if (RingCache.TryGetValue(cls, out var value) && (Object)(object)value != (Object)null) { return value; } Palette palette = PaletteOf(cls); int num = 512; float[] array = new float[num * num]; float[] array2 = new float[num * num]; DrawRing(array, array2, num); Color[] array3 = (Color[])(object)new Color[num * num]; for (int i = 0; i < array3.Length; i++) { float num2 = Mathf.Clamp01(array[i] * 0.8f + array2[i]); if (num2 <= 0.001f) { array3[i] = new Color(0f, 0f, 0f, 0f); continue; } Color val = Color.Lerp(palette.Glow, palette.Core, array2[i]); val.a = num2; array3[i] = val; } Texture2D val2 = Finalize(array3, num); RingCache[cls] = val2; return val2; } private static Texture2D Finalize(Color[] pixels, int size) { //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_0010: 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_001f: 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_002d: Expected O, but got Unknown Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; val.SetPixels(pixels); val.Apply(); return val; } public static Texture2D RuneSheet(int width, int height, Color color, int count, int seed) { //IL_0087: 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_00d0: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown float[] array = new float[width * height]; float[] array2 = new float[width * height]; Random random = new Random(seed); float num = (float)height * 0.2f; Vector2 center = default(Vector2); for (int i = 0; i < count; i++) { ((Vector2)(ref center))..ctor((float)random.NextDouble() * (float)width, Mathf.Lerp((float)height * 0.22f, (float)height * 0.78f, (float)random.NextDouble())); float[] rune = Runes[random.Next(Runes.Length)]; float scale = num * (0.75f + (float)random.NextDouble() * 0.5f); DrawGlyphOn(array, array2, width, height, rune, center, scale); } Color[] array3 = (Color[])(object)new Color[width * height]; for (int j = 0; j < array3.Length; j++) { float a = Mathf.Clamp01(array[j] * 0.7f + array2[j]); Color val = color; val.a = a; array3[j] = val; } Texture2D val2 = new Texture2D(width, height, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; val2.SetPixels(array3); val2.Apply(); return val2; } private static void DrawGlyphOn(float[] halo, float[] core, int width, int height, float[] rune, Vector2 center, float scale) { //IL_0009: 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_003c: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Vector2 a = default(Vector2); Vector2 b = default(Vector2); for (int i = 0; i + 3 < rune.Length; i += 4) { ((Vector2)(ref a))..ctor(center.x + (rune[i] - 0.5f) * scale, center.y + (rune[i + 1] - 0.5f) * scale); ((Vector2)(ref b))..ctor(center.x + (rune[i + 2] - 0.5f) * scale, center.y + (rune[i + 3] - 0.5f) * scale); RasterizeOn(halo, width, height, a, b, 1.6f, 6.5f, 0.75f); RasterizeOn(core, width, height, a, b, 0.9f, 1.1f, 1f); } } private static void RasterizeOn(float[] buffer, int width, int height, Vector2 a, Vector2 b, float thickness, float softness, float intensity) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_004f: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) float num = thickness + softness + 1f; int num2 = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.x, b.x) - num)); int num3 = Mathf.Min(width - 1, Mathf.CeilToInt(Mathf.Max(a.x, b.x) + num)); int num4 = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.y, b.y) - num)); int num5 = Mathf.Min(height - 1, Mathf.CeilToInt(Mathf.Max(a.y, b.y) + num)); for (int i = num4; i <= num5; i++) { for (int j = num2; j <= num3; j++) { float num6 = DistanceToSegment(new Vector2((float)j + 0.5f, (float)i + 0.5f), a, b); float num7 = 1f - Mathf.Clamp01((num6 - thickness) / softness); if (!(num7 <= 0f)) { num7 = num7 * num7 * (3f - 2f * num7) * intensity; int num8 = i * width + j; if (num7 > buffer[num8]) { buffer[num8] = num7; } } } } } private static void DrawStave(float[] halo, float[] core, int size, PlayerClass cls) { //IL_0018: 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_003c: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022b: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0264: 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_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) float num = (float)size * 0.5f; float num2 = size; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num, num); AddCircle(halo, core, size, val, num2 * 0.33f, 96); AddCircle(halo, core, size, val, num2 * 0.31f, 96); AddCircle(halo, core, size, val, num2 * 0.122f, 64); Vector2 val2 = default(Vector2); Vector2 val3 = default(Vector2); for (int i = 0; i < 8; i++) { float num3 = (float)i * (float)Math.PI * 2f / 8f + (float)Math.PI / 8f; ((Vector2)(ref val2))..ctor(Mathf.Cos(num3), Mathf.Sin(num3)); ((Vector2)(ref val3))..ctor(0f - val2.y, val2.x); Vector2 a = val + val2 * (num2 * 0.122f); Vector2 val4 = val + val2 * (num2 * 0.362f); AddSegment(halo, core, size, a, val4); float num4 = num2 * 0.042f; switch (i % 4) { case 0: AddSegment(halo, core, size, val4 - val3 * num4, val4 + val3 * num4); AddSegment(halo, core, size, val4 - val2 * (num2 * 0.042f) - val3 * num4 * 0.6f, val4 - val2 * (num2 * 0.042f) + val3 * num4 * 0.6f); break; case 1: { Vector2 val9 = val2 + val3; AddSegment(halo, core, size, val4, val4 + ((Vector2)(ref val9)).normalized * num4 * 1.4f); val9 = val2 - val3; AddSegment(halo, core, size, val4, val4 + ((Vector2)(ref val9)).normalized * num4 * 1.4f); break; } case 2: { Vector2 val5 = val4 + val2 * num4; Vector2 val6 = val4 + val3 * num4; Vector2 val7 = val4 - val2 * num4; Vector2 val8 = val4 - val3 * num4; AddSegment(halo, core, size, val5, val6); AddSegment(halo, core, size, val6, val7); AddSegment(halo, core, size, val7, val8); AddSegment(halo, core, size, val8, val5); break; } default: AddSegment(halo, core, size, val4, val4 + val3 * num4); AddSegment(halo, core, size, val4 + val3 * num4, val4 + val3 * num4 - val2 * num4); break; } } DrawGlyph(halo, core, size, RuneOf(cls), val, num2 * 0.15f, 0f); } private static float[] RuneOf(PlayerClass cls) { return cls switch { PlayerClass.Mage => Runes[3], PlayerClass.Berserker => Runes[1], _ => Runes[10], }; } private static void DrawGlyph(float[] halo, float[] core, int size, float[] rune, Vector2 center, float scale, float rotation) { //IL_001c: 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_0027: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) float cos = Mathf.Cos(rotation); float sin = Mathf.Sin(rotation); for (int i = 0; i + 3 < rune.Length; i += 4) { Vector2 a = Place(rune[i], rune[i + 1], center, scale, cos, sin); Vector2 b = Place(rune[i + 2], rune[i + 3], center, scale, cos, sin); AddSegment(halo, core, size, a, b); } } private static void DrawRing(float[] halo, float[] core, int size) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) float num = (float)size * 0.5f; float num2 = (float)size * 0.415f; float scale = (float)size * 0.055f; int num3 = Runes.Length; Vector2 center = default(Vector2); for (int i = 0; i < num3; i++) { float num4 = (float)i * (float)Math.PI * 2f / (float)num3 - (float)Math.PI / 2f; ((Vector2)(ref center))..ctor(num + Mathf.Cos(num4) * num2, num + Mathf.Sin(num4) * num2); DrawGlyph(halo, core, size, Runes[i], center, scale, num4 - (float)Math.PI / 2f); } } private static Vector2 Place(float x, float y, Vector2 center, float scale, float cos, float sin) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) float num = (x - 0.5f) * scale; float num2 = (y - 0.5f) * scale; return new Vector2(center.x + num * cos - num2 * sin, center.y + num * sin + num2 * cos); } private static void AddSegment(float[] halo, float[] core, int size, Vector2 a, Vector2 b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_001c: Unknown result type (might be due to invalid IL or missing references) Rasterize(halo, size, a, b, 1.6f, 6.5f, 0.75f); Rasterize(core, size, a, b, 0.9f, 1.1f, 1f); } private static void AddCircle(float[] halo, float[] core, int size, Vector2 center, float radius, int steps) { //IL_0002: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) Vector2 a = default(Vector2); ((Vector2)(ref a))..ctor(center.x + radius, center.y); Vector2 val = default(Vector2); for (int i = 1; i <= steps; i++) { float num = (float)i * (float)Math.PI * 2f / (float)steps; ((Vector2)(ref val))..ctor(center.x + Mathf.Cos(num) * radius, center.y + Mathf.Sin(num) * radius); AddSegment(halo, core, size, a, val); a = val; } } private static void Rasterize(float[] buffer, int size, Vector2 a, Vector2 b, float thickness, float softness, float intensity) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_004d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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_00af: Unknown result type (might be due to invalid IL or missing references) float num = thickness + softness + 1f; int num2 = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.x, b.x) - num)); int num3 = Mathf.Min(size - 1, Mathf.CeilToInt(Mathf.Max(a.x, b.x) + num)); int num4 = Mathf.Max(0, Mathf.FloorToInt(Mathf.Min(a.y, b.y) - num)); int num5 = Mathf.Min(size - 1, Mathf.CeilToInt(Mathf.Max(a.y, b.y) + num)); for (int i = num4; i <= num5; i++) { for (int j = num2; j <= num3; j++) { float num6 = DistanceToSegment(new Vector2((float)j + 0.5f, (float)i + 0.5f), a, b); float num7 = 1f - Mathf.Clamp01((num6 - thickness) / softness); if (!(num7 <= 0f)) { num7 = num7 * num7 * (3f - 2f * num7) * intensity; int num8 = i * size + j; if (num7 > buffer[num8]) { buffer[num8] = num7; } } } } } private static float DistanceToSegment(Vector2 p, Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude; if (sqrMagnitude < 1E-06f) { return Vector2.Distance(p, a); } float num = Mathf.Clamp01(Vector2.Dot(p - a, val) / sqrMagnitude); return Vector2.Distance(p, a + val * num); } } public static class ClassCodexGui { private const float FadeDuration = 0.22f; private static float _openedAt; private static PlayerClass _pendingClass; public static bool IsOpen { get; private set; } public static bool OpenedFromShrine { get; private set; } public static void Toggle() { if (IsOpen) { Close(); } else { Open(fromShrine: false); } } public static void OpenFromShrine() { Open(fromShrine: true); } private static void Open(bool fromShrine) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && ClassSystem.HasClass(localPlayer) && !ClassSelectionGui.IsOpen) { IsOpen = true; OpenedFromShrine = fromShrine; _pendingClass = PlayerClass.None; _openedAt = Time.unscaledTime; GUIManager.BlockInput(true); } } public static void Close() { if (IsOpen) { IsOpen = false; OpenedFromShrine = false; _pendingClass = PlayerClass.None; GUIManager.BlockInput(false); } } public static void UpdateGate(Player player) { if (IsOpen && ((Object)(object)player == (Object)null || !ClassSystem.HasClass(player))) { Close(); } } public static void Draw() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { NornsSkin.EnsureBuilt(); float num = Mathf.Clamp01((Time.unscaledTime - _openedAt) / 0.22f); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, num); NornsSkin.Fill(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), NornsSkin.Backdrop(), Color.white); float num2 = Mathf.Min(980f, (float)Screen.width * 0.94f); float num3 = Mathf.Min(700f, (float)Screen.height * 0.94f); Rect card = default(Rect); ((Rect)(ref card))..ctor(((float)Screen.width - num2) * 0.5f, ((float)Screen.height - num3) * 0.5f, num2, num3); bool enabled = GUI.enabled; if (_pendingClass != PlayerClass.None) { GUI.enabled = false; } DrawCard(card, localPlayer); GUI.enabled = enabled; if (_pendingClass != PlayerClass.None) { DrawClassChangeConfirmation(card, localPlayer, _pendingClass); } GUI.color = color; } } private static void DrawCard(Rect card, Player player) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_0032: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) PlayerClass playerClass = ClassSystem.GetClass(player); int level = ClassSystem.GetLevel(player); Color val = ClassArt.AccentOf(playerClass); NornsSkin.Fill(card, NornsSkin.Panel(), Color.white); NornsSkin.Frame(card, new Color(val.r, val.g, val.b, 0.3f)); NornsSkin.Frame(new Rect(((Rect)(ref card)).x + 3f, ((Rect)(ref card)).y + 3f, ((Rect)(ref card)).width - 6f, ((Rect)(ref card)).height - 6f), new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.22f)); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref card)).x + 22f, ((Rect)(ref card)).y + 22f, ((Rect)(ref card)).width - 44f, ((Rect)(ref card)).height - 44f); float num = (OpenedFromShrine ? (((Rect)(ref val2)).width - 360f) : ((Rect)(ref val2)).width); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y, num, 38f), playerClass.ToString().ToUpperInvariant(), NornsSkin.Title); string text = SpecializationIdentity(player, level); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 34f, num, 20f), text, NornsSkin.Subtitle); if (OpenedFromShrine) { DrawClassTabs(new Rect(((Rect)(ref val2)).xMax - 348f, ((Rect)(ref val2)).y + 4f, 348f, 42f), player, playerClass); } NornsSkin.HorizontalRule(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 58f, ((Rect)(ref val2)).width, 1f), new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.55f)); float num2 = ((Rect)(ref val2)).y + 72f; float num3 = ((Rect)(ref val2)).yMax - num2 - 22f; float num4 = Mathf.Clamp(((Rect)(ref val2)).width * 0.235f, 190f, 220f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(((Rect)(ref val2)).x, num2, num4, num3); DrawIdentity(rect, player, playerClass, level, val); float num5 = ((Rect)(ref rect)).xMax + 18f; DrawSpells(new Rect(num5, num2, ((Rect)(ref val2)).xMax - num5, num3), player, level, val); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).yMax - 18f, ((Rect)(ref val2)).width, 18f), OpenedFromShrine ? $"Reweave class above / {NornsConfig.CodexKey.Value} or Escape to close" : $"{NornsConfig.CodexKey.Value} or Escape to close", NornsSkin.PassiveLine); } private static void DrawClassTabs(Rect rect, Player player, PlayerClass current) { //IL_005d: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_00ea: 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_00f8: 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) PlayerClass[] array = new PlayerClass[2] { PlayerClass.Mage, PlayerClass.Berserker }; float num = (((Rect)(ref rect)).width - 6f * (float)(array.Length - 1)) / (float)array.Length; Rect val = default(Rect); for (int i = 0; i < array.Length; i++) { PlayerClass playerClass = array[i]; ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + (float)i * (num + 6f), ((Rect)(ref rect)).y, num, ((Rect)(ref rect)).height); Color val2 = ClassArt.AccentOf(playerClass); if (playerClass == current) { NornsSkin.Fill(val, NornsSkin.Solid(Color.white), new Color(val2.r, val2.g, val2.b, 0.24f)); } string text = ((playerClass == current) ? (playerClass.ToString().ToUpperInvariant() + " ACTIVE") : playerClass.ToString().ToUpperInvariant()); if (GUI.Button(val, text, NornsSkin.Tab) && playerClass != current) { _pendingClass = playerClass; } NornsSkin.Frame(val, new Color(val2.r, val2.g, val2.b, (playerClass == current) ? 0.6f : 0.25f)); } } private static void DrawClassChangeConfirmation(Rect card, Player player, PlayerClass target) { //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_001f: 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_0059: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: 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_030f: Unknown result type (might be due to invalid IL or missing references) NornsSkin.Fill(card, NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.62f)); float num = Mathf.Min(540f, ((Rect)(ref card)).width - 80f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(((Rect)(ref card)).center.x - num * 0.5f, ((Rect)(ref card)).center.y - 141f, num, 282f); Color val = ClassArt.AccentOf(target); NornsSkin.Fill(rect, NornsSkin.Panel(), Color.white); NornsSkin.Frame(rect, new Color(val.r, val.g, val.b, 0.7f)); NornsSkin.Frame(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.3f)); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + 26f, ((Rect)(ref rect)).y + 26f, ((Rect)(ref rect)).width - 52f, ((Rect)(ref rect)).height - 52f); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y, ((Rect)(ref val2)).width, 36f), "REWEAVE AS " + target.ToString().ToUpperInvariant() + "?", NornsSkin.Title); int levelForClass = ClassSystem.GetLevelForClass(player, target); string text = ((ClassSystem.GetXpForClass(player, target) > 0) ? $"Your saved {target} thread resumes at level {levelForClass}." : $"Your {target} thread begins at level 1."); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 48f, ((Rect)(ref val2)).width, 82f), text + "\nYour current class progress and specialization remain saved. Ability cooldowns are shared between classes.", NornsSkin.CodexCardBody); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 136f, ((Rect)(ref val2)).width, 22f), "Fury and temporary class effects reset.", NornsSkin.PassiveLine); float num2 = (((Rect)(ref val2)).width - 12f) * 0.5f; Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref val2)).x, ((Rect)(ref val2)).yMax - 46f, num2, 42f); Rect val4 = new Rect(((Rect)(ref val3)).xMax + 12f, ((Rect)(ref val3)).y, num2, 42f); if (GUI.Button(val3, "KEEP CURRENT THREAD", NornsSkin.Tab)) { _pendingClass = PlayerClass.None; } if (GUI.Button(val4, "CONFIRM REWEAVE", NornsSkin.Confirm)) { ClassSystem.SetClass(player, target); _pendingClass = PlayerClass.None; _openedAt = Time.unscaledTime; XpSystem.Message(player, $"Your thread is now {target}."); SpellFx.Play(FxKind.LevelUp, ((Component)player).transform.position, ((Component)player).transform.position); } } private static void DrawIdentity(Rect rect, Player player, PlayerClass cls, int level, Color accent) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0038: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) NornsSkin.Fill(rect, NornsSkin.Solid(Color.white), new Color(0.015f, 0.018f, 0.025f, 0.52f)); NornsSkin.Frame(rect, new Color(accent.r, accent.g, accent.b, 0.22f)); float num = Mathf.Min(((Rect)(ref rect)).width - 24f, Mathf.Clamp(((Rect)(ref rect)).height * 0.34f, 132f, 184f)); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + (((Rect)(ref rect)).width - num) * 0.5f, ((Rect)(ref rect)).y + 12f, num, num); NornsSkin.Fill(new Rect(((Rect)(ref val)).x - num * 0.08f, ((Rect)(ref val)).y - num * 0.08f, num * 1.16f, num * 1.16f), NornsSkin.Disc(), new Color(accent.r, accent.g, accent.b, 0.16f)); GUI.DrawTexture(val, (Texture)(object)ClassArt.Portrait(cls)); NornsSkin.Frame(val, new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.6f)); float num2 = Mathf.Clamp(((Rect)(ref rect)).height * 0.25f, 112f, 140f); Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x + 12f, ((Rect)(ref val)).yMax + 10f, ((Rect)(ref rect)).width - 24f, num2); DrawStanding(rect2, player, cls, level, accent); float num3 = ((Rect)(ref rect2)).yMax + 8f; DrawSpecialization(new Rect(((Rect)(ref rect)).x + 12f, num3, ((Rect)(ref rect)).width - 24f, Mathf.Max(78f, ((Rect)(ref rect)).yMax - num3 - 12f)), player, cls, level); } private static void DrawStanding(Rect rect, Player player, PlayerClass cls, int level, Color accent) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00f4: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) ClassSystem.GetLevelProgress(player, out var intoLevel, out var needed); bool flag = level >= 50; GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 30f), $"Level {level}", NornsSkin.ClassName); Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 34f, ((Rect)(ref rect)).width, 6f); NornsSkin.Fill(rect2, NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.55f)); float num = (flag ? 1f : ((needed > 0) ? Mathf.Clamp01((float)intoLevel / (float)needed) : 0f)); if (num > 0f) { NornsSkin.Fill(new Rect(((Rect)(ref rect2)).x, ((Rect)(ref rect2)).y, ((Rect)(ref rect2)).width * num, ((Rect)(ref rect2)).height), NornsSkin.Solid(Color.white), new Color(accent.r, accent.g, accent.b, 0.85f)); } NornsSkin.Frame(rect2, new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.4f)); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 44f, ((Rect)(ref rect)).width, 18f), flag ? "the thread is cut" : $"{intoLevel} / {needed} to level {level + 1}", NornsSkin.PassiveLine); NornsSkin.PassiveLine.normal.textColor = accent; GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 68f, ((Rect)(ref rect)).width, 18f), "Always", NornsSkin.PassiveLine); NornsSkin.PassiveLine.normal.textColor = NornsSkin.Muted; GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 86f, ((Rect)(ref rect)).width, Mathf.Max(26f, ((Rect)(ref rect)).height - 86f)), (cls == PlayerClass.Berserker) ? BerserkerClass.PassiveDescription(level) : MageClass.PassiveDescription(level), NornsSkin.CodexCardBody); } private static void DrawSpecialization(Rect rect, Player player, PlayerClass cls, int level) { //IL_000d: 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) if (cls == PlayerClass.Berserker) { DrawBerserkerSpecialization(rect, player, level); } else { DrawMageSpecialization(rect, player, level); } } private static void DrawMageSpecialization(Rect rect, Player player, int level) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0042: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) MageSpecialization mageSpecialization = ClassSystem.GetMageSpecialization(player); Color val = MageSpecializations.AccentOf(mageSpecialization); NornsSkin.PassiveLine.normal.textColor = ((mageSpecialization == MageSpecialization.None) ? NornsSkin.GoldBright : val); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 18f), (mageSpecialization == MageSpecialization.None) ? "SPECIALIZATION" : MageSpecializations.NameOf(mageSpecialization).ToUpperInvariant(), NornsSkin.PassiveLine); NornsSkin.PassiveLine.normal.textColor = NornsSkin.Muted; if (level < 50) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 22f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 22f), $"The final thread unlocks at level {50}.", NornsSkin.CodexCardBody); return; } if (!OpenedFromShrine) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 22f, ((Rect)(ref rect)).width, Mathf.Min(50f, ((Rect)(ref rect)).height - 22f)), MageSpecializations.DescriptionOf(mageSpecialization), NornsSkin.CodexCardBody); if (mageSpecialization == MageSpecialization.None && ((Rect)(ref rect)).height > 75f) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 73f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 73f), "Visit the Shrine of the Norns to choose.", NornsSkin.CodexCardBody); } return; } float num = (((Rect)(ref rect)).width - 8f) / 3f; Rect val2 = default(Rect); for (int i = 0; i < MageSpecializations.All.Length; i++) { MageSpecialization mageSpecialization2 = MageSpecializations.All[i]; string text = mageSpecialization2 switch { MageSpecialization.Blood => "BLOOD", MageSpecialization.Void => "VOID", _ => "DARK", }; ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + (float)i * (num + 4f), ((Rect)(ref rect)).y + 22f, num, 30f); Color val3 = MageSpecializations.AccentOf(mageSpecialization2); if (mageSpecialization2 == mageSpecialization) { NornsSkin.Fill(val2, NornsSkin.Solid(Color.white), new Color(val3.r, val3.g, val3.b, 0.22f)); } if (GUI.Button(val2, text, NornsSkin.Tab) && ClassSystem.SetMageSpecialization(player, mageSpecialization2)) { XpSystem.Message(player, MageSpecializations.NameOf(mageSpecialization2) + " awakened"); mageSpecialization = mageSpecialization2; } } if (((Rect)(ref rect)).height > 58f) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 58f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 58f), MageSpecializations.DescriptionOf(mageSpecialization), NornsSkin.CodexCardBody); } } private static void DrawBerserkerSpecialization(Rect rect, Player player, int level) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0042: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_01eb: 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) BerserkerSpecialization berserkerSpecialization = ClassSystem.GetBerserkerSpecialization(player); Color val = BerserkerSpecializations.AccentOf(berserkerSpecialization); NornsSkin.PassiveLine.normal.textColor = ((berserkerSpecialization == BerserkerSpecialization.None) ? NornsSkin.GoldBright : val); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 18f), (berserkerSpecialization == BerserkerSpecialization.None) ? "SPECIALIZATION" : BerserkerSpecializations.NameOf(berserkerSpecialization).ToUpperInvariant(), NornsSkin.PassiveLine); NornsSkin.PassiveLine.normal.textColor = NornsSkin.Muted; if (level < 50) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 22f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 22f), $"The final thread unlocks at level {50}.", NornsSkin.CodexCardBody); return; } if (!OpenedFromShrine) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 22f, ((Rect)(ref rect)).width, Mathf.Min(50f, ((Rect)(ref rect)).height - 22f)), BerserkerSpecializations.DescriptionOf(berserkerSpecialization), NornsSkin.CodexCardBody); if (berserkerSpecialization == BerserkerSpecialization.None && ((Rect)(ref rect)).height > 75f) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 73f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 73f), "Visit the Shrine of the Norns to choose.", NornsSkin.CodexCardBody); } return; } float num = (((Rect)(ref rect)).width - 8f) / 3f; Rect val2 = default(Rect); for (int i = 0; i < BerserkerSpecializations.All.Length; i++) { BerserkerSpecialization berserkerSpecialization2 = BerserkerSpecializations.All[i]; ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + (float)i * (num + 4f), ((Rect)(ref rect)).y + 22f, num, 30f); Color val3 = BerserkerSpecializations.AccentOf(berserkerSpecialization2); if (berserkerSpecialization2 == berserkerSpecialization) { NornsSkin.Fill(val2, NornsSkin.Solid(Color.white), new Color(val3.r, val3.g, val3.b, 0.22f)); } if (GUI.Button(val2, BerserkerSpecializations.ShortNameOf(berserkerSpecialization2), NornsSkin.Tab) && ClassSystem.SetBerserkerSpecialization(player, berserkerSpecialization2)) { XpSystem.Message(player, BerserkerSpecializations.NameOf(berserkerSpecialization2) + " awakened"); berserkerSpecialization = berserkerSpecialization2; } } if (((Rect)(ref rect)).height > 58f) { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 58f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height - 58f), BerserkerSpecializations.DescriptionOf(berserkerSpecialization), NornsSkin.CodexCardBody); } } private static void DrawSpells(Rect rect, Player player, int level, Color accent) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) Color val = SpecializationAccent(player, accent); int num = 0; for (int i = 0; i < 6; i++) { Spell spell = Spell.Slot(player, i); if (spell != null && level >= spell.UnlockLevel) { num++; } } GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width * 0.55f, 30f), "ABILITY WEAVE", NornsSkin.CodexSection); GUI.Label(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.45f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width * 0.55f, 30f), $"{num} / {6} THREADS AWAKENED", NornsSkin.CodexCounter); float num2 = ((Rect)(ref rect)).y + 30f + 4f; float num3 = ((Rect)(ref rect)).yMax - num2; float num4 = (((Rect)(ref rect)).width - 10f) * 0.5f; float num5 = (num3 - 20f) / 3f; Rect rect2 = default(Rect); for (int j = 0; j < 6; j++) { int num6 = j % 2; int num7 = j / 2; ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x + (float)num6 * (num4 + 10f), num2 + (float)num7 * (num5 + 10f), num4, num5); Spell spell2 = Spell.Slot(player, j); if (spell2 == null) { DrawFinalThread(rect2, player, level); } else { DrawSpellEntry(rect2, spell2, level, (j < 5) ? accent : val); } } } private static void DrawSpellEntry(Rect rect, Spell spell, int level, Color accent) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: 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_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) bool flag = level >= spell.UnlockLevel; DrawSpellCard(rect, flag, accent); float num = Mathf.Clamp(((Rect)(ref rect)).height * 0.075f, 7f, 11f); float num2 = Mathf.Clamp(((Rect)(ref rect)).height * 0.43f, 48f, 62f); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + num, ((Rect)(ref rect)).y + num, num2, num2); Texture2D val2 = SpellIcons.For(spell); NornsSkin.Fill(val, NornsSkin.Solid(Color.white), new Color(0.02f, 0.025f, 0.035f, 0.96f)); if ((Object)(object)val2 != (Object)null) { Color color = GUI.color; GUI.color = (flag ? new Color(1f, 1f, 1f, color.a) : new Color(0.36f, 0.38f, 0.42f, color.a * 0.58f)); GUI.DrawTexture(val, (Texture)(object)val2); GUI.color = color; } NornsSkin.Frame(val, flag ? new Color(accent.r, accent.g, accent.b, 0.65f) : new Color(1f, 1f, 1f, 0.1f)); Rect val3 = new Rect(((Rect)(ref val)).x - 3f, ((Rect)(ref val)).y - 3f, 25f, 25f); NornsSkin.Fill(val3, NornsSkin.Disc(), (Color)(flag ? accent : new Color(0.35f, 0.35f, 0.37f))); GUI.Label(val3, spell.UnlockLevel.ToString(), NornsSkin.BadgeText); float num3 = ((Rect)(ref val)).xMax + 10f; float num4 = ((Rect)(ref rect)).xMax - num3 - num; NornsSkin.CodexSpellName.normal.textColor = (Color)(flag ? NornsSkin.Parchment : new Color(0.5f, 0.5f, 0.52f)); GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + num - 2f, num4, 21f), spell.Name, NornsSkin.CodexSpellName); string text = (flag ? ($"{spell.Cooldown:0}s cooldown / {spell.ResourceCost:0} {spell.ResourceName.ToLowerInvariant()}" + ((spell.CastTime > 0f) ? $" / {spell.CastTime:0.0}s cast" : " / instant")) : $"unlocks at level {spell.UnlockLevel}"); NornsSkin.CodexStats.normal.textColor = (flag ? accent : NornsSkin.Muted); GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + num + 19f, num4, 17f), text, NornsSkin.CodexStats); float num5 = ((Rect)(ref rect)).y + num + 39f; GUI.Label(new Rect(num3, num5, num4, ((Rect)(ref rect)).yMax - num5 - num), spell.Describe(level), NornsSkin.CodexCardBody); } private static void DrawFinalThread(Rect rect, Player player, int level) { //IL_001d: 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_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_0083: 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_0090: 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_00ab: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_0232: Unknown result type (might be due to invalid IL or missing references) bool flag = level >= 50; PlayerClass playerClass = ClassSystem.GetClass(player); Color val = ((playerClass == PlayerClass.Berserker) ? BerserkerSpecializations.AccentOf(BerserkerSpecialization.None) : MageSpecializations.AccentOf(MageSpecialization.None)); DrawSpellCard(rect, flag, val); float num = Mathf.Clamp(((Rect)(ref rect)).height * 0.075f, 7f, 11f); float num2 = Mathf.Clamp(((Rect)(ref rect)).height * 0.43f, 48f, 62f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + num, ((Rect)(ref rect)).y + num, num2, num2); NornsSkin.Fill(val2, NornsSkin.Disc(), new Color(val.r, val.g, val.b, flag ? 0.22f : 0.08f)); NornsSkin.Frame(val2, new Color(val.r, val.g, val.b, flag ? 0.42f : 0.1f)); GUI.Label(val2, flag ? "?" : 50.ToString(), NornsSkin.ClassName); float num3 = ((Rect)(ref val2)).xMax + 10f; float num4 = ((Rect)(ref rect)).xMax - num3 - num; NornsSkin.CodexSpellName.normal.textColor = (Color)(flag ? NornsSkin.Parchment : new Color(0.5f, 0.5f, 0.52f)); GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + num - 2f, num4, 21f), "Final Thread", NornsSkin.CodexSpellName); NornsSkin.CodexStats.normal.textColor = (flag ? val : NornsSkin.Muted); GUI.Label(new Rect(num3, ((Rect)(ref rect)).y + num + 19f, num4, 17f), flag ? "awaiting specialization" : $"unlocks at level {50}", NornsSkin.CodexStats); float num5 = ((Rect)(ref rect)).y + num + 39f; string text = ((!flag) ? $"Reach the end of the {playerClass}'s path to awaken a specialization ability." : ((!OpenedFromShrine) ? "Visit the Shrine of the Norns to weave your final spell." : ((playerClass == PlayerClass.Berserker) ? "Choose Ravager, Jötunn, or Warlord from the identity panel." : "Choose Void, Blood, or Dark from the identity panel."))); GUI.Label(new Rect(num3, num5, num4, ((Rect)(ref rect)).yMax - num5 - num), text, NornsSkin.CodexCardBody); } private static void DrawSpellCard(Rect rect, bool known, Color accent) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0054: 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_0041: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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) NornsSkin.Fill(rect, NornsSkin.Solid(Color.white), new Color(0.012f, 0.015f, 0.022f, 0.68f)); NornsSkin.Frame(rect, known ? new Color(accent.r, accent.g, accent.b, 0.34f) : new Color(1f, 1f, 1f, 0.08f)); NornsSkin.Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, known ? 3f : 1f, ((Rect)(ref rect)).height), NornsSkin.Solid(Color.white), known ? new Color(accent.r, accent.g, accent.b, 0.72f) : new Color(1f, 1f, 1f, 0.08f)); } private static string SpecializationIdentity(Player player, int level) { if (ClassSystem.GetClass(player) == PlayerClass.Berserker) { BerserkerSpecialization berserkerSpecialization = ClassSystem.GetBerserkerSpecialization(player); if (berserkerSpecialization != BerserkerSpecialization.None) { return $"{BerserkerSpecializations.NameOf(berserkerSpecialization).ToUpperInvariant()} - LEVEL {level}"; } return $"UNWOVEN - LEVEL {level}"; } MageSpecialization mageSpecialization = ClassSystem.GetMageSpecialization(player); if (mageSpecialization != MageSpecialization.None) { return $"{MageSpecializations.NameOf(mageSpecialization).ToUpperInvariant()} - LEVEL {level}"; } return $"UNWOVEN - LEVEL {level}"; } private static Color SpecializationAccent(Player player, Color fallback) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (ClassSystem.GetClass(player) == PlayerClass.Berserker) { return BerserkerSpecializations.AccentOf(ClassSystem.GetBerserkerSpecialization(player)); } if (ClassSystem.GetClass(player) == PlayerClass.Mage) { return MageSpecializations.AccentOf(ClassSystem.GetMageSpecialization(player)); } return fallback; } } public static class ClassSelectionGui { private class ClassInfo { public PlayerClass Class; public string Name; public string Tagline; public string Description; public string PassiveLine; } private const float SettleDelay = 0.8f; private const float FadeDuration = 0.45f; private static float _readySince = -1f; private static float _openedAt; private static int _selected; private static readonly ClassInfo[] Classes = new ClassInfo[2] { new ClassInfo { Class = PlayerClass.Mage, Name = "Mage", Tagline = "Seidr — the craft Odin learned from Freyja", Description = "Eitr runs in your blood from the first day. You carry your own reserve, deepening as you level, and no Mistlands feast is required to spend it.\n\nThen, one every ten winters, the words come to you.", PassiveLine = "From level 1 · Seidr Blood" }, new ClassInfo { Class = PlayerClass.Berserker, Name = "Berserker", Tagline = "Uruz — strength that refuses the yoke", Description = "Battle wakes the beast beneath your skin. Melee wounds dealt and hostile blows endured become Fury, sharpening every physical strike until the fighting stops.\n\nIts abilities demand a two-handed melee weapon. At every tenth level, wrath learns a new shape.", PassiveLine = "From level 1 · Wrathbound" } }; public static bool IsOpen { get; private set; } public static void NotifySpawned() { _readySince = -1f; } public static void UpdateGate(Player player) { if ((Object)(object)player == (Object)null) { _readySince = -1f; } else if (ClassSystem.HasClass(player)) { if (IsOpen) { Close(); } _readySince = -1f; } else if (!IsOpen) { if (!WorldReady(player)) { _readySince = -1f; } else if (_readySince < 0f) { _readySince = Time.unscaledTime; } else if (!(Time.unscaledTime - _readySince < 0.8f)) { Open(); } } } private static bool WorldReady(Player player) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZNetScene.instance == (Object)null || ZNetScene.instance.InLoadingScreen()) { return false; } if (!ZNetScene.instance.IsAreaReady(((Component)player).transform.position)) { return false; } if ((Object)(object)Hud.instance == (Object)null) { return false; } if ((Object)(object)Hud.instance.m_loadingScreen != (Object)null && Hud.instance.m_loadingScreen.alpha > 0.01f) { return false; } if ((Object)(object)Game.instance == (Object)null || Game.instance.WaitingForRespawn()) { return false; } if (((Character)player).InIntro() || ((Character)player).IsTeleporting()) { return false; } return true; } private static void Open() { if (!IsOpen) { IsOpen = true; _selected = 0; _openedAt = Time.unscaledTime; GUIManager.BlockInput(true); } } public static void Close() { if (IsOpen) { IsOpen = false; _readySince = -1f; GUIManager.BlockInput(false); } } public static void Draw() { //IL_0036: 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_006b: 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_00db: Unknown result type (might be due to invalid IL or missing references) if (IsOpen) { NornsSkin.EnsureBuilt(); float num = Mathf.Clamp01((Time.unscaledTime - _openedAt) / 0.45f); num = num * num * (3f - 2f * num); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, num); NornsSkin.Fill(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), NornsSkin.Backdrop(), Color.white); float num2 = Mathf.Min(940f, (float)Screen.width * 0.88f); float num3 = Mathf.Min(600f, (float)Screen.height * 0.88f); float num4 = (1f - num) * 24f; DrawCard(new Rect(((float)Screen.width - num2) * 0.5f, ((float)Screen.height - num3) * 0.5f + num4, num2, num3)); GUI.color = color; } } private static void DrawCard(Rect card) { //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_0018: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0179: 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_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_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) ClassInfo classInfo = Classes[_selected]; Color val = ClassArt.AccentOf(classInfo.Class); NornsSkin.Fill(card, NornsSkin.Panel(), Color.white); NornsSkin.Frame(card, new Color(val.r, val.g, val.b, 0.3f)); NornsSkin.Frame(new Rect(((Rect)(ref card)).x + 3f, ((Rect)(ref card)).y + 3f, ((Rect)(ref card)).width - 6f, ((Rect)(ref card)).height - 6f), new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.22f)); float num = 26f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref card)).x + num, ((Rect)(ref card)).y + num, ((Rect)(ref card)).width - num * 2f, ((Rect)(ref card)).height - num * 2f); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y, ((Rect)(ref val2)).width, 42f), "The Norns are weaving your thread", NornsSkin.Title); GUI.Label(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 42f, ((Rect)(ref val2)).width, 22f), "Choose what you will become. Only the Shrine can reweave this thread.", NornsSkin.Subtitle); NornsSkin.HorizontalRule(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y + 74f, ((Rect)(ref val2)).width, 1f), new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.55f)); float num2 = ((Rect)(ref val2)).y + 96f; float num3 = 58f; float num4 = ((Rect)(ref val2)).height - (num2 - ((Rect)(ref val2)).y) - num3 - 18f; float num5 = Mathf.Min(300f, ((Rect)(ref val2)).width * 0.34f); DrawArtColumn(new Rect(((Rect)(ref val2)).x, num2, num5, num4), classInfo, val); float num6 = ((Rect)(ref val2)).x + num5 + 28f; DrawTextColumn(new Rect(num6, num2, ((Rect)(ref val2)).xMax - num6, num4), classInfo, val); DrawConfirmButton(new Rect(((Rect)(ref val2)).x + ((Rect)(ref val2)).width * 0.18f, ((Rect)(ref val2)).yMax - num3 + 6f, ((Rect)(ref val2)).width * 0.64f, 46f), classInfo, val); } private static void DrawArtColumn(Rect rect, ClassInfo info, Color accent) { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_0149: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) Texture2D val = ClassArt.Portrait(info.Class); bool num = ClassArt.IsCustom(info.Class); float num2 = ((Rect)(ref rect)).height - 76f; Rect val2 = default(Rect); if (num) { float num3 = (float)((Texture)val).width / (float)Mathf.Max(1, ((Texture)val).height); float num4 = ((Rect)(ref rect)).width; float num5 = num4 / num3; if (num5 > num2) { num5 = num2; num4 = num5 * num3; } ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + (((Rect)(ref rect)).width - num4) * 0.5f, ((Rect)(ref rect)).y + (num2 - num5) * 0.5f, num4, num5); } else { float num6 = Mathf.Min(((Rect)(ref rect)).width, num2); ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + (((Rect)(ref rect)).width - num6) * 0.5f, ((Rect)(ref rect)).y, num6, num6); } NornsSkin.Fill(new Rect(((Rect)(ref val2)).x - ((Rect)(ref val2)).width * 0.1f, ((Rect)(ref val2)).y - ((Rect)(ref val2)).height * 0.1f, ((Rect)(ref val2)).width * 1.2f, ((Rect)(ref val2)).height * 1.2f), NornsSkin.Disc(), new Color(accent.r, accent.g, accent.b, 0.18f)); GUI.DrawTexture(val2, (Texture)(object)val); if (num) { NornsSkin.Frame(val2, new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.75f)); NornsSkin.Frame(new Rect(((Rect)(ref val2)).x - 4f, ((Rect)(ref val2)).y - 4f, ((Rect)(ref val2)).width + 8f, ((Rect)(ref val2)).height + 8f), new Color(accent.r, accent.g, accent.b, 0.35f)); } else { NornsSkin.Frame(val2, new Color(accent.r, accent.g, accent.b, 0.45f)); Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(Time.unscaledTime * 5f, ((Rect)(ref val2)).center); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, color.a * 0.9f); GUI.DrawTexture(val2, (Texture)(object)ClassArt.RuneRing(info.Class)); GUI.color = color; GUI.matrix = matrix; } GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + num2 + 6f, ((Rect)(ref rect)).width, 32f), info.Name, NornsSkin.ClassName); float num7 = ((Rect)(ref rect)).y + num2; NornsSkin.PassiveLine.normal.textColor = accent; GUI.Label(new Rect(((Rect)(ref rect)).x, num7 + 38f, ((Rect)(ref rect)).width, 20f), info.PassiveLine, NornsSkin.PassiveLine); DrawClassTabs(new Rect(((Rect)(ref rect)).x, num7 + 62f, ((Rect)(ref rect)).width, 26f)); } private static void DrawClassTabs(Rect rect) { //IL_0066: 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) if (Classes.Length < 2) { return; } float num = ((Rect)(ref rect)).width / (float)Classes.Length; Rect val = default(Rect); for (int i = 0; i < Classes.Length; i++) { ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + (float)i * num, ((Rect)(ref rect)).y, num - 4f, ((Rect)(ref rect)).height); GUIStyle tab = NornsSkin.Tab; if (i == _selected) { NornsSkin.Fill(val, NornsSkin.ButtonIdle(), Color.white); } if (GUI.Button(val, Classes[i].Name, tab)) { _selected = i; } } } private static void DrawTextColumn(Rect rect, ClassInfo info, Color accent) { //IL_001a: 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_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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 24f), info.Tagline, NornsSkin.Tagline); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 32f, ((Rect)(ref rect)).width, 92f); GUI.Label(val, info.Description, NornsSkin.Body); float num = ((Rect)(ref val)).yMax + 10f; NornsSkin.HorizontalRule(new Rect(((Rect)(ref rect)).x, num, ((Rect)(ref rect)).width * 0.75f, 1f), new Color(accent.r, accent.g, accent.b, 0.45f)); Spell[] array = Spell.RosterFor(info.Class); float num2 = Mathf.Min(38f, (((Rect)(ref rect)).yMax - num - 14f) / (float)Mathf.Max(1, array.Length)); for (int i = 0; i < array.Length; i++) { DrawSpellRow(new Rect(((Rect)(ref rect)).x, num + 12f + (float)i * num2, ((Rect)(ref rect)).width, num2), array[i], accent); } } private static void DrawSpellRow(Rect row, Spell spell, Color accent) { //IL_0046: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(32f, ((Rect)(ref row)).height - 4f); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref row)).x, ((Rect)(ref row)).y + (((Rect)(ref row)).height - num) * 0.5f, num, num); Texture2D val2 = SpellIcons.For(spell); NornsSkin.Fill(val, NornsSkin.Solid(Color.white), new Color(0.02f, 0.025f, 0.035f, 0.95f)); if ((Object)(object)val2 != (Object)null) { GUI.DrawTexture(val, (Texture)(object)val2); } NornsSkin.Frame(val, new Color(accent.r, accent.g, accent.b, 0.55f)); Rect val3 = new Rect(((Rect)(ref val)).x - 3f, ((Rect)(ref val)).y - 3f, 17f, 17f); NornsSkin.Fill(val3, NornsSkin.Disc(), accent); NornsSkin.HudIconBadge.normal.textColor = NornsSkin.Ink; GUI.Label(val3, spell.UnlockLevel.ToString(), NornsSkin.HudIconBadge); float num2 = ((Rect)(ref val)).xMax + 10f; Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(num2, ((Rect)(ref row)).y, 150f, ((Rect)(ref row)).height); GUI.Label(val4, spell.Name, NornsSkin.SpellName); GUI.Label(new Rect(((Rect)(ref val4)).xMax + 6f, ((Rect)(ref row)).y, ((Rect)(ref row)).xMax - ((Rect)(ref val4)).xMax - 6f, ((Rect)(ref row)).height), spell.Flavor, NornsSkin.SpellFlavor); } private static void DrawConfirmButton(Rect rect, ClassInfo info, Color accent) { //IL_0007: 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_0049: 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_0059: 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_006a: 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_00ca: Unknown result type (might be due to invalid IL or missing references) bool flag = ((Rect)(ref rect)).Contains(Event.current.mousePosition); if (flag) { NornsSkin.Fill(new Rect(((Rect)(ref rect)).x - 10f, ((Rect)(ref rect)).y - 10f, ((Rect)(ref rect)).width + 20f, ((Rect)(ref rect)).height + 20f), NornsSkin.Disc(), new Color(accent.r, accent.g, accent.b, 0.12f)); } if (GUI.Button(rect, "Become a " + info.Name, NornsSkin.Confirm)) { Confirm(info.Class); } NornsSkin.Frame(rect, new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, flag ? 0.85f : 0.45f)); } private static void Confirm(PlayerClass cls) { //IL_0039: 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) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { ClassSystem.SetClass(localPlayer, cls); Close(); XpSystem.Message(localPlayer, $"You are a {cls}."); SpellFx.Play(FxKind.LevelUp, ((Component)localPlayer).transform.position, ((Component)localPlayer).transform.position); } } } public enum PlayerClass { None, Mage, Berserker, RetiredArcher } public enum BerserkerSpecialization { None, Ravager, Jotunn, Warlord } public enum MageSpecialization { None, Void, Blood, Dark } public static class ClassSystem { public const int MaxLevel = 50; public const string KeyClass = "norns_class"; public const string KeyXp = "norns_xp"; public const string KeyMilestones = "norns_milestones"; public const string KeyMageXp = "norns_mage_xp"; public const string KeyMageMilestones = "norns_mage_milestones"; public const string KeyBerserkerXp = "norns_berserker_xp"; public const string KeyBerserkerMilestones = "norns_berserker_milestones"; public const string KeyRetiredArcherXp = "norns_archer_xp"; public const string KeyRetiredArcherMilestones = "norns_archer_milestones"; public const string KeyProgressMigrated = "norns_progress_migrated"; public const string KeyMageSpecialization = "norns_mage_specialization"; public const string KeyBerserkerSpecialization = "norns_berserker_specialization"; public const string KeyRetiredArcherSpecialization = "norns_archer_specialization"; public const string KeyCooldownPrefix = "norns_cooldown_"; private static readonly int[] CumulativeXp = BuildCurve(); private static int[] BuildCurve() { int[] array = new int[51]; array[0] = 0; array[1] = 0; for (int i = 1; i < 50; i++) { array[i + 1] = array[i] + XpToNext(i); } return array; } public static int XpToNext(int level) { if (level < 1) { level = 1; } if (level >= 50) { return 0; } return Mathf.RoundToInt(10f * Mathf.Pow((float)level, 1.6f)); } public static int TotalXpForLevel(int level) { level = Mathf.Clamp(level, 1, 50); return CumulativeXp[level]; } public static PlayerClass GetClass(Player player) { if (!TryGet(player, "norns_class", out var value)) { return PlayerClass.None; } if (!int.TryParse(value, out var result)) { return PlayerClass.None; } PlayerClass playerClass = (PlayerClass)result; if (!IsRetired(playerClass)) { return playerClass; } return PlayerClass.None; } public static bool IsRetired(PlayerClass cls) { return cls == PlayerClass.RetiredArcher; } public static bool HasClass(Player player) { return GetClass(player) != PlayerClass.None; } public static void SetClass(Player player, PlayerClass cls) { if (!((Object)(object)player == (Object)null) && cls != PlayerClass.None && !IsRetired(cls) && Enum.IsDefined(typeof(PlayerClass), cls)) { PlayerClass playerClass = GetClass(player); EnsureProgressMigrated(player, playerClass); int num = (int)cls; Set(player, "norns_class", num.ToString()); EnsureProgressMigrated(player, cls); BerserkerClass.ResetState(player); BerserkerSpecializations.ResetState(player); BerserkerFury.Reset(player); PassiveEffects.ClearTemporary(player); PassiveEffects.RefreshForClass(player); Plugin.Log.LogInfo((object)$"Classe impostata: {playerClass} -> {cls} per {player.GetPlayerName()}"); } } public static MageSpecialization GetMageSpecialization(Player player) { if (GetClass(player) != PlayerClass.Mage) { return MageSpecialization.None; } if (!TryGet(player, "norns_mage_specialization", out var value)) { return MageSpecialization.None; } if (!int.TryParse(value, out var result)) { return MageSpecialization.None; } if (!Enum.IsDefined(typeof(MageSpecialization), result)) { return MageSpecialization.None; } return (MageSpecialization)result; } public static bool SetMageSpecialization(Player player, MageSpecialization specialization) { if ((Object)(object)player == (Object)null || GetClass(player) != PlayerClass.Mage) { return false; } if (GetLevel(player) < 50) { return false; } if (specialization == MageSpecialization.None) { return false; } int num = (int)specialization; Set(player, "norns_mage_specialization", num.ToString()); Plugin.Log.LogInfo((object)$"Specializzazione del Mago impostata: {specialization} per {player.GetPlayerName()}"); return true; } public static BerserkerSpecialization GetBerserkerSpecialization(Player player) { if (GetClass(player) != PlayerClass.Berserker) { return BerserkerSpecialization.None; } if (!TryGet(player, "norns_berserker_specialization", out var value)) { return BerserkerSpecialization.None; } if (!int.TryParse(value, out var result)) { return BerserkerSpecialization.None; } if (!Enum.IsDefined(typeof(BerserkerSpecialization), result)) { return BerserkerSpecialization.None; } return (BerserkerSpecialization)result; } public static bool SetBerserkerSpecialization(Player player, BerserkerSpecialization specialization) { if ((Object)(object)player == (Object)null || GetClass(player) != PlayerClass.Berserker) { return false; } if (GetLevel(player) < 50) { return false; } if (specialization == BerserkerSpecialization.None) { return false; } int num = (int)specialization; Set(player, "norns_berserker_specialization", num.ToString()); Plugin.Log.LogInfo((object)$"Specializzazione del Berserker impostata: {specialization} per {player.GetPlayerName()}"); return true; } public static int GetXp(Player player) { return GetXpForClass(player, GetClass(player)); } public static int GetXpForClass(Player player, PlayerClass cls) { EnsureProgressMigrated(player, GetClass(player)); string text = XpKey(cls); if (text == null || !TryGet(player, text, out var value)) { return 0; } if (!int.TryParse(value, out var result)) { return 0; } return Mathf.Max(0, result); } public static void SetXp(Player player, int xp) { PlayerClass playerClass = GetClass(player); EnsureProgressMigrated(player, playerClass); string text = XpKey(playerClass); if (text != null) { Set(player, text, Mathf.Max(0, xp).ToString()); } } public static long GetCooldownUntilUtc(Player player, int slot) { if (slot < 0 || slot >= 6) { return 0L; } if (!TryGet(player, "norns_cooldown_" + slot, out var value)) { return 0L; } if (!long.TryParse(value, out var result)) { return 0L; } return result; } public static void SetCooldownUntilUtc(Player player, int slot, long unixMilliseconds) { if (!((Object)(object)player == (Object)null) && slot >= 0 && slot < 6) { Set(player, "norns_cooldown_" + slot, unixMilliseconds.ToString()); } } public static int GetLevel(Player player) { return LevelForXp(GetXp(player)); } public static int GetLevelForClass(Player player, PlayerClass cls) { return LevelForXp(GetXpForClass(player, cls)); } public static int LevelForXp(int xp) { for (int num = 50; num >= 1; num--) { if (xp >= CumulativeXp[num]) { return num; } } return 1; } public static void GetLevelProgress(Player player, out int intoLevel, out int needed) { int xp = GetXp(player); int num = LevelForXp(xp); if (num >= 50) { intoLevel = 0; needed = 0; } else { intoLevel = xp - CumulativeXp[num]; needed = XpToNext(num); } } public static HashSet GetMilestones(Player player) { HashSet hashSet = new HashSet(); PlayerClass playerClass = GetClass(player); EnsureProgressMigrated(player, playerClass); string text = MilestonesKey(playerClass); if (text == null || !TryGet(player, text, out var value) || string.IsNullOrEmpty(value)) { return hashSet; } string[] array = value.Split(new char[1] { ',' }); foreach (string text2 in array) { if (!string.IsNullOrEmpty(text2)) { hashSet.Add(text2); } } return hashSet; } public static void SaveMilestones(Player player, HashSet set) { PlayerClass playerClass = GetClass(player); EnsureProgressMigrated(player, playerClass); string text = MilestonesKey(playerClass); if (text != null) { Set(player, text, string.Join(",", new List(set).ToArray())); } } private static void EnsureProgressMigrated(Player player, PlayerClass activeClass) { if (!((Object)(object)player == (Object)null) && activeClass != PlayerClass.None && !TryGet(player, "norns_progress_migrated", out var value)) { string text = XpKey(activeClass); string text2 = MilestonesKey(activeClass); if (text != null && !TryGet(player, text, out value) && TryGet(player, "norns_xp", out var value2)) { Set(player, text, value2); } if (text2 != null && !TryGet(player, text2, out value) && TryGet(player, "norns_milestones", out var value3)) { Set(player, text2, value3); } Set(player, "norns_progress_migrated", "1"); Plugin.Log.LogInfo((object)$"Progresso legacy assegnato alla classe {activeClass} per {player.GetPlayerName()}"); } } private static string XpKey(PlayerClass cls) { return cls switch { PlayerClass.Mage => "norns_mage_xp", PlayerClass.Berserker => "norns_berserker_xp", _ => null, }; } private static string MilestonesKey(PlayerClass cls) { return cls switch { PlayerClass.Mage => "norns_mage_milestones", PlayerClass.Berserker => "norns_berserker_milestones", _ => null, }; } private static bool TryGet(Player player, string key, out string value) { value = null; if ((Object)(object)player == (Object)null || player.m_customData == null) { return false; } return player.m_customData.TryGetValue(key, out value); } private static void Set(Player player, string key, string value) { if (!((Object)(object)player == (Object)null)) { if (player.m_customData == null) { player.m_customData = new Dictionary(); } player.m_customData[key] = value; } } } public static class DreadVeil { private static Player _player; private static float _activeUntil; public static void Activate(Player player) { if (!((Object)(object)player == (Object)null)) { _player = player; _activeUntil = Time.time + 12f; } } public static bool IsActive(Player player) { if ((Object)(object)player != (Object)null && player == _player && ClassSystem.GetClass(player) == PlayerClass.Mage && ClassSystem.GetMageSpecialization(player) == MageSpecialization.Dark) { return Time.time < _activeUntil; } return false; } public static float ModifySpellDamage(Player player, float damage) { if (!IsActive(player)) { return damage; } return damage * 1.25f; } public static void ReduceIncomingDamage(Player player, float previousHealth, ref float health) { if (IsActive(player) && !(health >= previousHealth)) { float num = previousHealth - health; health = previousHealth - num * 0.75f; } } public static void Clear(Player player) { if (!((Object)(object)player != (Object)null) || player == _player) { _player = null; _activeUntil = 0f; } } } [HarmonyPatch(typeof(Character), "SetHealth")] public static class DreadVeilIncomingDamagePatch { private static void Prefix(Character __instance, ref float health) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer)) { float health2 = ((Character)val).GetHealth(); if (!(health >= health2 - 0.01f)) { DreadVeil.ReduceIncomingDamage(val, health2, ref health); } } } } public sealed class DreadVeilVfxController : MonoBehaviour { public Transform FormationGroup; public Transform VeilGroup; public Transform DissipationGroup; public Transform ShoulderMantleGroup; public ParticleSystem EmpowermentPulse; public Light VeilLight; public float Lifetime = 12f; private ParticleSystem[] _formationParticles; private ParticleSystem[] _veilParticles; private ParticleSystem[] _dissipationParticles; private Transform _anchor; private float _startedAt; private bool _dissolving; private void OnEnable() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) _formationParticles = ParticlesUnder(FormationGroup); _veilParticles = ParticlesUnder(VeilGroup); _dissipationParticles = ParticlesUnder(DissipationGroup); StopAndClear(_formationParticles); StopAndClear(_veilParticles); StopAndClear(_dissipationParticles); _anchor = FindNearestPlayer(((Component)this).transform.position); _startedAt = Time.time; _dissolving = false; Play(_formationParticles); Play(_veilParticles); if ((Object)(object)VeilLight != (Object)null) { VeilLight.intensity = 0f; } } private void LateUpdate() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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) float num = Time.time - _startedAt; float num2 = Lifetime - num; if ((Object)(object)_anchor != (Object)null) { ((Component)this).transform.position = _anchor.position + Vector3.up * 0.96f; ((Component)this).transform.rotation = Quaternion.Euler(0f, _anchor.eulerAngles.y, 0f); } float num3 = Smooth01(num / 0.42f); float num4 = Smooth01(Mathf.Clamp01(num2 / 0.78f)); float num5 = 1f + Mathf.Sin(num * 1.72f) * 0.018f + Mathf.Sin(num * 0.47f + 0.8f) * 0.01f; if ((Object)(object)VeilGroup != (Object)null) { VeilGroup.localScale = new Vector3(num3, num3 * num5, num3); } if ((Object)(object)ShoulderMantleGroup != (Object)null) { ShoulderMantleGroup.localRotation = Quaternion.Euler(Mathf.Sin(num * 0.73f) * 1.4f, Mathf.Sin(num * 0.39f + 1.2f) * 2.1f, Mathf.Sin(num * 0.61f) * 0.9f); } if ((Object)(object)VeilLight != (Object)null) { float num6 = 0.5f + 0.5f * Mathf.Sin(num * 2.15f); VeilLight.intensity = num3 * num4 * (0.16f + num6 * 0.08f); } if ((Object)(object)EmpowermentPulse != (Object)null && num > 1.2f && num2 > 1.1f && Mathf.Repeat(num - 1.2f, 4.1f) < Time.deltaTime) { EmpowermentPulse.Emit(7); } if (!_dissolving && num2 <= 0.72f) { _dissolving = true; StopEmitting(_veilParticles); Play(_dissipationParticles); } if (num >= Lifetime + 0.95f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private static Transform FindNearestPlayer(Vector3 position) { //IL_0026: 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) Transform result = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; result = ((Component)allPlayer).transform; } } } return result; } private static ParticleSystem[] ParticlesUnder(Transform group) { if (!((Object)(object)group == (Object)null)) { return ((Component)group).GetComponentsInChildren(true); } return (ParticleSystem[])(object)new ParticleSystem[0]; } private static void Play(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } private static void StopAndClear(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } private static void StopEmitting(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)1); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class DreadVeilChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public Transform ChargeGroup; public ParticleSystem ReleaseAccent; public Light ChargeLight; public float Lifetime = 2.55f; private Transform _anchor; private float _startedAt; private bool _cancelled; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _anchor = FindNearestChest(((Component)this).transform.position); _startedAt = Time.time; _cancelled = false; Active.Add(this); if ((Object)(object)ChargeGroup != (Object)null) { ParticleSystem[] componentsInChildren = ((Component)ChargeGroup).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(true); } } if ((Object)(object)ChargeLight != (Object)null) { ChargeLight.intensity = 0f; } } private void OnDisable() { Active.Remove(this); } private void LateUpdate() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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) float num = Time.time - _startedAt; if ((Object)(object)_anchor != (Object)null) { ((Component)this).transform.position = _anchor.position; ((Component)this).transform.rotation = Quaternion.Euler(0f, _anchor.eulerAngles.y, 0f); } float num2 = Smooth01(num / 0.34f); float num3 = Smooth01((num - 1.55f) / 0.72f); float num4 = (_cancelled ? Mathf.Clamp01(1f - num * 4.5f) : (1f - Smooth01((num - 2.38f) / 0.17f))); if ((Object)(object)ChargeGroup != (Object)null) { float num5 = 0.97f + Mathf.Sin(num * 4.6f) * 0.025f + num3 * 0.06f; ChargeGroup.localScale = Vector3.one * Mathf.Max(0.001f, num2 * num4 * num5); } if ((Object)(object)ChargeLight != (Object)null) { ChargeLight.intensity = num2 * num4 * (0.06f + num3 * 0.22f); } if ((Object)(object)ReleaseAccent != (Object)null && !_cancelled && num >= 2.27f && num - Time.deltaTime < 2.27f) { ReleaseAccent.Emit(9); } if (_cancelled || num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject, _cancelled ? 0.14f : 0.4f); } } public void Cancel() { _cancelled = true; _startedAt = 0f; if (!((Object)(object)ChargeGroup == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)ChargeGroup).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) DreadVeilChargeVfxController dreadVeilChargeVfxController = null; float num = 4.5f; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { DreadVeilChargeVfxController dreadVeilChargeVfxController2 = Active[num2]; if ((Object)(object)dreadVeilChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)dreadVeilChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; dreadVeilChargeVfxController = dreadVeilChargeVfxController2; } } } dreadVeilChargeVfxController?.Cancel(); } private static Transform FindNearestChest(Vector3 position) { //IL_0029: 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) Player val = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { return ((Component)val).transform; } Transform boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)54); if ((Object)(object)boneTransform == (Object)null) { boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)8); } if (!((Object)(object)boneTransform != (Object)null)) { return ((Component)val).transform; } return boneTransform; } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class EarthshatterDiveVfxController : MonoBehaviour { public Transform DiveGroup; public Transform GroundWarningGroup; public Light DiveLight; private const float MaximumLifetime = 2.6f; private Player _player; private Vector3 _landing; private float _startedAt; public void Initialize(Vector3 landing) { //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) _landing = landing; } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position, 8f); _startedAt = Time.time; if ((Object)(object)GroundWarningGroup != (Object)null) { GroundWarningGroup.position = _landing + Vector3.up * 0.06f; } BerserkerVfxSupport.Play(DiveGroup); BerserkerVfxSupport.Play(GroundWarningGroup); if ((Object)(object)DiveLight != (Object)null) { DiveLight.intensity = 0f; } } private void LateUpdate() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0061: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; Vector3 val = (((Object)(object)_player != (Object)null) ? (((Component)_player).transform.position + Vector3.up * 0.95f) : ((Component)this).transform.position); if ((Object)(object)DiveGroup != (Object)null) { DiveGroup.position = val; Vector3 val2 = _landing - val; if (((Vector3)(ref val2)).sqrMagnitude > 0.04f) { DiveGroup.rotation = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); } } if ((Object)(object)DiveLight != (Object)null) { ((Component)DiveLight).transform.position = val; float num2 = BerserkerVfxSupport.Smooth01(num / 0.14f); DiveLight.intensity = num2 * (1.15f + Mathf.Sin(num * 19f) * 0.2f); } float num3 = (((Object)(object)_player != (Object)null) ? Vector3.Distance(((Component)_player).transform.position, _landing) : 0f); if (num >= 2.6f || (num > 0.1f && num3 < 1.1f)) { BerserkerVfxSupport.StopEmitting(DiveGroup); BerserkerVfxSupport.StopEmitting(GroundWarningGroup); if ((Object)(object)DiveLight != (Object)null) { DiveLight.intensity = 0f; } Object.Destroy((Object)(object)((Component)this).gameObject, 0.55f); ((Behaviour)this).enabled = false; } } } public sealed class EarthshatterImpactVfxController : MonoBehaviour { public Transform ImpactGroup; public Transform FractureGroup; public Transform ResidualGroup; public Light ImpactLight; public float Radius = 10f; private const float TotalLifetime = 4.2f; private float _startedAt; private void OnEnable() { //IL_0048: 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_0092: Unknown result type (might be due to invalid IL or missing references) _startedAt = Time.time; float num = Mathf.Max(0.35f, Radius / 10f); if ((Object)(object)ImpactGroup != (Object)null) { ImpactGroup.localScale = new Vector3(num, Mathf.Lerp(1f, num, 0.55f), num); } if ((Object)(object)FractureGroup != (Object)null) { FractureGroup.localScale = new Vector3(num, 1f, num); } if ((Object)(object)ResidualGroup != (Object)null) { ResidualGroup.localScale = new Vector3(num, 1f, num); } BerserkerVfxSupport.Play(ImpactGroup); BerserkerVfxSupport.Play(FractureGroup); BerserkerVfxSupport.Play(ResidualGroup); if ((Object)(object)ImpactLight != (Object)null) { ImpactLight.intensity = 0f; } } private void LateUpdate() { float num = Time.time - _startedAt; if ((Object)(object)ImpactLight != (Object)null) { float num2 = BerserkerVfxSupport.Flash(num, 0.05f, 0.62f) * 2.1f; ImpactLight.intensity = num2; if (num2 <= 0.001f && ((Behaviour)ImpactLight).enabled) { ((Behaviour)ImpactLight).enabled = false; } } if (num >= 4.2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class Effects { private static readonly HashSet MissingPrefabs = new HashSet(); private static int _characterMask = -1; private static int _aimMask = -1; private static int _surfaceMask = -1; private static int CharacterMask { get { if (_characterMask < 0) { _characterMask = LayerMask.GetMask(new string[4] { "character", "character_net", "character_ghost", "character_noenv" }); } return _characterMask; } } private static int AimMask { get { if (_aimMask < 0) { _aimMask = LayerMask.GetMask(new string[7] { "Default", "static_solid", "Default_small", "piece", "terrain", "character", "character_net" }); } return _aimMask; } } private static int SurfaceMask { get { if (_surfaceMask < 0) { _surfaceMask = LayerMask.GetMask(new string[5] { "Default", "static_solid", "Default_small", "piece", "terrain" }); } return _surfaceMask; } } public static GameObject InstantiateLocal(string prefabName, Vector3 position, Quaternion rotation, float lifetime = 5f) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(prefabName) || (Object)(object)ZNetScene.instance == (Object)null) { return null; } GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)(object)prefab == (Object)null) { if (MissingPrefabs.Add(prefabName)) { Plugin.Log.LogWarning((object)("Prefab locale non trovato: " + prefabName)); } return null; } bool forceDisableInit = ZNetView.m_forceDisableInit; try { ZNetView.m_forceDisableInit = true; GameObject val = Object.Instantiate(prefab, position, rotation); ((Object)val).name = "norns_local_" + prefabName; val.SetActive(true); if (lifetime > 0f) { Object.Destroy((Object)(object)val, lifetime); } return val; } finally { ZNetView.m_forceDisableInit = forceDisableInit; } } public static Vector3 AimDirection(Player player) { //IL_0017: 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_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameCamera.instance != (Object)null) { return ((Component)GameCamera.instance).transform.forward; } if (!((Object)(object)player != (Object)null)) { return Vector3.forward; } return ((Component)player).transform.forward; } public static Vector3 EyePosition(Player player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0023: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return Vector3.zero; } if ((Object)(object)((Character)player).m_eye != (Object)null) { return ((Character)player).m_eye.position; } return ((Component)player).transform.position + Vector3.up * 1.6f; } public static Vector3 CastOrigin(Player player) { //IL_0010: 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) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return Vector3.zero; } Vector3 val = EyePosition(player); Vector3 val2 = AimDirection(player); Vector3 val3 = Vector3.Cross(Vector3.up, val2); Vector3 normalized = ((Vector3)(ref val3)).normalized; return val + val2 * 0.55f + normalized * 0.32f - Vector3.up * 0.28f; } public static Vector3 AimPoint(Player player, float maxDistance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 val = EyePosition(player); Vector3 val2 = AimDirection(player); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, val2, ref val3, maxDistance, AimMask)) { return ((RaycastHit)(ref val3)).point; } return val + val2 * maxDistance; } public static Character AimEnemy(Player player, float maxDistance, float tolerance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00f9: 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_0124: 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_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_0131: 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_0080: 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_014b: 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) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = EyePosition(player); Vector3 val2 = AimDirection(player); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, val2, ref val3, maxDistance, AimMask)) { Character val4 = (((Object)(object)((RaycastHit)(ref val3)).collider != (Object)null) ? ((Component)((RaycastHit)(ref val3)).collider).GetComponentInParent() : null); if ((Object)(object)val4 != (Object)null && !val4.IsDead() && !val4.IsPlayer() && !val4.IsTamed() && BaseAI.IsEnemy(val4, (Character)(object)player)) { return val4; } Character val5 = null; float num = float.MaxValue; foreach (Character item in EnemiesInRange(((RaycastHit)(ref val3)).point, tolerance, (Character)(object)player)) { float num2 = Vector3.Distance(item.GetCenterPoint(), ((RaycastHit)(ref val3)).point); if (!(num2 >= num)) { val5 = item; num = num2; } } if ((Object)(object)val5 != (Object)null) { return val5; } } Character result = null; float num3 = float.MaxValue; foreach (Character item2 in EnemiesInRange(val + val2 * (maxDistance * 0.5f), maxDistance * 0.55f, (Character)(object)player)) { Vector3 val6 = item2.GetCenterPoint() - val; float num4 = Vector3.Dot(val6, val2); if (!(num4 < 0f) && !(num4 > maxDistance)) { Vector3 val7 = val6 - val2 * num4; if (!(((Vector3)(ref val7)).magnitude > tolerance) && !(num4 >= num3)) { result = item2; num3 = num4; } } } return result; } public static Vector3 SurfacePoint(Vector3 point) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) if (!TrySurfaceFrame(point, out var surface, out var _)) { return point; } return surface; } public static bool TrySurfaceFrame(Vector3 point, out Vector3 surface, out Vector3 normal) { //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_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_005b: 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_0063: 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_0068: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(point + Vector3.up * 18f, Vector3.down, ref val, 40f, SurfaceMask, (QueryTriggerInteraction)1)) { surface = ((RaycastHit)(ref val)).point; Vector3 normal2 = ((RaycastHit)(ref val)).normal; Vector3 val2; if (!(((Vector3)(ref normal2)).sqrMagnitude > 0.001f)) { val2 = Vector3.up; } else { normal2 = ((RaycastHit)(ref val)).normal; val2 = ((Vector3)(ref normal2)).normalized; } normal = val2; return true; } surface = point; normal = Vector3.up; return false; } public static Vector3 SafeMovementSurface(Vector3 start, Vector3 direction, float distance) { //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) direction.y = 0f; if (((Vector3)(ref direction)).sqrMagnitude < 0.001f) { return SurfacePoint(start); } ((Vector3)(ref direction)).Normalize(); float num = Mathf.Max(0f, distance); RaycastHit val = default(RaycastHit); if (Physics.SphereCast(start + Vector3.up * 0.6f, 0.35f, direction, ref val, num, SurfaceMask, (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val)).distance - 0.5f); } return SurfacePoint(start + direction * num); } public static List EnemiesInRange(Vector3 center, float radius, Character exclude = null) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) List list = new List(); HashSet hashSet = new HashSet(); Collider[] array = Physics.OverlapSphere(center, radius, CharacterMask); for (int i = 0; i < array.Length; i++) { Character componentInParent = ((Component)array[i]).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && hashSet.Add(componentInParent) && !((Object)(object)componentInParent == (Object)(object)exclude) && !componentInParent.IsDead() && !componentInParent.IsPlayer() && !componentInParent.IsTamed()) { list.Add(componentInParent); } } return list; } public static void DealDamage(Player caster, Character target, DamageTypes damage, string statusEffect = null, float pushForce = 0f, float staggerMultiplier = 1f) { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_005c: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown if (!((Object)(object)caster == (Object)null) && !((Object)(object)target == (Object)null) && !target.IsDead()) { HitData val = new HitData { m_damage = damage, m_point = target.GetCenterPoint() }; Vector3 val2 = ((Component)target).transform.position - ((Component)caster).transform.position; val.m_dir = ((Vector3)(ref val2)).normalized; val.m_ranged = true; val.m_pushForce = pushForce; val.m_staggerMultiplier = staggerMultiplier; val.m_skill = (SkillType)9; val.m_attacker = ((Character)caster).GetZDOID(); HitData val3 = val; if (!string.IsNullOrEmpty(statusEffect)) { val3.m_statusEffectHash = StringExtensionMethods.GetStableHashCode(statusEffect); } target.Damage(val3); } } } public static class EnemyXpCatalog { public const int MaximumKillReward = 1500; public const int FadeLevels = 5; private static readonly Dictionary NativeBiomes = BuildNativeBiomes(); private static readonly HashSet ExcludedPrefabs = new HashSet(StringComparer.OrdinalIgnoreCase) { "Mistile", "Hive", "TheHive", "TentaRoot", "TrainingDummy", "piece_TrainingDummy", "Troll_Summoned", "Charred_Archer_Fader", "Charred_Melee_Fader", "Charred_Twitcher_Summoned", "BogWitchKvastur", "DvergerTest", "Dverger", "DvergerAshlands", "DvergerMage", "DvergerMageFire", "DvergerMageIce", "DvergerMageSupport", "Boar_piggy", "Wolf_cub", "Chicken", "Hen", "Lox_Calf", "Asksvin_hatchling" }; private static readonly Dictionary FixedBaseRewards = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "Boar", 2 }, { "Deer", 2 }, { "Neck", 3 }, { "Hare", 5 }, { "Bat", 18 }, { "Deathsquito", 60 }, { "SeekerBrood", 55 } }; public static bool IsEligible(Character character) { if ((Object)(object)character == (Object)null || character.IsPlayer() || character.IsTamed()) { return false; } return IsEligible(((Object)(object)character.m_nview != (Object)null) ? character.m_nview.GetPrefabName() : ((Object)((Component)character).gameObject).name, ((object)Unsafe.As(ref character.m_faction)/*cast due to .constrained prefix*/).ToString(), isTamed: false); } internal static bool IsEligible(string prefab, string faction, bool isTamed) { if (isTamed || string.IsNullOrEmpty(prefab)) { return false; } prefab = Normalize(prefab); if (ExcludedPrefabs.Contains(prefab)) { return false; } if (string.Equals(faction, "Players", StringComparison.OrdinalIgnoreCase) || string.Equals(faction, "PlayerSpawned", StringComparison.OrdinalIgnoreCase) || string.Equals(faction, "TrainingDummy", StringComparison.OrdinalIgnoreCase) || string.Equals(faction, "Dverger", StringComparison.OrdinalIgnoreCase)) { return false; } if (prefab.IndexOf("TrainingDummy", StringComparison.OrdinalIgnoreCase) >= 0 || prefab.EndsWith("_Summoned", StringComparison.OrdinalIgnoreCase)) { return false; } return true; } public static Biome NativeBiome(string prefab, Biome fallback) { //IL_0008: 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_001e: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(prefab)) { return fallback; } if (!NativeBiomes.TryGetValue(Normalize(prefab), out var value)) { return fallback; } return value; } public static int Reward(Character character, Biome fallback) { //IL_0045: 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) if (!IsEligible(character)) { return 0; } string prefab = (((Object)(object)character.m_nview != (Object)null) ? character.m_nview.GetPrefabName() : ((Object)((Component)character).gameObject).name); return Reward(prefab, character.GetMaxHealth(), character.GetLevel(), character.IsBoss(), NativeBiome(prefab, fallback)); } internal static int Reward(string prefab, float maxHealth, int creatureLevel, bool boss, Biome biome) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) prefab = Normalize(prefab); int num = Mathf.Clamp(creatureLevel - 1, 0, 4); float num2 = Mathf.Max(1f, maxHealth / ((float)num + 1f)); if (!FixedBaseRewards.TryGetValue(prefab, out var value)) { float num3 = BiomeCoefficient(biome); value = Mathf.CeilToInt(Mathf.Sqrt(num2) * num3); } value = (boss ? Mathf.Clamp(value, 100, 600) : Mathf.Clamp(value, 2, 600)); float num4 = 1f + 0.75f * (float)num; return Mathf.Clamp(Mathf.RoundToInt((float)value * num4), 0, 1500); } public static int FullXpLevel(Biome biome) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected I4, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if ((int)biome <= 16) { switch (biome - 1) { default: if ((int)biome != 8) { if ((int)biome != 16) { break; } return 45; } return 20; case 0: return 10; case 1: return 30; case 3: return 40; case 2: break; } } else if ((int)biome <= 64) { if ((int)biome == 32 || (int)biome == 64) { return 50; } } else { if ((int)biome == 256) { return 35; } if ((int)biome == 512) { return 48; } } return 10; } private static float BiomeCoefficient(Biome biome) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 if ((int)biome <= 16) { if ((int)biome <= 4) { if ((int)biome == 2) { return 4.5f; } if ((int)biome == 4) { return 5.5f; } } else { if ((int)biome == 8) { return 2.7f; } if ((int)biome == 16) { return 6.5f; } } } else if ((int)biome <= 64) { if ((int)biome == 32 || (int)biome == 64) { return 10f; } } else { if ((int)biome == 256) { return 6f; } if ((int)biome == 512) { return 8f; } } return 1.2f; } private static Dictionary BuildNativeBiomes() { Dictionary dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); Add(dictionary, (Biome)1, "Boar", "Boar_piggy", "Chicken", "Deer", "Eikthyr", "Greyling", "Hen", "Neck"); Add(dictionary, (Biome)8, "Bjorn", "gd_king", "Ghost", "Greydwarf", "Greydwarf_Elite", "Greydwarf_Shaman", "Skeleton", "Skeleton_Hildir", "Skeleton_Hildir_nochest", "Skeleton_NoArcher", "Skeleton_Poison", "Troll"); Add(dictionary, (Biome)2, "Abomination", "Blob", "BlobElite", "Bonemass", "BogWitchKvastur", "Draugr", "Draugr_Elite", "Draugr_Ranged", "Leech", "Leech_cave", "Surtling", "TentaRoot", "Wraith"); Add(dictionary, (Biome)4, "Bat", "BlobFrost", "Dragon", "Fenring", "Fenring_Cultist", "Fenring_Cultist_Hildir", "Fenring_Cultist_Hildir_nochest", "Hatchling", "StoneGolem", "Ulv", "Wolf", "Wolf_cub"); Add(dictionary, (Biome)16, "BlobTar", "Deathsquito", "Goblin", "Goblin_Gem", "GoblinArcher", "GoblinBrute", "GoblinBrute_Hildir", "GoblinBruteBros", "GoblinKing", "GoblinBruteBros_nochest", "GoblinShaman", "GoblinShaman_Hildir", "GoblinShaman_Hildir_nochest", "Lox", "Lox_Calf", "Unbjorn"); Add(dictionary, (Biome)512, "Dverger", "DvergerMage", "DvergerMageFire", "DvergerMageIce", "DvergerMageSupport", "DvergerTest", "Gjall", "Hare", "Hive", "Mistile", "Seeker", "SeekerBrood", "SeekerBrute", "SeekerQueen", "TheHive", "Tick"); Add(dictionary, (Biome)32, "Asksvin", "Asksvin_hatchling", "BlobLava", "BonemawSerpent", "Charred_Archer", "Charred_Archer_Fader", "Charred_Mage", "Charred_Melee", "Charred_Melee_Dyrnwyn", "Charred_Melee_Fader", "Charred_Twitcher", "Charred_Twitcher_Summoned", "DvergerAshlands", "Fader", "FallenValkyrie", "Morgen", "Morgen_NonSleeping", "Volture"); Add(dictionary, (Biome)256, "Serpent"); return dictionary; } private static void Add(Dictionary map, Biome biome, params string[] prefabs) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) foreach (string key in prefabs) { map[key] = biome; } } private static string Normalize(string prefab) { prefab = prefab ?? string.Empty; if (!prefab.EndsWith("(Clone)", StringComparison.OrdinalIgnoreCase)) { return prefab; } return prefab.Substring(0, prefab.Length - "(Clone)".Length); } } public sealed class ExecutionersWakeVfxController : MonoBehaviour { public Transform WakeGroup; public Transform GroundGroup; public Transform ResidualGroup; public Light WakeLight; public float Range = 7f; private const float TotalLifetime = 2.3f; private Player _player; private Vector3 _origin; private Vector3 _forward = Vector3.forward; private float _startedAt; public void Initialize(Vector3 from, Vector3 to, float range) { //IL_0008: 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_000f: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Range = range; _origin = from; Vector3 val = to - from; val.y = 0f; _forward = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val)).normalized : ((Component)this).transform.forward); } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); _startedAt = Time.time; if (((Vector3)(ref _forward)).sqrMagnitude < 0.0001f) { _forward = ((Component)this).transform.forward; } float num = Mathf.Max(0.35f, Range / 7f); if ((Object)(object)WakeGroup != (Object)null) { WakeGroup.localScale = Vector3.one * num; } if ((Object)(object)GroundGroup != (Object)null) { GroundGroup.localScale = new Vector3(num, 1f, num); } BerserkerVfxSupport.Play(WakeGroup); BerserkerVfxSupport.Play(GroundGroup); BerserkerVfxSupport.Play(ResidualGroup); if ((Object)(object)WakeLight != (Object)null) { WakeLight.intensity = 0f; } } private void LateUpdate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if (num < 0.3f) { Vector3 val = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.position : _origin); Quaternion val2 = Quaternion.LookRotation(_forward, Vector3.up); ((Component)this).transform.SetPositionAndRotation(val, val2); if ((Object)(object)GroundGroup != (Object)null) { GroundGroup.position = val + Vector3.up * 0.05f; } } if ((Object)(object)WakeLight != (Object)null) { WakeLight.intensity = BerserkerVfxSupport.Flash(num, 0.12f, 0.55f) * 1.25f; } if (num >= 2.3f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public sealed class FallOfRagnarokChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public Light EffectLight; public float Lifetime = 2.62f; private ParticleSystem[] _particles; private Transform _handAnchor; private float _startedAt; private float _cancelAt = -1f; private void OnEnable() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) _particles = ((Component)this).GetComponentsInChildren(true); _handAnchor = FindNearestRightHand(((Component)this).transform.position); _startedAt = Time.time; _cancelAt = -1f; Active.Add(this); ParticleSystem[] particles = _particles; foreach (ParticleSystem obj in particles) { obj.Stop(true, (ParticleSystemStopBehavior)0); obj.Play(true); } if ((Object)(object)EffectLight != (Object)null) { EffectLight.intensity = 0f; } } private void OnDisable() { Active.Remove(this); } private void Update() { //IL_0021: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if ((Object)(object)_handAnchor != (Object)null) { Vector3 val = _handAnchor.position + _handAnchor.forward * 0.2f + Vector3.up * 0.03f; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val, 1f - Mathf.Exp((0f - Time.deltaTime) * 22f)); } float num2 = ((_cancelAt < 0f) ? 1f : Mathf.Clamp01(1f - (Time.time - _cancelAt) / 0.18f)); if ((Object)(object)EffectLight != (Object)null) { float num3 = Smooth01(num / 0.55f); float num4 = Smooth01((num - 1.55f) / 0.78f); float num5 = 0.92f + Mathf.Sin(num * 9.4f) * 0.08f; EffectLight.intensity = (num3 * 0.42f + num4 * 0.88f) * num5 * num2; } if (_cancelAt >= 0f) { if (Time.time - _cancelAt >= 0.2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else if (num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void Cancel() { if (!(_cancelAt >= 0f)) { _cancelAt = Time.time; ParticleSystem[] particles = _particles; for (int i = 0; i < particles.Length; i++) { particles[i].Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position, float maximumDistance = 3.5f) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) FallOfRagnarokChargeVfxController fallOfRagnarokChargeVfxController = null; float num = maximumDistance; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { FallOfRagnarokChargeVfxController fallOfRagnarokChargeVfxController2 = Active[num2]; if ((Object)(object)fallOfRagnarokChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)fallOfRagnarokChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; fallOfRagnarokChargeVfxController = fallOfRagnarokChargeVfxController2; } } } fallOfRagnarokChargeVfxController?.Cancel(); } private static Transform FindNearestRightHand(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Player val = null; float num = 4f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null) || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)18); } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class FallOfRagnarokStormVfxController : MonoBehaviour { public Transform SkyOmenGroup; public Transform GroundReadabilityGroup; public Transform AtmosphereGroup; public Light StormLight; public float Lifetime = 5.23f; private float _startedAt; private void OnEnable() { _startedAt = Time.time; Play(SkyOmenGroup); Play(GroundReadabilityGroup); Play(AtmosphereGroup); if ((Object)(object)StormLight != (Object)null) { StormLight.intensity = 0f; } } private void Update() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; float num2 = Lifetime - num; float num3 = Smooth01(num / 0.42f); float num4 = Smooth01(Mathf.Clamp01(num2 / 0.72f)); if ((Object)(object)SkyOmenGroup != (Object)null) { SkyOmenGroup.localRotation = Quaternion.Euler(0f, num * 3.2f + Mathf.Sin(num * 0.72f) * 1.8f, 0f); } if ((Object)(object)StormLight != (Object)null) { float num5 = 0.88f + Mathf.Sin(num * 3.4f) * 0.12f; StormLight.intensity = num3 * num4 * 0.42f * num5; } if (num >= Lifetime + 1.35f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private static void Play(Transform group) { if (!((Object)(object)group == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { obj.Stop(true, (ParticleSystemStopBehavior)0); obj.Play(true); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class FallOfRagnarokBoltVfxController : MonoBehaviour { public Transform TravelGroup; public Transform GroundWarningGroup; public Light BoltLight; private ParticleSystem[] _travelParticles; private ParticleSystem[] _warningParticles; private Vector3 _from; private Vector3 _to; private float _duration; private float _startedAt; private bool _initialized; private void OnEnable() { _travelParticles = ParticlesUnder(TravelGroup); _warningParticles = ParticlesUnder(GroundWarningGroup); StopAndClear(_travelParticles); StopAndClear(_warningParticles); _startedAt = Time.time; _initialized = false; if ((Object)(object)BoltLight != (Object)null) { BoltLight.intensity = 0f; } } public void Initialize(Vector3 from, Vector3 to, float duration) { //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_0008: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) _from = from; _to = to; _duration = Mathf.Max(0.05f, duration); _startedAt = Time.time; _initialized = true; Vector3 val = _to - _from; Vector3 normalized = ((Vector3)(ref val)).normalized; TravelGroup.position = _from; TravelGroup.rotation = Quaternion.LookRotation(normalized, Vector3.up); GroundWarningGroup.position = _to + Vector3.up * 0.07f; GroundWarningGroup.rotation = Quaternion.Euler(90f, 0f, 0f); Play(_travelParticles); Play(_warningParticles); } private void Update() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) if (!_initialized) { if (Time.time - _startedAt > 0.25f) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } float num = Time.time - _startedAt; float num2 = Mathf.Clamp01(num / _duration); float num3 = num2 * num2 * (3f - 2f * num2); TravelGroup.position = Vector3.LerpUnclamped(_from, _to + Vector3.up * 0.12f, num3); if ((Object)(object)BoltLight != (Object)null) { float num4 = Smooth01(num2 / 0.12f); float num5 = Mathf.Sin(num * 51f) * 0.13f; BoltLight.intensity = num4 * Mathf.Max(0f, 1.25f + num5); } if (!(num2 < 1f)) { ParticleSystem[] travelParticles = _travelParticles; for (int i = 0; i < travelParticles.Length; i++) { travelParticles[i].Stop(true, (ParticleSystemStopBehavior)1); } travelParticles = _warningParticles; for (int i = 0; i < travelParticles.Length; i++) { travelParticles[i].Stop(true, (ParticleSystemStopBehavior)1); } if ((Object)(object)BoltLight != (Object)null) { BoltLight.intensity = 0f; } Object.Destroy((Object)(object)((Component)this).gameObject, 0.72f); ((Behaviour)this).enabled = false; } } private static ParticleSystem[] ParticlesUnder(Transform group) { if (!((Object)(object)group == (Object)null)) { return ((Component)group).GetComponentsInChildren(true); } return (ParticleSystem[])(object)new ParticleSystem[0]; } private static void Play(ParticleSystem[] systems) { for (int i = 0; i < systems.Length; i++) { systems[i].Play(true); } } private static void StopAndClear(ParticleSystem[] systems) { for (int i = 0; i < systems.Length; i++) { systems[i].Stop(true, (ParticleSystemStopBehavior)0); } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class FallOfRagnarokImpactVfxController : MonoBehaviour { public Light ImpactLight; public float Lifetime = 2.35f; private float _startedAt; private void OnEnable() { _startedAt = Time.time; ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { obj.Stop(true, (ParticleSystemStopBehavior)0); obj.Play(true); } if ((Object)(object)ImpactLight != (Object)null) { ((Behaviour)ImpactLight).enabled = true; ImpactLight.intensity = 0f; } } private void Update() { float num = Time.time - _startedAt; if ((Object)(object)ImpactLight != (Object)null) { if (num >= 0.62f) { ImpactLight.intensity = 0f; ((Behaviour)ImpactLight).enabled = false; } else { float num2 = Mathf.Exp((0f - num) * 13f) * 3.4f; float num3 = Mathf.Clamp01(1f - num / 0.62f) * 0.28f; ImpactLight.intensity = num2 + num3; } } if (num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public sealed class FireballVfxController : MonoBehaviour { public Transform TravelGroup; public Transform SurfaceFacingGroup; public Transform ImpactGroup; public Transform ResidualGroup; public ParticleSystem FireballSurface; public Light EffectLight; public float ImpactLifetime = 0.82f; private ParticleSystem[] _travelParticles; private ParticleSystem[] _impactParticles; private ParticleSystem[] _residualParticles; private Vector3 _from; private Vector3 _to; private Vector3 _direction; private Camera _camera; private float _duration; private float _startedAt; private float _impactAt; private bool _initialized; private bool _impacted; private void OnEnable() { _travelParticles = ParticlesUnder(TravelGroup); _impactParticles = ParticlesUnder(ImpactGroup); _residualParticles = ParticlesUnder(ResidualGroup); StopAndClear(_travelParticles); StopAndClear(_impactParticles); StopAndClear(_residualParticles); _camera = Camera.main; _startedAt = Time.time; _initialized = false; _impacted = false; if ((Object)(object)EffectLight != (Object)null) { EffectLight.intensity = 0f; } } public void Initialize(Vector3 from, Vector3 to, float duration) { //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_0008: 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_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_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_007c: Unknown result type (might be due to invalid IL or missing references) _from = from; _to = to; _direction = to - from; if (((Vector3)(ref _direction)).sqrMagnitude < 0.0001f) { _direction = Vector3.forward; } ((Vector3)(ref _direction)).Normalize(); _duration = Mathf.Max(0.01f, duration); if ((Object)(object)FireballSurface != (Object)null) { MainModule main = FireballSurface.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(_duration + 0.08f); } _startedAt = Time.time; _initialized = true; _impacted = false; ((Component)this).transform.position = from; ((Component)this).transform.rotation = Quaternion.LookRotation(_direction, Vector3.up); Play(_travelParticles); UpdateSurfaceFacing(); } private void Update() { //IL_0054: 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) if (!_initialized) { if (Time.time - _startedAt > 0.25f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else if (!_impacted) { float num = Time.time - _startedAt; float num2 = Mathf.Clamp01(num / _duration); ((Component)this).transform.position = Vector3.LerpUnclamped(_from, _to, num2); UpdateSurfaceFacing(); if ((Object)(object)EffectLight != (Object)null) { float num3 = Smooth01(num2 / 0.14f); float num4 = Smooth01((num2 - 0.82f) / 0.18f); float num5 = Mathf.Sin(num * 39f) * 0.1f + Mathf.Sin(num * 67f + 0.8f) * 0.055f; EffectLight.intensity = Mathf.Max(0f, num3 * (1.36f + num5 + num4 * 0.34f)); } if (num2 >= 1f) { Impact(); } } else { float num6 = Time.time - _impactAt; if ((Object)(object)EffectLight != (Object)null) { float num7 = Mathf.Exp((0f - num6) * 12f) * 3.1f; float num8 = Mathf.Clamp01(1f - num6 / 0.58f) * 0.38f; EffectLight.intensity = num7 + num8; } if (num6 >= ImpactLifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void Impact() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0086: Unknown result type (might be due to invalid IL or missing references) _impacted = true; _impactAt = Time.time; ((Component)this).transform.position = _to; StopEmitting(_travelParticles); if ((Object)(object)FireballSurface != (Object)null) { FireballSurface.Stop(true, (ParticleSystemStopBehavior)0); } Play(_impactParticles); Play(_residualParticles); Effects.InstantiateLocal("fx_fireball_staff_explosion", _to, Quaternion.LookRotation(_direction, Vector3.up)); SpellAudio.PlayFireballImpact(_to); } private void UpdateSurfaceFacing() { //IL_0042: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00d3: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)SurfaceFacingGroup == (Object)null) { return; } if ((Object)(object)_camera == (Object)null) { _camera = Camera.main; } if (!((Object)(object)_camera == (Object)null)) { Vector3 val = ((Component)_camera).transform.position - ((Component)this).transform.position; if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = -((Component)_camera).transform.forward; } Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, ((Component)_camera).transform.up); float num = Mathf.Max(0f, Time.time - _startedAt); float num2 = num * 76f + Mathf.Sin(num * 6.2f) * 7f; SurfaceFacingGroup.rotation = val2 * Quaternion.AngleAxis(num2, Vector3.forward); } } private static ParticleSystem[] ParticlesUnder(Transform root) { if (!((Object)(object)root == (Object)null)) { return ((Component)root).GetComponentsInChildren(true); } return (ParticleSystem[])(object)new ParticleSystem[0]; } private static void Play(ParticleSystem[] systems) { foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } private static void StopAndClear(ParticleSystem[] systems) { foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } private static void StopEmitting(ParticleSystem[] systems) { foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)1); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class FireballChargeVfxController : MonoBehaviour { private static readonly List Active = new List(); public Light EffectLight; public float Lifetime = 1.25f; private ParticleSystem[] _particles; private Transform _handAnchor; private float _startedAt; private float _cancelAt = -1f; private void OnEnable() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) _particles = ((Component)this).GetComponentsInChildren(true); _startedAt = Time.time; _cancelAt = -1f; _handAnchor = FindNearestRightHand(((Component)this).transform.position); Active.Add(this); ParticleSystem[] particles = _particles; foreach (ParticleSystem val in particles) { if (!((Object)(object)val == (Object)null)) { val.Stop(true, (ParticleSystemStopBehavior)0); val.Play(true); } } } private void OnDisable() { Active.Remove(this); } private void Update() { //IL_0021: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_006a: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if ((Object)(object)_handAnchor != (Object)null) { Vector3 val = _handAnchor.position + _handAnchor.forward * 0.16f; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val, 1f - Mathf.Exp((0f - Time.deltaTime) * 24f)); } if ((Object)(object)EffectLight != (Object)null) { float num2 = Smooth01(num / 0.38f); float num3 = Smooth01((num - 0.72f) / 0.36f); float num4 = ((_cancelAt < 0f) ? 1f : Mathf.Clamp01(1f - (Time.time - _cancelAt) / 0.14f)); EffectLight.intensity = (num2 * 0.56f + num3 * 0.72f) * num4; } if (_cancelAt >= 0f) { if (Time.time - _cancelAt >= 0.16f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } else if (num >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private static Transform FindNearestRightHand(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Player val = null; float num = 3.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null) || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)18); } public void Cancel() { //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) if (_cancelAt >= 0f) { return; } _cancelAt = Time.time; ParticleSystem[] particles = _particles; foreach (ParticleSystem val in particles) { if (!((Object)(object)val == (Object)null)) { EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).enabled = false; val.Stop(true, (ParticleSystemStopBehavior)1); } } } public static void CancelNearest(Vector3 position, float maximumDistance = 3f) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) FireballChargeVfxController fireballChargeVfxController = null; float num = maximumDistance; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { FireballChargeVfxController fireballChargeVfxController2 = Active[num2]; if ((Object)(object)fireballChargeVfxController2 == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)fireballChargeVfxController2).transform.position, position); if (!(num3 >= num)) { num = num3; fireballChargeVfxController = fireballChargeVfxController2; } } } fireballChargeVfxController?.Cancel(); } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class FrostNovaVfxController : MonoBehaviour { public Transform BodyOriginGroup; public Transform ShockfrontGroup; public Transform ResidualGroup; public Light EffectLight; public float Lifetime = 2.45f; public float BodyFollowDuration = 0.22f; private Transform _bodyAnchor; private float _elapsed; private void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) _elapsed = 0f; _bodyAnchor = FindNearestBodyAnchor(((Component)this).transform.position); PositionBodyOrigin(); if ((Object)(object)EffectLight != (Object)null) { EffectLight.intensity = 0f; } PlayGroup(BodyOriginGroup); PlayGroup(ShockfrontGroup); PlayGroup(ResidualGroup); } private void Update() { _elapsed += Time.deltaTime; if (_elapsed <= BodyFollowDuration) { PositionBodyOrigin(); } if ((Object)(object)EffectLight != (Object)null) { float intensity = ((_elapsed < 0.045f) ? Mathf.SmoothStep(0f, 6.2f, _elapsed / 0.045f) : ((!(_elapsed < 0.18f)) ? Mathf.Lerp(1.45f, 0f, Mathf.Clamp01((_elapsed - 0.18f) / 0.62f)) : Mathf.Lerp(6.2f, 1.45f, (_elapsed - 0.045f) / 0.135f))); EffectLight.intensity = intensity; } if (_elapsed >= Lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void PositionBodyOrigin() { //IL_004a: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)BodyOriginGroup == (Object)null)) { if ((Object)(object)_bodyAnchor != (Object)null) { BodyOriginGroup.position = _bodyAnchor.position; BodyOriginGroup.rotation = Quaternion.identity; } else { BodyOriginGroup.localPosition = Vector3.up * 1.05f; BodyOriginGroup.localRotation = Quaternion.identity; } } } private static Transform FindNearestBodyAnchor(Vector3 position) { //IL_0029: 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) Player val = null; float num = 3.25f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; val = allPlayer; } } } if ((Object)(object)val == (Object)null) { return null; } Animator componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { return null; } Transform boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)54); if ((Object)(object)boneTransform == (Object)null) { boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)8); } if ((Object)(object)boneTransform == (Object)null) { boneTransform = componentInChildren.GetBoneTransform((HumanBodyBones)7); } return boneTransform; } private static void PlayGroup(Transform group) { if (!((Object)(object)group == (Object)null)) { ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { obj.Clear(true); obj.Play(true); } } } } public static class HudOverlay { private const float SlotWidth = 96f; private const float SlotHeight = 92f; private const float SlotGap = 8f; private static bool _dragging; private static Vector2 _dragOffset; private static Vector2 _draftAnchor; private static float _draftScale; private static int _capturingSlot = -1; public static bool IsEditing { get; private set; } public static void UpdateInput(Player player) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !ClassSystem.HasClass(player)) { CloseEditor(); } else { if (ClassSelectionGui.IsOpen || ClassCodexGui.IsOpen) { return; } KeyboardShortcut value = NornsConfig.HudEditShortcut.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { if (IsEditing) { CloseEditor(); } else { OpenEditor(); } } else if (IsEditing && _capturingSlot < 0 && Input.GetKeyDown((KeyCode)27)) { CloseEditor(); } } } public static void Shutdown() { CloseEditor(); } private static void OpenEditor() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!IsEditing) { IsEditing = true; _draftAnchor = new Vector2(NornsConfig.HudAnchorX.Value, NornsConfig.HudAnchorY.Value); _draftScale = NornsConfig.HudScale.Value; _capturingSlot = -1; _dragging = false; GUIManager.BlockInput(true); } } private static void CloseEditor() { if (IsEditing) { SaveLayout(); IsEditing = false; _capturingSlot = -1; _dragging = false; GUIManager.BlockInput(false); } } public static void Draw() { //IL_005d: 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_00d7: 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_00dc: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0216: 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_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: 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) if ((!NornsConfig.ShowHud.Value && !IsEditing) || ClassSelectionGui.IsOpen) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && ClassSystem.HasClass(localPlayer) && !((Object)(object)Hud.instance == (Object)null)) { NornsSkin.EnsureBuilt(); PlayerClass cls = ClassSystem.GetClass(localPlayer); int level = ClassSystem.GetLevel(localPlayer); Spell[] array = Spell.RosterFor(localPlayer); Color val = ClassArt.AccentOf(cls); float num = 616f; float num2 = (IsEditing ? _draftScale : NornsConfig.HudScale.Value); Vector2 val2 = (IsEditing ? new Vector2(_draftAnchor.x * (float)Screen.width, _draftAnchor.y * (float)Screen.height) : new Vector2(NornsConfig.HudAnchorX.Value * (float)Screen.width, NornsConfig.HudAnchorY.Value * (float)Screen.height)); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(val2.x - num * num2 * 0.5f, val2.y - 96f * num2, num * num2, 146f * num2); if (IsEditing) { HandleLayoutInput(val3, num); num2 = _draftScale; ((Vector2)(ref val2))..ctor(_draftAnchor.x * (float)Screen.width, _draftAnchor.y * (float)Screen.height); ((Rect)(ref val3))..ctor(val2.x - num * num2 * 0.5f, val2.y - 96f * num2, num * num2, 146f * num2); } Matrix4x4 matrix = GUI.matrix; GUIUtility.ScaleAroundPivot(new Vector2(num2, num2), val2); float num3 = val2.x - num * 0.5f; float num4 = val2.y - 46f; DrawHeader(localPlayer, cls, level, new Rect(num3, num4 - 48f, num, 46f), val); for (int i = 0; i < 6; i++) { DrawSlot(new Rect(num3 + (float)i * 104f, num4, 96f, 92f), accent: (i == 5 && array[i] != null) ? SpecializationAccent(localPlayer, val) : val, slot: i, spell: (i < array.Length) ? array[i] : null, level: level); } if (Casting.IsChanneling) { DrawCastBar(new Rect(num3 + num * 0.15f, num4 - 78f, num * 0.7f, 30f), val); } GUI.matrix = matrix; if (IsEditing) { NornsSkin.Frame(val3, new Color(NornsSkin.GoldBright.r, NornsSkin.GoldBright.g, NornsSkin.GoldBright.b, 0.92f)); DrawEditorPanel(); } } } private static void HandleLayoutInput(Rect bounds, float baseWidth) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; if (current != null) { if ((int)current.type == 0 && current.button == 0 && ((Rect)(ref bounds)).Contains(current.mousePosition)) { _dragging = true; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(_draftAnchor.x * (float)Screen.width, _draftAnchor.y * (float)Screen.height); _dragOffset = current.mousePosition - val; current.Use(); } else if ((int)current.type == 3 && current.button == 0 && _dragging) { Vector2 val2 = current.mousePosition - _dragOffset; float num = baseWidth * _draftScale * 0.5f; float num2 = 146f * _draftScale * 0.5f; val2.x = Mathf.Clamp(val2.x, num + 8f, (float)Screen.width - num - 8f); val2.y = Mathf.Clamp(val2.y, num2 + 8f, (float)Screen.height - num2 - 8f); _draftAnchor = new Vector2(val2.x / (float)Screen.width, val2.y / (float)Screen.height); current.Use(); } else if ((int)current.type == 1 && current.button == 0 && _dragging) { _dragging = false; SaveLayout(); current.Use(); } else if ((int)current.type == 6 && ((Rect)(ref bounds)).Contains(current.mousePosition)) { _draftScale = Mathf.Clamp(_draftScale - current.delta.y * 0.055f, 0.55f, 1.8f); SaveLayout(); current.Use(); } } } private static void DrawEditorPanel() { //IL_003c: 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_0060: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) CaptureShortcutEvent(); float num = Mathf.Min(780f, (float)Screen.width - 32f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(((float)Screen.width - num) * 0.5f, 18f, num, 108f); NornsSkin.Fill(rect, NornsSkin.Panel(), new Color(1f, 1f, 1f, 0.97f)); NornsSkin.Frame(rect, new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.7f)); GUI.Label(new Rect(((Rect)(ref rect)).x + 14f, ((Rect)(ref rect)).y + 8f, ((Rect)(ref rect)).width - 28f, 22f), "ABILITY BAR EDITOR", NornsSkin.HudClass); GUI.Label(new Rect(((Rect)(ref rect)).x + 14f, ((Rect)(ref rect)).y + 29f, ((Rect)(ref rect)).width - 28f, 20f), "Drag the bar · Mouse wheel resizes · Select a slot and press its new combination · F7/Esc closes", NornsSkin.Body); float num2 = 7f; float num3 = (((Rect)(ref rect)).width - 28f - num2 * 6f) / 7f; float num4 = ((Rect)(ref rect)).x + 14f; for (int i = 0; i < 6; i++) { string text = ((_capturingSlot == i) ? $"{i + 1}: press keys…" : $"{i + 1}: {NornsConfig.ShortcutLabel(i)}"); if (GUI.Button(new Rect(num4, ((Rect)(ref rect)).y + 61f, num3, 32f), text, NornsSkin.Tab)) { _capturingSlot = i; } num4 += num3 + num2; } if (GUI.Button(new Rect(num4, ((Rect)(ref rect)).y + 61f, num3, 32f), "RESET", NornsSkin.Tab)) { ResetEditor(); } } private static void CaptureShortcutEvent() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0034: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (_capturingSlot < 0) { return; } Event current = Event.current; if (current != null && (int)current.type == 4) { if ((int)current.keyCode == 27) { _capturingSlot = -1; current.Use(); } else if ((int)current.keyCode != 0 && !IsModifier(current.keyCode)) { List list = new List(); AddModifier(list, (KeyCode)308, current.keyCode); AddModifier(list, (KeyCode)307, current.keyCode); AddModifier(list, (KeyCode)306, current.keyCode); AddModifier(list, (KeyCode)305, current.keyCode); AddModifier(list, (KeyCode)304, current.keyCode); AddModifier(list, (KeyCode)303, current.keyCode); NornsConfig.AbilityShortcuts[_capturingSlot].Value = new KeyboardShortcut(current.keyCode, list.ToArray()); _capturingSlot = -1; current.Use(); } } } private static void AddModifier(List result, KeyCode modifier, KeyCode main) { //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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (modifier != main && Input.GetKey(modifier)) { result.Add(modifier); } } private static bool IsModifier(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 if ((int)key != 308 && (int)key != 307 && (int)key != 306 && (int)key != 305 && (int)key != 304) { return (int)key == 303; } return true; } private static void ResetEditor() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) _draftAnchor = new Vector2(0.5f, 0.82f); _draftScale = 1f; for (int i = 0; i < 6; i++) { NornsConfig.AbilityShortcuts[i].Value = NornsConfig.DefaultAbilityShortcut(i); } SaveLayout(); } private static void SaveLayout() { if (NornsConfig.HudAnchorX != null) { NornsConfig.HudAnchorX.Value = Mathf.Clamp(_draftAnchor.x, 0.04f, 0.96f); NornsConfig.HudAnchorY.Value = Mathf.Clamp(_draftAnchor.y, 0.08f, 0.94f); NornsConfig.HudScale.Value = Mathf.Clamp(_draftScale, 0.55f, 1.8f); } } private static void DrawHeader(Player player, PlayerClass cls, int level, Rect rect, Color accent) { //IL_0040: 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_00e8: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) ClassSystem.GetLevelProgress(player, out var intoLevel, out var needed); bool flag = level >= 50; string arg = SpecializationLabel(player); GUI.Label(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width * 0.72f, 20f), $"{cls.ToString().ToUpperInvariant()}{arg} · {level}", NornsSkin.HudClass); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 2f, 20f), flag ? "the thread is cut" : $"{intoLevel} / {needed}", NornsSkin.HudProgress); Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 23f, ((Rect)(ref rect)).width, 3f); NornsSkin.Fill(rect2, NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.5f)); float num = (flag ? 1f : ((needed > 0) ? Mathf.Clamp01((float)intoLevel / (float)needed) : 0f)); if (num > 0f) { Color tint = (flag ? new Color(NornsSkin.Gold.r, NornsSkin.Gold.g, NornsSkin.Gold.b, 0.6f) : new Color(accent.r, accent.g, accent.b, 0.85f)); NornsSkin.Fill(new Rect(((Rect)(ref rect2)).x, ((Rect)(ref rect2)).y, ((Rect)(ref rect2)).width * num, ((Rect)(ref rect2)).height), NornsSkin.Solid(Color.white), tint); } if (cls == PlayerClass.Berserker) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 30f, ((Rect)(ref rect)).width, 16f); NornsSkin.Fill(val, NornsSkin.Solid(Color.white), new Color(0.025f, 0.006f, 0.004f, 0.96f)); Rect rect3 = default(Rect); ((Rect)(ref rect3))..ctor(((Rect)(ref val)).x + 2f, ((Rect)(ref val)).y + 2f, ((Rect)(ref val)).width - 4f, ((Rect)(ref val)).height - 4f); NornsSkin.Fill(rect3, NornsSkin.Solid(Color.white), new Color(0.18f, 0.012f, 0.006f, 0.88f)); float normalized = BerserkerFury.Normalized; if (normalized > 0f) { Color tint2 = Color.Lerp(new Color(0.82f, 0.055f, 0.012f), new Color(1f, 0.58f, 0.08f), normalized); Rect rect4 = default(Rect); ((Rect)(ref rect4))..ctor(((Rect)(ref rect3)).x, ((Rect)(ref rect3)).y, ((Rect)(ref rect3)).width * normalized, ((Rect)(ref rect3)).height); NornsSkin.Fill(rect4, NornsSkin.Solid(Color.white), tint2); NornsSkin.Fill(new Rect(((Rect)(ref rect4)).x, ((Rect)(ref rect4)).y, ((Rect)(ref rect4)).width, ((Rect)(ref rect4)).height * 0.34f), NornsSkin.Solid(Color.white), new Color(1f, 0.72f, 0.28f, 0.22f)); } for (int i = 1; i < 4; i++) { NornsSkin.Fill(new Rect(((Rect)(ref rect3)).x + ((Rect)(ref rect3)).width * (float)i * 0.25f, ((Rect)(ref rect3)).y, 1f, ((Rect)(ref rect3)).height), NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.46f)); } NornsSkin.Frame(val, new Color(1f, 0.38f, 0.08f, 0.9f)); NornsSkin.Frame(new Rect(((Rect)(ref val)).x + 1f, ((Rect)(ref val)).y + 1f, ((Rect)(ref val)).width - 2f, ((Rect)(ref val)).height - 2f), new Color(1f, 0.72f, 0.24f, 0.32f)); NornsSkin.HudSlotSub.normal.textColor = new Color(1f, 0.9f, 0.68f); GUI.Label(val, $"FURY {BerserkerFury.Value:0} / {100f:0}", NornsSkin.HudSlotSub); } } private static string SpecializationLabel(Player player) { if (ClassSystem.GetClass(player) == PlayerClass.Berserker) { BerserkerSpecialization berserkerSpecialization = ClassSystem.GetBerserkerSpecialization(player); if (berserkerSpecialization != BerserkerSpecialization.None) { return " · " + BerserkerSpecializations.NameOf(berserkerSpecialization).ToUpperInvariant(); } return string.Empty; } MageSpecialization mageSpecialization = ClassSystem.GetMageSpecialization(player); if (mageSpecialization != MageSpecialization.None) { return " · " + MageSpecializations.NameOf(mageSpecialization).ToUpperInvariant(); } return string.Empty; } private static Color SpecializationAccent(Player player, Color fallback) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (ClassSystem.GetClass(player) == PlayerClass.Berserker) { return BerserkerSpecializations.AccentOf(ClassSystem.GetBerserkerSpecialization(player)); } if (ClassSystem.GetClass(player) == PlayerClass.Mage) { return MageSpecializations.AccentOf(ClassSystem.GetMageSpecialization(player)); } return fallback; } private static void DrawSlot(Rect rect, int slot, Spell spell, int level, Color accent) { //IL_0000: 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_0027: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0522: 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_0530: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_050f: 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) NornsSkin.Fill(rect, NornsSkin.Panel(), new Color(1f, 1f, 1f, 0.92f)); if (spell == null) { NornsSkin.Frame(rect, new Color(1f, 1f, 1f, 0.1f)); return; } bool flag = level < spell.UnlockLevel; float num = Casting.CooldownRemaining(slot); bool flag2 = !flag && num <= 0f; float num2 = 58f; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + (((Rect)(ref rect)).width - num2) * 0.5f, ((Rect)(ref rect)).y + 5f, num2, num2); Texture2D val2 = SpellIcons.For(spell); NornsSkin.Fill(val, NornsSkin.Solid(Color.white), new Color(0.025f, 0.03f, 0.04f, 0.95f)); if ((Object)(object)val2 != (Object)null) { Color color = GUI.color; GUI.color = (flag ? new Color(0.38f, 0.4f, 0.44f, color.a * 0.55f) : new Color(1f, 1f, 1f, color.a)); GUI.DrawTexture(val, (Texture)(object)val2); GUI.color = color; } else { NornsSkin.Fill(new Rect(((Rect)(ref val)).x + 8f, ((Rect)(ref val)).y + 8f, ((Rect)(ref val)).width - 16f, ((Rect)(ref val)).height - 16f), NornsSkin.Disc(), (Color)(flag ? new Color(0.25f, 0.25f, 0.27f) : accent)); GUI.Label(val, spell.UnlockLevel.ToString(), NornsSkin.BadgeText); } NornsSkin.Frame(val, flag ? new Color(1f, 1f, 1f, 0.1f) : new Color(accent.r, accent.g, accent.b, flag2 ? 0.72f : 0.28f)); if (!flag && num > 0f) { float num3 = Mathf.Clamp01(num / Mathf.Max(0.01f, spell.Cooldown)); NornsSkin.Fill(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, ((Rect)(ref val)).height * num3), NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.72f)); string text = ((num >= 10f) ? $"{num:0}" : $"{num:0.0}"); NornsSkin.HudSlotSub.normal.textColor = NornsSkin.GoldBright; GUI.Label(val, text, NornsSkin.HudSlotSub); } if (!flag) { string text2 = $"{spell.ResourceCost:0} {spell.ResourceShort}"; Rect val3 = new Rect(((Rect)(ref val)).xMax - 28f, ((Rect)(ref val)).yMax - 15f, 27f, 14f); bool flag3 = spell.Resource == AbilityResource.Fury; NornsSkin.Fill(val3, NornsSkin.Solid(Color.white), flag3 ? new Color(0.16f, 0.025f, 0.012f, 0.84f) : new Color(0.02f, 0.08f, 0.1f, 0.78f)); NornsSkin.HudIconBadge.normal.textColor = (flag3 ? new Color(1f, 0.55f, 0.2f) : new Color(0.68f, 0.94f, 1f)); GUI.Label(val3, text2, NornsSkin.HudIconBadge); } Color color2 = (flag ? new Color(1f, 1f, 1f, 0.12f) : (flag2 ? new Color(accent.r, accent.g, accent.b, 0.68f + 0.12f * Mathf.Sin(Time.unscaledTime * 3.2f)) : new Color(accent.r, accent.g, accent.b, 0.28f))); NornsSkin.Frame(rect, color2); NornsSkin.HudSlotName.normal.textColor = (Color)(flag ? new Color(0.45f, 0.45f, 0.45f) : NornsSkin.Parchment); NornsSkin.FitLabel(new Rect(((Rect)(ref rect)).x + 4f, ((Rect)(ref rect)).y + 64f, ((Rect)(ref rect)).width - 8f, 15f), spell.Name, NornsSkin.HudSlotName, 12, 8); string text3; Color goldBright = default(Color); if (flag) { text3 = $"level {spell.UnlockLevel}"; ((Color)(ref goldBright))..ctor(0.42f, 0.42f, 0.44f); } else if (num > 0f) { text3 = ((num >= 10f) ? $"{num:0}s" : $"{num:0.0}s"); goldBright = NornsSkin.GoldBright; } else { text3 = NornsConfig.ShortcutLabel(slot); ((Color)(ref goldBright))..ctor(accent.r, accent.g, accent.b, 0.9f); } NornsSkin.HudSlotSub.normal.textColor = goldBright; GUI.Label(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 78f, ((Rect)(ref rect)).width - 6f, 12f), text3, NornsSkin.HudSlotSub); } private static void DrawCastBar(Rect rect, Color accent) { //IL_001a: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c6: 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) GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, 18f), Casting.ChannelName, NornsSkin.HudCast); Rect rect2 = default(Rect); ((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 19f, ((Rect)(ref rect)).width, 8f); NornsSkin.Fill(rect2, NornsSkin.Solid(Color.white), new Color(0f, 0f, 0f, 0.7f)); NornsSkin.Fill(new Rect(((Rect)(ref rect2)).x, ((Rect)(ref rect2)).y, ((Rect)(ref rect2)).width * Casting.ChannelProgress, ((Rect)(ref rect2)).height), NornsSkin.Solid(Color.white), NornsSkin.GoldBright); NornsSkin.Frame(rect2, new Color(accent.r, accent.g, accent.b, 0.6f)); } } [HarmonyPatch(typeof(Player), "UseHotbarItem")] public static class HotbarPatch { private static bool Prefix() { //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) if (NornsConfig.AbilityShortcuts == null) { return true; } ConfigEntry[] abilityShortcuts = NornsConfig.AbilityShortcuts; foreach (ConfigEntry val in abilityShortcuts) { if (val != null) { KeyboardShortcut value = val.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { return false; } } } return true; } } [HarmonyPatch(typeof(Player), "ActivateGuardianPower")] public static class GuardianPowerPatch { private const float Window = 1.5f; private static bool Prefix(Player __instance, ref bool __result) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return true; } if (Time.time - Casting.GestureStartedAt > 1.5f) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(Attack), "ProjectileAttackTriggered")] internal static class SpellCastProjectileTriggerPatch { private static bool Prefix(Attack __instance) { return !Casting.SuppressStaffProjectile(__instance); } } [HarmonyPatch(typeof(Attack), "FireProjectileBurst")] internal static class SpellCastProjectileBurstPatch { private static bool Prefix(Attack __instance) { return !Casting.SuppressStaffProjectile(__instance); } } [HarmonyPatch(typeof(Player), "OnSpawned")] public static class SpawnPatch { private static void Postfix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { ClassSelectionGui.NotifySpawned(); } } } public static class MageClass { public const string PassiveName = "Seidr Blood"; public const float EitrRegenMultiplier = 1.25f; public static readonly Spell[] Spells = new Spell[5] { new Spell { Name = "Fireball", Flavor = "a condensed inferno, hurled where you look", UnlockLevel = 10, Cooldown = 3f, ResourceCost = 8f, CastTime = 1.15f, HoldChannelPose = true, ChannelFx = FxKind.FireballCharge, ChannelCancelFx = FxKind.FireballChargeCancel, BaseDamage = 25f, CastTrigger = "staff_fireball0", Describe = (int lvl) => $"Condenses and hurls a massive fireball where you look. {Progression.Dmg(25f, lvl):0} fire damage.", Cast = CastFireball }, new Spell { Name = "Frost Nova", Flavor = "winter fractures outward from your feet", UnlockLevel = 20, Cooldown = 12f, ResourceCost = 20f, CastTime = 0f, BaseDamage = 40f, CastTrigger = "staff_fireball1", Describe = (int lvl) => $"Fractures winter outward around you. {Progression.Dmg(40f, lvl):0} frost damage and chill within 8 m.", Cast = CastFrostNova }, new Spell { Name = "Arc Lightning", Flavor = "the storm leaps from foe to foe", UnlockLevel = 30, Cooldown = 10f, ResourceCost = 25f, CastTime = 0.8f, BaseDamage = 55f, CastTrigger = "staff_lightningshot", ChannelFx = FxKind.ArcLightningCharge, ChannelCancelFx = FxKind.ArcLightningChargeCancel, Describe = (int lvl) => $"Lightning leaps between up to {5} foes. {Progression.Dmg(55f, lvl):0} lightning damage, -15% per jump.", Cast = CastArcLightning }, new Spell { Name = "Runic Ward", Flavor = "runes close over you", CastTrigger = "staff_shield", UnlockLevel = 40, Cooldown = 60f, ResourceCost = 30f, CastTime = 0f, BaseDamage = 0f, Describe = (int lvl) => $"Runes shield you for {20f:0} s: +{50f:0} armor, triple Eitr regeneration, and repel enemies within {3.8f:0.0} m.", Cast = CastRunicWard }, new Spell { Name = "Fall of Ragnarok", Flavor = "the sky itself catches fire", CastTrigger = "staff_trollsummon", UnlockLevel = 50, Cooldown = 90f, ResourceCost = 60f, CastTime = 2.5f, HoldChannelPose = true, ChannelFx = FxKind.FireRainCharge, ChannelCancelFx = FxKind.FireRainChargeCancel, BaseDamage = 55f, Describe = (int lvl) => $"Bombards a {10f:0} m area with {20} firebolts over {5.1299996f:0.0} s. Each impact deals {Progression.Dmg(55f, lvl):0} fire damage within {3.2f:0.0} m.", Cast = CastFireRain } }; private const float BoltRange = 40f; public const float NovaRadius = 8f; private const int ChainTargets = 5; private const float ChainRange = 25f; private const float ChainJump = 8f; private const float ChainImpactDelay = 0.055f; private const float ChainBouncePause = 0.03f; public const float WardDuration = 20f; public const float WardArmor = 50f; public const float WardRadius = 3.8f; private const float FireRainRange = 40f; public const float FireRainRadius = 10f; public const float FireRainImpactRadius = 3.2f; public const int FireRainBolts = 20; public const float FireRainDamage = 55f; public const float FireRainStartDelay = 0.4f; public const float FireRainInterval = 0.19f; public const float FireRainBoltTravelTime = 0.62f; public const float FireRainDuration = 5.1299996f; private const float FireRainHeight = 24f; public static float EitrReserve(int level) { return 5f + 1.5f * (float)Mathf.Clamp(level, 1, 50); } public static string PassiveDescription(int level) { return $"Seidr Blood — +{EitrReserve(level):0} Eitr and +{25f:0}% Eitr regeneration, without Mistlands food."; } private static void CastFireball(Player player, int level) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_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) Vector3 val = Effects.CastOrigin(player); Vector3 val2 = Effects.AimPoint(player, 40f); SpellFx.PlayShared(FxKind.Fireball, val, val2); ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireballImpact(player, level, val, val2)); } private static IEnumerator FireballImpact(Player player, int level, Vector3 origin, Vector3 point) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(SpellFx.BoltTravelTime(origin, point)); if ((Object)(object)player == (Object)null) { yield break; } float fire = DreadVeil.ModifySpellDamage(player, Progression.Dmg(25f, level)); using List.Enumerator enumerator = Effects.EnemiesInRange(point, 2.2f, (Character)(object)player).GetEnumerator(); if (enumerator.MoveNext()) { Character current = enumerator.Current; Effects.DealDamage(player, current, new DamageTypes { m_fire = fire }, "Burning", 10f); } } private static void CastFrostNova(Player player, int level) { //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_001f: 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_0026: 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_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; float frost = DreadVeil.ModifySpellDamage(player, Progression.Dmg(40f, level)); SpellFx.PlayShared(FxKind.FrostNova, position, position); foreach (Character item in Effects.EnemiesInRange(position, 8f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_frost = frost }, "Frost", 25f); } } private static void CastArcLightning(Player player, int level) { //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_000c: 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_0046: 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_0028: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Effects.AimPoint(player, 25f); List list = Effects.EnemiesInRange(val, 8f, (Character)(object)player); if (list.Count == 0) { SpellFx.PlayShared(FxKind.ChainLightning, Effects.CastOrigin(player), val); return; } HashSet hashSet = new HashSet(); Character current = Nearest(list, val, hashSet); ((MonoBehaviour)Plugin.Instance).StartCoroutine(ArcLightningChain(player, level, Effects.CastOrigin(player), current, hashSet)); } private static IEnumerator ArcLightningChain(Player player, int level, Vector3 from, Character current, HashSet hit) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float damage = DreadVeil.ModifySpellDamage(player, Progression.Dmg(55f, level)); for (int jump = 0; jump < 5; jump++) { if (!((Object)(object)current != (Object)null)) { break; } hit.Add(current); Vector3 to = current.GetCenterPoint(); SpellFx.PlayShared(FxKind.ChainLightning, from, to); yield return (object)new WaitForSeconds(0.055f); if ((Object)(object)player == (Object)null) { break; } if ((Object)(object)current != (Object)null && !current.IsDead()) { Effects.DealDamage(player, current, new DamageTypes { m_lightning = damage }); } damage *= 0.85f; from = (((Object)(object)current != (Object)null) ? current.GetCenterPoint() : to); yield return (object)new WaitForSeconds(0.03f); List candidates = Effects.EnemiesInRange(from, 8f, (Character)(object)player); current = Nearest(candidates, from, hit); } } private static Character Nearest(List candidates, Vector3 from, HashSet exclude) { //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_002e: Unknown result type (might be due to invalid IL or missing references) Character result = null; float num = float.MaxValue; foreach (Character candidate in candidates) { if (!exclude.Contains(candidate)) { float num2 = Vector3.SqrMagnitude(((Component)candidate).transform.position - from); if (!(num2 >= num)) { num = num2; result = candidate; } } } return result; } private static void CastRunicWard(Player player, int level) { //IL_0007: 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) SpellFx.PlayShared(FxKind.RunicWard, ((Component)player).transform.position, ((Component)player).transform.position); PassiveEffects.ApplyWard(player); } private static void CastFireRain(Player player, int level) { //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_0019: Unknown result type (might be due to invalid IL or missing references) Vector3 point = Effects.AimPoint(player, 40f); PassiveEffects.ApplyFireRain(player); ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireRainRoutine(player, level, point)); } private unsafe static IEnumerator FireRainRoutine(Player player, int level, Vector3 point) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) point = Effects.SurfacePoint(point); SpellFx.PlayShared(FxKind.FireRainStart, point, point + Vector3.up * 24f); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)player == (Object)null) { yield break; } Random random = new Random(((object)(*(Vector3*)(&point))/*cast due to .constrained prefix*/).GetHashCode() ^ Mathf.RoundToInt(Time.time * 1000f)); Vector3 val3 = default(Vector3); for (int i = 0; i < 20; i++) { float num = Mathf.Sqrt((float)random.NextDouble()); if (i % 5 == 0) { num *= 0.38f; } float num2 = (float)random.NextDouble() * (float)Math.PI * 2f; Vector3 val = new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * 10f * num; Vector3 val2 = Effects.SurfacePoint(point + val); ((Vector3)(ref val3))..ctor(((float)random.NextDouble() - 0.5f) * 8f, 0f, ((float)random.NextDouble() - 0.5f) * 8f); Vector3 sky = val2 + Vector3.up * 24f + val3; ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireRainStrike(player, level, val2, sky)); yield return (object)new WaitForSeconds(0.19f); } } private static IEnumerator FireRainStrike(Player player, int level, Vector3 impact, Vector3 sky) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) SpellFx.PlayShared(FxKind.FireRainBolt, impact, sky); yield return (object)new WaitForSeconds(0.62f); SpellFx.PlayShared(FxKind.FireRainImpact, impact, impact); if ((Object)(object)player == (Object)null) { yield break; } float fire = DreadVeil.ModifySpellDamage(player, Progression.Dmg(55f, level)); foreach (Character item in Effects.EnemiesInRange(impact, 3.2f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_fire = fire }, "Burning", 18f); } } } public static class MageSpecializations { private struct DrainSample { public Character Target; public float HealthBefore; } public static readonly MageSpecialization[] All = new MageSpecialization[3] { MageSpecialization.Void, MageSpecialization.Blood, MageSpecialization.Dark }; public const float BlackHoleDuration = 6f; public const float BlackHoleRadius = 9f; public const float BlackHoleTickInterval = 0.5f; public const float BloodRiteRadius = 8f; public const int BloodRitePulses = 5; public const float BloodRiteInterval = 0.68f; public const float BloodRiteDuration = 2.9f; public const float DreadVeilDuration = 12f; public const float DreadVeilSpellDamageBonus = 0.25f; public const float DreadVeilDamageReduction = 0.25f; private const float BlackHoleRange = 35f; private const float BlackHoleTickDamage = 15f; private const float BloodRiteTickDamage = 24f; private const float BloodHealFraction = 0.28f; private const float BloodHealCapPerPulse = 35f; private const float BloodResolveDelay = 0.18f; public static readonly Spell VoidSpell = new Spell { Name = "Black Hole", Flavor = "gravity devours the battlefield", UnlockLevel = 50, Cooldown = 75f, ResourceCost = 55f, CastTime = 1.5f, HoldChannelPose = true, ChannelFx = FxKind.BlackHoleCharge, ChannelCancelFx = FxKind.BlackHoleChargeCancel, BaseDamage = 15f, CastTrigger = "staff_lightningshot", Describe = (int level) => $"Creates a {9f:0} m singularity for {6f:0} s, pulling enemies inward and dealing {Progression.Dmg(15f, level):0} damage every {0.5f:0.0} s.", Cast = CastBlackHole }; public static readonly Spell BloodSpell = new Spell { Name = "Blood Harvest", Flavor = "every heartbeat becomes your own", UnlockLevel = 50, Cooldown = 50f, ResourceCost = 40f, CastTime = 1.2f, HoldChannelPose = true, ChannelFx = FxKind.BloodHarvestCharge, ChannelCancelFx = FxKind.BloodHarvestChargeCancel, BaseDamage = 24f, CastTrigger = "staff_fireball1", Describe = (int level) => $"Drains enemies within {8f:0} m in {5} pulses. Each pulse deals {Progression.Dmg(24f, level):0} damage and restores {28f:0}% of health actually lost, up to {35f:0} health per pulse.", Cast = CastBloodHarvest }; public static readonly Spell DarkSpell = new Spell { Name = "Dread Veil", Flavor = "wear the dark between worlds", UnlockLevel = 50, Cooldown = 120f, ResourceCost = 70f, CastTime = 2.5f, HoldChannelPose = true, ChannelFx = FxKind.DreadVeilCharge, ChannelCancelFx = FxKind.DreadVeilChargeCancel, BaseDamage = 0f, CastTrigger = "staff_trollsummon", Describe = (int _) => $"Become wrapped in living shadow for {12f:0} s, " + $"increasing Norns spell damage by {25f:0}% and " + $"reducing incoming damage by {25f:0}%.", Cast = CastDreadVeil }; public static Spell SpellFor(MageSpecialization specialization) { return specialization switch { MageSpecialization.Void => VoidSpell, MageSpecialization.Blood => BloodSpell, MageSpecialization.Dark => DarkSpell, _ => null, }; } public static string NameOf(MageSpecialization specialization) { return specialization switch { MageSpecialization.Void => "Void Mage", MageSpecialization.Blood => "Blood Mage", MageSpecialization.Dark => "Dark Mage", _ => "Unwoven", }; } public static string DescriptionOf(MageSpecialization specialization) { return specialization switch { MageSpecialization.Void => "Bend gravity and collapse enemies into the void.", MageSpecialization.Blood => "Turn nearby life into damage and restoration.", MageSpecialization.Dark => "Wear living shadow to empower magic and blunt incoming harm.", _ => "Choose a final thread at the Shrine of the Norns.", }; } public static Color AccentOf(MageSpecialization specialization) { //IL_0025: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) return (Color)(specialization switch { MageSpecialization.Void => new Color(0.62f, 0.36f, 1f), MageSpecialization.Blood => new Color(0.88f, 0.16f, 0.2f), MageSpecialization.Dark => new Color(0.48f, 0.3f, 0.82f), _ => new Color(0.78f, 0.72f, 0.58f), }); } private static void CastBlackHole(Player player, int level) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Effects.SurfacePoint(Effects.AimPoint(player, 35f)) + Vector3.up * 0.08f; PassiveEffects.ApplyBlackHole(player); SpellFx.PlayShared(FxKind.BlackHole, val, val); ((MonoBehaviour)Plugin.Instance).StartCoroutine(BlackHoleRoutine(player, level, val)); } private static IEnumerator BlackHoleRoutine(Player player, int level, Vector3 center) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float elapsed = 0f; float nextPull = 0f; float nextDamage = 0f; float damage = DreadVeil.ModifySpellDamage(player, Progression.Dmg(15f, level)); while (elapsed < 6f && !((Object)(object)player == (Object)null) && !((Character)player).IsDead()) { if (elapsed >= nextPull) { nextPull += 0.18f; ApplyVoidPullOwned(center); Network.BroadcastVoidPulse(center); } if (elapsed >= nextDamage) { nextDamage += 0.5f; foreach (Character item in Effects.EnemiesInRange(center, 9f, (Character)(object)player)) { Effects.DealDamage(player, item, new DamageTypes { m_damage = damage }); } } elapsed += Time.deltaTime; yield return null; } } public static void ApplyVoidPullOwned(Vector3 center) { //IL_0000: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) foreach (Character item in Effects.EnemiesInRange(center, 9f)) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.m_nview == (Object)null) && item.m_nview.IsOwner()) { Vector3 val = center - ((Component)item).transform.position; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude < 0.15f)) { val /= magnitude; float num = 1f - Mathf.Clamp01(magnitude / 9f); item.ApplyPushback(val, Mathf.Lerp(22f, 42f, num)); } } } } private static void CastBloodHarvest(Player player, int level) { //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_0014: 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) Vector3 position = ((Component)player).transform.position; PassiveEffects.ApplyBloodHarvest(player); SpellFx.PlayShared(FxKind.BloodHarvest, position, position); ((MonoBehaviour)Plugin.Instance).StartCoroutine(BloodHarvestRoutine(player, level)); } private static IEnumerator BloodHarvestRoutine(Player player, int level) { float damage = DreadVeil.ModifySpellDamage(player, Progression.Dmg(24f, level)); for (int pulse = 0; pulse < 5; pulse++) { if ((Object)(object)player == (Object)null) { break; } if (((Character)player).IsDead()) { break; } List drainedTargets = new List(); foreach (Character item in Effects.EnemiesInRange(((Component)player).transform.position, 8f, (Character)(object)player)) { drainedTargets.Add(new DrainSample { Target = item, HealthBefore = item.GetHealth() }); Effects.DealDamage(player, item, new DamageTypes { m_pierce = damage }); } yield return (object)new WaitForSeconds(0.18f); float num = 0f; foreach (DrainSample item2 in drainedTargets) { float num2 = (((Object)(object)item2.Target != (Object)null) ? item2.Target.GetHealth() : 0f); num += Mathf.Clamp(item2.HealthBefore - num2, 0f, item2.HealthBefore); } if (num > 0f) { ((Character)player).Heal(Mathf.Min(35f, num * 0.28f), true); } if (pulse + 1 < 5) { yield return (object)new WaitForSeconds(0.5f); } } } private static void CastDreadVeil(Player player, int level) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; DreadVeil.Activate(player); PassiveEffects.ApplyDreadVeil(player); SpellFx.PlayShared(FxKind.DreadVeil, position, position); XpSystem.Message(player, "Dread Veil — shadow empowered"); } } public sealed class MageStaffVfxController : MonoBehaviour { public Transform PrimaryMotion; public Transform SecondaryMotion; public Light AccentLight; public float Period = 5f; public float BobAmplitude = 0.018f; public float PrimaryTurnDegrees = 22f; public float SecondaryTurnDegrees = -38f; private Vector3 _primaryPosition; private Quaternion _primaryRotation; private Quaternion _secondaryRotation; private float _baseIntensity; private float _phase; private void Awake() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PrimaryMotion != (Object)null) { _primaryPosition = PrimaryMotion.localPosition; _primaryRotation = PrimaryMotion.localRotation; } if ((Object)(object)SecondaryMotion != (Object)null) { _secondaryRotation = SecondaryMotion.localRotation; } if ((Object)(object)AccentLight != (Object)null) { _baseIntensity = AccentLight.intensity; } _phase = (float)Mathf.Abs(((Object)this).GetInstanceID() % 97) / 97f * (float)Math.PI * 2f; } private void Update() { //IL_0057: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00df: Unknown result type (might be due to invalid IL or missing references) float num = Time.time / Mathf.Max(0.25f, Period) * (float)Math.PI * 2f + _phase; float num2 = Mathf.Sin(num); float num3 = Mathf.Sin(num * 0.73f + 1.15f); if ((Object)(object)PrimaryMotion != (Object)null) { PrimaryMotion.localPosition = _primaryPosition + Vector3.up * (num2 * BobAmplitude); PrimaryMotion.localRotation = _primaryRotation * Quaternion.Euler(num3 * 2.2f, num2 * PrimaryTurnDegrees, num2 * 1.3f); } if ((Object)(object)SecondaryMotion != (Object)null) { SecondaryMotion.localRotation = _secondaryRotation * Quaternion.Euler(num2 * 1.8f, num3 * SecondaryTurnDegrees, (0f - num2) * 2.4f); } if ((Object)(object)AccentLight != (Object)null) { AccentLight.intensity = _baseIntensity * Mathf.Lerp(0.78f, 1.16f, num2 * 0.5f + 0.5f); } } } public static class MageStaves { public const string ApprenticePrefab = "NornsStaffApprentice"; public const string RunicPrefab = "NornsStaffRunic"; public const string SeidrPrefab = "NornsStaffSeidr"; private static bool _hooked; private static bool _created; public static void Register() { if (!_hooked) { _hooked = true; PrefabManager.OnVanillaPrefabsAvailable += Create; } } public static void Shutdown() { if (_hooked) { PrefabManager.OnVanillaPrefabsAvailable -= Create; } _hooked = false; } private static void Create() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00a9: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected O, but got Unknown //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= Create; _hooked = false; if (_created) { return; } try { bool flag = AddStaff("NornsStaffApprentice", "StaffFireball", "Apprentice Staff", "A first focus of pine, amber and stubborn sparks. Modest alone; essential to a young Mage.", "apprentice_staff.jpg", CraftingStations.Workbench, 2, (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("RoundLog", 10, 5, true), new RequirementConfig("Resin", 8, 4, true), new RequirementConfig("GreydwarfEye", 6, 3, true), new RequirementConfig("SurtlingCore", 2, 1, true) }, Damage(4f, 14f), Damage(1f, 3f), 8f, 18f, 100f, 40f, NornsStaffModels.Style.Apprentice); bool flag2 = AddStaff("NornsStaffRunic", "StaffIceShards", "Runic Staff", "Ancient bark and mountain crystal bind cold intent into every carved rune.", "runic_staff.jpg", CraftingStations.Forge, 3, (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("ElderBark", 15, 6, true), new RequirementConfig("Iron", 8, 4, true), new RequirementConfig("Crystal", 6, 3, true), new RequirementConfig("FreezeGland", 4, 2, true) }, Damage(0f, 0f, 14f), Damage(0f, 0f, 3f), 7f, 12f, 120f, 45f, NornsStaffModels.Style.Runic); bool flag3 = AddStaff("NornsStaffSeidr", "StaffLightning", "Seidr Staff", "Black metal cages a seidr core whose braided threads answer with thunder.", "seidr_staff.jpg", CraftingStations.Forge, 4, (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("FineWood", 20, 8, true), new RequirementConfig("BlackMetal", 16, 6, true), new RequirementConfig("LinenThread", 12, 5, true), new RequirementConfig("Needle", 6, 3, true) }, Damage(0f, 0f, 0f, 6f), Damage(0f, 0f, 0f, 1.5f), 18f, 28f, 140f, 50f, NornsStaffModels.Style.Seidr); _created = flag && flag2 && flag3; if (_created) { Plugin.Log.LogInfo((object)"Tre bastoni Norns pre-Mistlands registrati."); } else { Plugin.Log.LogError((object)"Registrazione incompleta dei bastoni Norns."); } } catch (Exception arg) { Plugin.Log.LogError((object)$"Registrazione dei bastoni Norns fallita: {arg}"); } } private static bool AddStaff(string prefabName, string basePrefab, string displayName, string description, string iconFile, string station, int stationLevel, RequirementConfig[] requirements, DamageTypes damage, DamageTypes damagePerLevel, float eitrCost, float attackForce, float durability, float durabilityPerLevel, NornsStaffModels.Style style) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_002b: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00cc: Unknown result type (might be due to invalid IL or missing references) ItemConfig val = new ItemConfig { Name = displayName, Description = description, CraftingStation = station, RepairStation = station, MinStationLevel = stationLevel, Weight = 2f, Icon = LoadIcon(iconFile), Requirements = requirements }; CustomItem val2 = new CustomItem(prefabName, basePrefab, val); if ((Object)(object)val2.ItemPrefab == (Object)null || (Object)(object)val2.ItemDrop == (Object)null) { Plugin.Log.LogError((object)("Impossibile clonare " + basePrefab + " per " + displayName + ".")); return false; } SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_skillType = (SkillType)9; shared.m_damages = damage; shared.m_damagesPerLevel = damagePerLevel; shared.m_attackForce = attackForce; shared.m_maxQuality = 4; shared.m_useDurability = true; shared.m_maxDurability = durability; shared.m_durabilityPerLevel = durabilityPerLevel; shared.m_movementModifier = -0.05f; if (shared.m_attack != null) { shared.m_attack = shared.m_attack.Clone(); shared.m_attack.m_attackEitr = eitrCost; shared.m_attack.m_attackStamina = 0f; } if (shared.m_secondaryAttack != null) { shared.m_secondaryAttack = shared.m_secondaryAttack.Clone(); } NornsStaffModels.ReplaceVanillaVisual(val2.ItemPrefab, style); if (!ItemManager.Instance.AddItem(val2)) { Plugin.Log.LogError((object)("Jotunn ha rifiutato " + displayName + " (" + prefabName + ").")); return false; } return true; } private static DamageTypes Damage(float blunt = 0f, float fire = 0f, float frost = 0f, float lightning = 0f) { //IL_0002: 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) return new DamageTypes { m_blunt = blunt, m_fire = fire, m_frost = frost, m_lightning = lightning }; } private static Sprite LoadIcon(string fileName) { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return null; } string text = Path.Combine(directoryName, "art", "items", fileName); if (!File.Exists(text)) { Plugin.Log.LogWarning((object)("Icona bastone non trovata: " + text)); return null; } return AssetUtils.LoadSpriteFromFile(text); } } public static class Network { private const string RpcKill = "Norns_Kill"; private const string RpcFx = "Norns_Fx"; private const string RpcWardPulse = "Norns_WardPulse"; private const string RpcVoidPulse = "Norns_VoidPulse"; private const string RpcFuryHit = "Norns_FuryHit"; private const string RpcWarband = "Norns_Warband"; private static ZRoutedRpc _registeredOn; public static void EnsureRegistered() { ZRoutedRpc instance = ZRoutedRpc.instance; if (instance == null) { _registeredOn = null; } else if (_registeredOn != instance) { instance.Register("Norns_Kill", (Method)RPC_Kill); instance.Register("Norns_Fx", (Action)RPC_Fx); instance.Register("Norns_WardPulse", (Action)RPC_WardPulse); instance.Register("Norns_VoidPulse", (Action)RPC_VoidPulse); instance.Register("Norns_FuryHit", (Action)RPC_FuryHit); instance.Register("Norns_Warband", (Action)RPC_Warband); _registeredOn = instance; Plugin.Log.LogInfo((object)"RPC Norns registrati."); } } private static bool IsSelf(long sender) { if (ZRoutedRpc.instance != null) { return sender == ZRoutedRpc.instance.m_id; } return false; } public static void BroadcastKill(Vector3 pos, int xp, string contributors, string enemyDescriptor, int nativeBiome) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_Kill", new object[5] { pos, xp, contributors ?? string.Empty, enemyDescriptor ?? string.Empty, nativeBiome }); } } private static void RPC_Kill(long sender, Vector3 pos, int xp, string contributors, string enemyDescriptor, int nativeBiome) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!IsSelf(sender)) { XpPatches.AwardLocal(pos, xp, contributors, enemyDescriptor, nativeBiome); } } public static void BroadcastFx(FxKind kind, Vector3 a, Vector3 b) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_Fx", new object[3] { (int)kind, a, b }); } } private static void RPC_Fx(long sender, int kind, Vector3 a, Vector3 b) { //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) if (!IsSelf(sender)) { SpellFx.Play((FxKind)kind, a, b); } } public static void BroadcastWardPulse(Vector3 center) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_WardPulse", new object[1] { center }); } } private static void RPC_WardPulse(long sender, Vector3 center) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!IsSelf(sender)) { WardRepulsion.ApplyOwned(center); } } public static void BroadcastVoidPulse(Vector3 center) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_VoidPulse", new object[1] { center }); } } private static void RPC_VoidPulse(long sender, Vector3 center) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!IsSelf(sender)) { MageSpecializations.ApplyVoidPullOwned(center); } } public static void BroadcastFuryHit(long playerId, float effectiveDamage) { ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_FuryHit", new object[2] { playerId, effectiveDamage }); } } private static void RPC_FuryHit(long sender, long playerId, float effectiveDamage) { if (!IsSelf(sender)) { BerserkerFury.ReceiveRemoteHit(playerId, effectiveDamage); } } public static void BroadcastWarband(Vector3 center) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "Norns_Warband", new object[1] { center }); } } private static void RPC_Warband(long sender, Vector3 center) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!IsSelf(sender)) { BerserkerSpecializations.ApplyWarbandLocal(center); } } } public static class NornsConfig { public static ConfigEntry KillXpMultiplier; public static ConfigEntry MilestoneXpMultiplier; public static ConfigEntry DamageMultiplier; public static ConfigEntry MilestoneXpEnabled; public static ConfigEntry CodexKey; public static ConfigEntry HudEditShortcut; public static ConfigEntry[] AbilityShortcuts = new ConfigEntry[6]; public static ConfigEntry ShowHud; public static ConfigEntry HudScale; public static ConfigEntry HudAnchorX; public static ConfigEntry HudAnchorY; public static ConfigEntry SpellVolume; public static void Bind(ConfigFile cfg) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0107: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown AcceptableValueRange obj = new AcceptableValueRange(0.1f, 10f); object[] array = Admin(); KillXpMultiplier = cfg.Bind("Balance", "KillXpMultiplier", 1f, new ConfigDescription("Moltiplicatore dell'esperienza ottenuta dalle uccisioni.", (AcceptableValueBase)(object)obj, array)); AcceptableValueRange obj2 = new AcceptableValueRange(0.1f, 10f); array = Admin(); MilestoneXpMultiplier = cfg.Bind("Balance", "MilestoneXpMultiplier", 1f, new ConfigDescription("Moltiplicatore dell'esperienza ottenuta da boss e biomi.", (AcceptableValueBase)(object)obj2, array)); AcceptableValueRange obj3 = new AcceptableValueRange(0.1f, 5f); array = Admin(); DamageMultiplier = cfg.Bind("Balance", "DamageMultiplier", 1f, new ConfigDescription("Moltiplicatore globale del danno delle abilita.", (AcceptableValueBase)(object)obj3, array)); array = Admin(); MilestoneXpEnabled = cfg.Bind("Balance", "MilestoneXpEnabled", true, new ConfigDescription("Se false, l'XP arriva solo dalle uccisioni: niente bonus per boss e biomi.", (AcceptableValueBase)null, array)); CodexKey = cfg.Bind("Input", "CodexKey", (KeyCode)107, "Tasto che apre e chiude la scheda della classe."); HudEditShortcut = cfg.Bind("Input", "HudEditShortcut", new KeyboardShortcut((KeyCode)288, Array.Empty()), "Apre l'editor della barra abilita (trascina, rotella e rebind). "); for (int i = 0; i < 6; i++) { AbilityShortcuts[i] = cfg.Bind("Input", $"Ability{i + 1}Shortcut", DefaultAbilityShortcut(i), $"Combinazione completa dell'abilita {i + 1}."); } ShowHud = cfg.Bind("Hud", "ShowHud", true, "Mostra la barra delle abilita e il livello."); HudScale = cfg.Bind("Hud", "HudScale", 1f, new ConfigDescription("Scala della barra abilita.", (AcceptableValueBase)(object)new AcceptableValueRange(0.55f, 1.8f), Array.Empty())); HudAnchorX = cfg.Bind("Hud", "HudAnchorX", 0.5f, new ConfigDescription("Posizione orizzontale normalizzata della barra.", (AcceptableValueBase)(object)new AcceptableValueRange(0.04f, 0.96f), Array.Empty())); HudAnchorY = cfg.Bind("Hud", "HudAnchorY", 0.82f, new ConfigDescription("Posizione verticale normalizzata della barra.", (AcceptableValueBase)(object)new AcceptableValueRange(0.08f, 0.94f), Array.Empty())); SpellVolume = cfg.Bind("Audio", "SpellVolume", 0.75f, new ConfigDescription("Volume degli effetti sonori di Norns.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); } public static KeyboardShortcut DefaultAbilityShortcut(int slot) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return new KeyboardShortcut((KeyCode)(49 + Mathf.Clamp(slot, 0, 5)), (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }); } public static string ShortcutLabel(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (slot < 0 || slot >= AbilityShortcuts.Length || AbilityShortcuts[slot] == null) { return "—"; } return ((object)AbilityShortcuts[slot].Value/*cast due to .constrained prefix*/).ToString().Replace("Left", "L").Replace("Right", "R") .Replace("Alpha", "") .Replace("Keypad", "K") .Replace(" + ", "+"); } private static ConfigurationManagerAttributes[] Admin() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown return (ConfigurationManagerAttributes[])(object)new ConfigurationManagerAttributes[1] { new ConfigurationManagerAttributes { IsAdminOnly = true } }; } } public static class NornsSkin { public static readonly Color Gold = new Color(0.85f, 0.72f, 0.44f); public static readonly Color GoldBright = new Color(1f, 0.9f, 0.66f); public static readonly Color Parchment = new Color(0.87f, 0.83f, 0.75f); public static readonly Color Muted = new Color(0.62f, 0.6f, 0.56f); public static readonly Color Ink = new Color(0.05f, 0.05f, 0.06f); private static bool _built; public static GUIStyle Title; public static GUIStyle Subtitle; public static GUIStyle ClassName; public static GUIStyle Tagline; public static GUIStyle Body; public static GUIStyle SpellName; public static GUIStyle SpellFlavor; public static GUIStyle BadgeText; public static GUIStyle Confirm; public static GUIStyle Tab; public static GUIStyle HudClass; public static GUIStyle HudProgress; public static GUIStyle HudSlotName; public static GUIStyle HudSlotSub; public static GUIStyle HudSlotCost; public static GUIStyle HudIconBadge; public static GUIStyle HudCast; public static GUIStyle PassiveLine; public static GUIStyle CodexSpellName; public static GUIStyle CodexStats; public static GUIStyle CodexSection; public static GUIStyle CodexCounter; public static GUIStyle CodexCardBody; private static Texture2D _panel; private static Texture2D _backdrop; private static Texture2D _disc; private static Texture2D _rule; private static Texture2D _buttonIdle; private static Texture2D _buttonHover; private static readonly Dictionary SolidCache = new Dictionary(); private static readonly GUIContent Scratch = new GUIContent(); public static void EnsureBuilt() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00c4: Expected O, but got Unknown //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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0149: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01a5: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0259: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Expected O, but got Unknown //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Expected O, but got Unknown //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0354: 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_0369: Expected O, but got Unknown //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Expected O, but got Unknown //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Expected O, but got Unknown //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: 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_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Expected O, but got Unknown //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Expected O, but got Unknown //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Expected O, but got Unknown //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Expected O, but got Unknown //IL_04e4: 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_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: 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_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_0525: 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_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Expected O, but got Unknown //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Expected O, but got Unknown //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: 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_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Expected O, but got Unknown //IL_0678: Unknown result type (might be due to invalid IL or missing references) if (_built) { return; } _built = true; Font font = null; Font font2 = null; try { GUIManager instance = GUIManager.Instance; if (instance != null) { font = instance.NorseBold ?? instance.Norse; font2 = instance.AveriaSerif ?? instance.AveriaSerifBold; } } catch { } GUIStyle val = new GUIStyle(GUI.skin.label) { font = font, fontSize = 34, alignment = (TextAnchor)4 }; val.normal.textColor = GoldBright; val.wordWrap = false; Title = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 15, alignment = (TextAnchor)4 }; val2.normal.textColor = Muted; val2.wordWrap = true; Subtitle = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 26, alignment = (TextAnchor)4 }; val3.normal.textColor = GoldBright; ClassName = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 16, fontStyle = (FontStyle)2 }; val4.normal.textColor = Gold; val4.wordWrap = true; Tagline = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 15 }; val5.normal.textColor = Parchment; val5.wordWrap = true; val5.richText = true; Body = val5; GUIStyle val6 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 16, fontStyle = (FontStyle)1 }; val6.normal.textColor = Parchment; val6.alignment = (TextAnchor)3; SpellName = val6; GUIStyle val7 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 13, fontStyle = (FontStyle)2 }; val7.normal.textColor = Muted; val7.alignment = (TextAnchor)3; val7.wordWrap = false; SpellFlavor = val7; GUIStyle val8 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 15, alignment = (TextAnchor)4 }; val8.normal.textColor = Ink; BadgeText = val8; GUIStyle val9 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 22, alignment = (TextAnchor)4 }; val9.normal.textColor = GoldBright; val9.hover.textColor = Color.white; val9.active.textColor = Color.white; Confirm = val9; GUIStyle val10 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 18, alignment = (TextAnchor)4 }; val10.normal.textColor = Muted; val10.hover.textColor = GoldBright; Tab = val10; GUIStyle val11 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 13, fontStyle = (FontStyle)2, alignment = (TextAnchor)4 }; val11.normal.textColor = Muted; PassiveLine = val11; GUIStyle val12 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 16, fontStyle = (FontStyle)1, alignment = (TextAnchor)3 }; val12.normal.textColor = Parchment; CodexSpellName = val12; GUIStyle val13 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 12, alignment = (TextAnchor)3 }; val13.normal.textColor = Muted; CodexStats = val13; GUIStyle val14 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 20, alignment = (TextAnchor)3 }; val14.normal.textColor = GoldBright; CodexSection = val14; GUIStyle val15 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 12, fontStyle = (FontStyle)2, alignment = (TextAnchor)5 }; val15.normal.textColor = Muted; CodexCounter = val15; GUIStyle val16 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 13 }; val16.normal.textColor = Parchment; val16.wordWrap = true; val16.richText = true; val16.clipping = (TextClipping)1; CodexCardBody = val16; GUIStyle val17 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 17, alignment = (TextAnchor)3 }; val17.normal.textColor = GoldBright; HudClass = val17; GUIStyle val18 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 13, alignment = (TextAnchor)5 }; val18.normal.textColor = Muted; HudProgress = val18; GUIStyle val19 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 13, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val19.normal.textColor = Parchment; HudSlotName = val19; GUIStyle val20 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 12, alignment = (TextAnchor)4 }; val20.normal.textColor = Muted; HudSlotSub = val20; GUIStyle val21 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 10, alignment = (TextAnchor)4 }; val21.normal.textColor = new Color(1f, 1f, 1f, 0.32f); HudSlotCost = val21; GUIStyle val22 = new GUIStyle(GUI.skin.label) { font = font2, fontSize = 10, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val22.normal.textColor = Color.white; HudIconBadge = val22; GUIStyle val23 = new GUIStyle(GUI.skin.label) { font = font, fontSize = 15, alignment = (TextAnchor)4 }; val23.normal.textColor = GoldBright; HudCast = val23; Confirm.normal.background = ButtonIdle(); Confirm.hover.background = ButtonHover(); Confirm.active.background = ButtonHover(); Tab.normal.background = Solid(new Color(0f, 0f, 0f, 0f)); Tab.hover.background = ButtonIdle(); Tab.active.background = ButtonHover(); } public static Texture2D Solid(Color color) { //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_0006: 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) int hashCode = ((object)Color32.op_Implicit(color)/*cast due to .constrained prefix*/).GetHashCode(); if (SolidCache.TryGetValue(hashCode, out var value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = New(1, 1); val.SetPixel(0, 0, color); val.Apply(); SolidCache[hashCode] = val; return val; } public static Texture2D Panel() { //IL_004e: 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_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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_panel != (Object)null) { return _panel; } Color[] array = (Color[])(object)new Color[2048]; Random random = new Random(90210); for (int i = 0; i < 256; i++) { float num = 1f - (float)i / 255f; Color val = Color.Lerp(new Color(0.055f, 0.055f, 0.065f), new Color(0.105f, 0.1f, 0.098f), num); for (int j = 0; j < 8; j++) { float num2 = ((float)random.NextDouble() - 0.5f) * 0.018f; array[i * 8 + j] = new Color(val.r + num2, val.g + num2, val.b + num2, 0.985f); } } _panel = New(8, 256); _panel.SetPixels(array); _panel.Apply(); return _panel; } public static Texture2D Backdrop() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_backdrop != (Object)null) { return _backdrop; } Color[] array = (Color[])(object)new Color[65536]; float num = 128f; for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { float num2 = ((float)j + 0.5f - num) / num; float num3 = ((float)i + 0.5f - num) / num; float num4 = Mathf.Clamp01(Mathf.Sqrt(num2 * num2 + num3 * num3) / 1.414f); array[i * 256 + j] = new Color(0f, 0f, 0f, Mathf.Lerp(0.62f, 0.94f, num4 * num4)); } } _backdrop = New(256, 256); _backdrop.SetPixels(array); _backdrop.Apply(); return _backdrop; } public static Texture2D Disc() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_disc != (Object)null) { return _disc; } Color[] array = (Color[])(object)new Color[4096]; float num = 32f; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num2 = ((float)j + 0.5f - num) / num; float num3 = ((float)i + 0.5f - num) / num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = 1f - Mathf.SmoothStep(0.86f, 1f, num4); array[i * 64 + j] = new Color(1f, 1f, 1f, num5); } } _disc = New(64, 64); _disc.SetPixels(array); _disc.Apply(); return _disc; } public static Texture2D Rule() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_rule != (Object)null) { return _rule; } Color[] array = (Color[])(object)new Color[256]; for (int i = 0; i < 256; i++) { float num = Mathf.Sin((float)i / 255f * (float)Math.PI); array[i] = new Color(1f, 1f, 1f, num * num); } _rule = New(256, 1); _rule.SetPixels(array); _rule.Apply(); return _rule; } public static Texture2D ButtonIdle() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_buttonIdle != (Object)null) { return _buttonIdle; } _buttonIdle = VerticalBar(new Color(0.16f, 0.14f, 0.11f, 0.95f), new Color(0.09f, 0.08f, 0.07f, 0.95f)); return _buttonIdle; } public static Texture2D ButtonHover() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_buttonHover != (Object)null) { return _buttonHover; } _buttonHover = VerticalBar(new Color(0.34f, 0.28f, 0.17f, 0.98f), new Color(0.16f, 0.13f, 0.09f, 0.98f)); return _buttonHover; } private static Texture2D VerticalBar(Color top, Color bottom) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Color[] array = (Color[])(object)new Color[64]; for (int i = 0; i < 64; i++) { array[i] = Color.Lerp(bottom, top, (float)i / 63f); } Texture2D obj = New(1, 64); obj.SetPixels(array); obj.Apply(); return obj; } private static Texture2D New(int width, int height) { //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_0010: 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_0020: Expected O, but got Unknown return new Texture2D(width, height, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; } public static void Fill(Rect rect, Texture2D texture, Color tint) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) Color color = GUI.color; tint.a *= color.a; GUI.color = tint; GUI.DrawTexture(rect, (Texture)(object)texture); GUI.color = color; } public static void Frame(Rect rect, Color color, float thickness = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Texture2D texture = Solid(Color.white); Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, thickness), texture, color); Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax - thickness, ((Rect)(ref rect)).width, thickness), texture, color); Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), texture, color); Fill(new Rect(((Rect)(ref rect)).xMax - thickness, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), texture, color); } public static void HorizontalRule(Rect rect, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Fill(rect, Rule(), color); } public static void FitLabel(Rect rect, string text, GUIStyle style, int maxSize, int minSize) { //IL_003f: 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) Scratch.text = text; int num = (style.fontSize = maxSize); while (num > minSize && style.CalcSize(Scratch).x > ((Rect)(ref rect)).width) { num = (style.fontSize = num - 1); } GUI.Label(rect, text, style); } } public static class NornsStaffModels { public enum Style { Apprentice, Runic, Seidr, UruzCleaver } private sealed class Frame { public Transform Anchor; public Vector3 Long; public Vector3 Right; public Vector3 Forward; public Vector3 Base; public float Length; } public static void ReplaceVanillaVisual(GameObject prefab, Style style) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown if ((Object)(object)prefab == (Object)null) { return; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); Transform val = FindVisualAnchor(prefab, componentsInChildren); Frame frame = MeasureFrame(val, componentsInChildren); Material template = FindTemplate(componentsInChildren); Renderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { array[i].enabled = false; } DisableInheritedFx(prefab); GameObject val2 = new GameObject("norns_" + style.ToString().ToLowerInvariant() + "_model"); val2.layer = prefab.layer; val2.transform.SetParent(val, false); bool flag = TryAttachAuthoredStaff(val2.transform, frame, style); if (!flag) { switch (style) { case Style.Apprentice: BuildApprentice(val2.transform, frame, template); break; case Style.Runic: BuildRunic(val2.transform, frame, template); break; case Style.Seidr: BuildSeidr(val2.transform, frame, template); break; case Style.UruzCleaver: BuildUruzCleaver(val2.transform, frame, template); break; } } Plugin.Log.LogInfo((object)($"Modello originale {style} " + (flag ? "authorato" : "fallback procedurale") + " su " + ((Object)val).name + " " + $"(lunghezza {frame.Length:0.00} m). Mesh vanilla disattivate.")); } private static bool TryAttachAuthoredStaff(Transform root, Frame frame, Style style) { //IL_00d5: 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_00cd: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0128: 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) float num = 2.2f; string assetPath; switch (style) { case Style.Apprentice: assetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_apprentice.prefab"; break; case Style.Runic: assetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_runic.prefab"; break; case Style.Seidr: assetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_seidr.prefab"; break; case Style.UruzCleaver: assetPath = "assets/mod/vfx/equipment/berserkerweapons/norns_weapon_uruzcleaver.prefab"; num = 2.05f; break; default: return false; } GameObject prefab = VfxAssets.GetPrefab(assetPath); if ((Object)(object)prefab == (Object)null) { Plugin.Log.LogWarning((object)($"Prefab staff authorato non disponibile per {style}; " + "uso il fallback procedurale.")); return false; } bool forceDisableInit = ZNetView.m_forceDisableInit; try { ZNetView.m_forceDisableInit = true; GameObject obj = Object.Instantiate(prefab); ((Object)obj).name = "norns_" + style.ToString().ToLowerInvariant() + "_authored"; obj.transform.SetParent(root, false); obj.transform.localPosition = ((style == Style.UruzCleaver) ? Vector3.Project(frame.Base, frame.Long) : frame.Base); obj.transform.localRotation = ((style == Style.UruzCleaver) ? Quaternion.LookRotation(-frame.Forward, frame.Long) : Quaternion.LookRotation(frame.Forward, frame.Long)); obj.transform.localScale = Vector3.one * (frame.Length / num); SetLayerRecursively(obj.transform, ((Component)root).gameObject.layer); obj.SetActive(true); return true; } catch (Exception arg) { Plugin.Log.LogError((object)$"Aggancio prefab staff {style} fallito: {arg}"); return false; } finally { ZNetView.m_forceDisableInit = forceDisableInit; } } private static void SetLayerRecursively(Transform root, int layer) { ((Component)root).gameObject.layer = layer; for (int i = 0; i < root.childCount; i++) { SetLayerRecursively(root.GetChild(i), layer); } } private static Transform FindVisualAnchor(GameObject prefab, Renderer[] renderers) { Transform result = prefab.transform; Transform[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (!((Object)val).name.Equals("attach", StringComparison.OrdinalIgnoreCase)) { continue; } foreach (Renderer val2 in renderers) { if ((Object)(object)val2 != (Object)null && ((Component)val2).transform.IsChildOf(val)) { return val; } } result = val; } return result; } private static Frame MeasureFrame(Transform anchor, Renderer[] renderers) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0292: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //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_00c7: 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_00b7: Unknown result type (might be due to invalid IL or missing references) bool flag = false; Bounds bounds = default(Bounds); List list = new List(); foreach (Renderer val in renderers) { if ((Object)(object)val == (Object)null || !((Component)val).transform.IsChildOf(anchor)) { continue; } Mesh val2 = MeshOf(val); if ((Object)(object)val2 == (Object)null) { continue; } Bounds bounds2 = val2.bounds; for (int j = -1; j <= 1; j += 2) { for (int k = -1; k <= 1; k += 2) { for (int l = -1; l <= 1; l += 2) { Vector3 val3 = ((Bounds)(ref bounds2)).center + Vector3.Scale(((Bounds)(ref bounds2)).extents, new Vector3((float)j, (float)k, (float)l)); Vector3 val4 = anchor.InverseTransformPoint(((Component)val).transform.TransformPoint(val3)); if (!flag) { ((Bounds)(ref bounds))..ctor(val4, Vector3.zero); flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val4); } } } } if (val2.isReadable) { Vector3[] vertices = val2.vertices; int num = Mathf.Max(1, vertices.Length / 400); for (int m = 0; m < vertices.Length; m += num) { list.Add(anchor.InverseTransformPoint(((Component)val).transform.TransformPoint(vertices[m]))); } } } Vector3 val5; if (flag) { val5 = ((Bounds)(ref bounds)).size; if (!(((Vector3)(ref val5)).magnitude < 0.25f)) { goto IL_0196; } } ((Bounds)(ref bounds))..ctor(Vector3.zero, new Vector3(0.3f, 2.1f, 0.3f)); goto IL_0196; IL_0196: int axis = LongestAxis(((Bounds)(ref bounds)).size); Vector3 val6 = Axis(axis); float num2 = Component(((Bounds)(ref bounds)).min, axis); float num3 = Mathf.Clamp(Component(((Bounds)(ref bounds)).max, axis) - num2, 2.05f, 2.65f); float num4 = EndRadius(list, bounds, axis, high: false); float num5 = ((EndRadius(list, bounds, axis, high: true) >= num4) ? 1f : (-1f)); Vector3 val7 = val6 * num5; Vector3 val8 = ((Mathf.Abs(Vector3.Dot(val7, Vector3.right)) < 0.8f) ? Vector3.right : Vector3.up); val5 = Vector3.ProjectOnPlane(val8, val7); val8 = ((Vector3)(ref val5)).normalized; val5 = Vector3.Cross(val7, val8); Vector3 normalized = ((Vector3)(ref val5)).normalized; Vector3 val9 = ((Bounds)(ref bounds)).center - val7 * (num3 * 0.5f); return new Frame { Anchor = anchor, Long = val7, Right = val8, Forward = normalized, Base = val9, Length = num3 }; } private static void BuildApprentice(Transform root, Frame f, Material template) { //IL_0022: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0140: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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_022a: 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_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: 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_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_031a: 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_0330: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) Material material = MaterialFrom(template, "apprentice_wood", new Color(0.3f, 0.12f, 0.045f), 0.02f, 0.2f); Material material2 = MaterialFrom(template, "apprentice_bronze", new Color(0.34f, 0.15f, 0.045f), 0.72f, 0.42f); Material material3 = MaterialFrom(template, "apprentice_amber", new Color(1f, 0.22f, 0.015f), 0.05f, 0.62f, (Color?)new Color(2f, 0.28f, 0.02f)); float l = f.Length; Vector3[] array = Path(19, (float t) => f.Base + f.Long * (l * (0.035f + 0.76f * t)) + f.Right * (Mathf.Sin(t * 5.2f) * l * 0.018f * (1f - t * 0.35f)) + f.Forward * (Mathf.Sin(t * 8.1f + 0.8f) * l * 0.01f)); AddTube(root, "crooked_pine_shaft", array, Radii(array.Length, l * 0.024f, l * 0.017f), 9, material); Vector3 val = array[^1]; Vector3 val2 = f.Base + f.Long * (l * 0.9f); for (int num = 0; num < 3; num++) { float num2 = (float)num * (float)Math.PI * 2f / 3f + 0.35f; Vector3 val3 = f.Right * Mathf.Cos(num2) + f.Forward * Mathf.Sin(num2); Vector3[] points = (Vector3[])(object)new Vector3[3] { val - f.Long * (l * 0.015f), val + f.Long * (l * 0.055f) + val3 * (l * 0.043f), val2 + val3 * (l * 0.032f) + f.Long * (l * 0.04f) }; AddTube(root, $"amber_claw_{num}", points, Radii(3, l * 0.011f, l * 0.006f), 7, material); } AddCrystal(root, "raw_amber_core", val2, f.Long, f.Right, f.Forward, l * 0.12f, l * 0.044f, 6, material3); AddTorus(root, "bronze_head_binding", val + f.Long * (l * 0.022f), f.Long, f.Right, f.Forward, l * 0.029f, l * 0.005f, material2); AddTorus(root, "bronze_grip_binding", array[4], f.Long, f.Right, f.Forward, l * 0.026f, l * 0.0045f, material2); Vector3 origin = array[12] + f.Forward * (l * 0.02f); AddRune(root, "first_spark_rune", origin, f.Long, f.Right, l * 0.062f, l * 0.022f, l * 0.0028f, material3); } private static void BuildRunic(Transform root, Frame f, Material template) { //IL_0022: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0140: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) Material material = MaterialFrom(template, "runic_ancient_bark", new Color(0.12f, 0.15f, 0.14f), 0.04f, 0.18f); Material material2 = MaterialFrom(template, "runic_dark_iron", new Color(0.1f, 0.14f, 0.16f), 0.82f, 0.48f); Material material3 = MaterialFrom(template, "runic_frost_crystal", new Color(0.02f, 0.7f, 1f), 0.08f, 0.72f, (Color?)new Color(0.04f, 1.25f, 2.3f)); float l = f.Length; Vector3[] array = Path(20, (float t) => f.Base + f.Long * (l * (0.025f + 0.75f * t)) + f.Right * (Mathf.Sin(t * 3.5f + 0.4f) * l * 0.01f) + f.Forward * (Mathf.Sin(t * 6.2f) * l * 0.007f)); AddTube(root, "ancient_bark_shaft", array, Radii(array.Length, l * 0.022f, l * 0.015f), 10, material); Vector3 val = array[^1]; Vector3 val2 = f.Base + f.Long * (l * 0.885f); for (int num = -1; num <= 1; num += 2) { Vector3[] points = (Vector3[])(object)new Vector3[4] { val, val + f.Long * (l * 0.07f) + f.Right * ((float)num * l * 0.05f), val2 + f.Long * (l * 0.09f) + f.Right * ((float)num * l * 0.078f), val2 + f.Long * (l * 0.135f) + f.Right * ((float)num * l * 0.05f) }; AddTube(root, (num < 0) ? "left_runic_fork" : "right_runic_fork", points, Radii(4, l * 0.012f, l * 0.006f), 8, material2); } AddCrystal(root, "mountain_crystal", val2, f.Long, f.Right, f.Forward, l * 0.15f, l * 0.044f, 6, material3); AddTorus(root, "iron_grip", array[5], f.Long, f.Right, f.Forward, l * 0.024f, l * 0.005f, material2); AddTorus(root, "iron_neck", val, f.Long, f.Right, f.Forward, l * 0.025f, l * 0.005f, material2); for (int num2 = 0; num2 < 3; num2++) { Vector3 origin = array[10 + num2 * 2] + f.Forward * (l * 0.018f); AddRune(root, $"frost_rune_{num2}", origin, f.Long, f.Right, l * 0.045f, l * 0.017f, l * 0.0022f, material3); } } private static void BuildSeidr(Transform root, Frame f, Material template) { //IL_0022: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0120: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_026b: 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_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: 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_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: 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_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) Material material = MaterialFrom(template, "seidr_black_metal", new Color(0.075f, 0.05f, 0.11f), 0.92f, 0.58f); Material material2 = MaterialFrom(template, "seidr_old_gold", new Color(0.52f, 0.27f, 0.055f), 0.88f, 0.58f, (Color?)new Color(0.24f, 0.09f, 0.01f)); Material material3 = MaterialFrom(template, "seidr_violet_core", new Color(0.53f, 0.035f, 0.92f), 0.08f, 0.78f, (Color?)new Color(1.1f, 0.06f, 2.45f)); Material material4 = MaterialFrom(template, "seidr_gold_thread", new Color(1f, 0.58f, 0.08f), 0.15f, 0.75f, (Color?)new Color(2.8f, 1.25f, 0.08f)); Material material5 = MaterialFrom(template, "seidr_cyan_thread", new Color(0.08f, 0.8f, 1f), 0.1f, 0.75f, (Color?)new Color(0.1f, 2f, 3.2f)); float l = f.Length; Vector3[] array = Path(21, (float t) => f.Base + f.Long * (l * (0.02f + 0.76f * t)) + f.Right * (Mathf.Sin(t * 2.4f) * l * 0.006f)); AddTube(root, "black_metal_spine", array, Radii(array.Length, l * 0.02f, l * 0.014f), 10, material); Vector3 val = array[^1]; Vector3 val2 = f.Base + f.Long * (l * 0.89f); for (int num = 0; num < 6; num++) { float num2 = (float)num * (float)Math.PI * 2f / 6f; Vector3 val3 = f.Right * Mathf.Cos(num2) + f.Forward * Mathf.Sin(num2); Vector3[] points = (Vector3[])(object)new Vector3[4] { val, val + f.Long * (l * 0.072f) + val3 * (l * 0.047f), val2 + f.Long * (l * 0.072f) + val3 * (l * 0.078f), val2 + f.Long * (l * 0.135f) + val3 * (l * 0.048f) }; AddTube(root, $"seidr_crown_{num}", points, Radii(4, l * 0.009f, l * 0.0045f), 7, material); } AddCrystal(root, "seidr_heart", val2, f.Long, f.Right, f.Forward, l * 0.14f, l * 0.046f, 7, material3); AddTorus(root, "gold_grip", array[5], f.Long, f.Right, f.Forward, l * 0.022f, l * 0.0045f, material2); AddTorus(root, "gold_neck", val, f.Long, f.Right, f.Forward, l * 0.024f, l * 0.0048f, material2); AddHelix(root, "violet_fate_thread", f, l * 0.62f, l * 0.98f, l * 0.039f, 2.2f, 0f, l * 0.0027f, material3); AddHelix(root, "gold_fate_thread", f, l * 0.62f, l * 0.98f, l * 0.039f, 2.2f, (float)Math.PI * 2f / 3f, l * 0.0027f, material4); AddHelix(root, "cyan_fate_thread", f, l * 0.62f, l * 0.98f, l * 0.039f, 2.2f, 4.1887903f, l * 0.0027f, material5); } private static void BuildUruzCleaver(Transform root, Frame f, Material template) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0424: 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_043a: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: 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_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0586: 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_05bb: 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_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0657: 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_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_0892: Unknown result type (might be due to invalid IL or missing references) //IL_08a3: Unknown result type (might be due to invalid IL or missing references) //IL_08a8: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) root.localPosition = -Vector3.ProjectOnPlane(f.Base, f.Long); Material material = WeaponMaterial(template, "uruz_dark_wood", new Color(0.3f, 0.115f, 0.038f), 0.01f, 0.18f, 1193, grain: true); Material material2 = WeaponMaterial(template, "uruz_worn_leather", new Color(0.34f, 0.115f, 0.035f), 0.01f, 0.2f, 3011, grain: true); Material material3 = WeaponMaterial(template, "uruz_chipped_flint", new Color(0.3f, 0.315f, 0.33f), 0.04f, 0.22f, 4789, grain: false); Material edgeMaterial = WeaponMaterial(template, "uruz_flint_edges", new Color(0.58f, 0.54f, 0.46f), 0.08f, 0.28f, 5521, grain: false); Material material4 = WeaponMaterial(template, "uruz_flint_facets", new Color(0.305f, 0.285f, 0.25f), 0.04f, 0.26f, 6791, grain: false); Material val = WeaponMaterial(template, "uruz_flint_shadow", new Color(0.145f, 0.155f, 0.17f), 0.03f, 0.18f, 7331, grain: false); Material material5 = WeaponMaterial(template, "uruz_bone_wedges", new Color(0.72f, 0.59f, 0.38f), 0.01f, 0.2f, 8101, grain: true); Material material6 = WeaponMaterial(template, "uruz_crimson_rune", new Color(0.82f, 0.035f, 0.012f), 0.06f, 0.62f, 9011, grain: false, (Color?)new Color(1.25f, 0.025f, 0.008f)); float l = f.Length; Vector3[] array = Path(24, (float t) => f.Base + f.Long * (l * (-0.025f + 0.88f * t)) + f.Right * (Mathf.Sin(t * 4.1f) * l * 0.0035f) + f.Forward * (Mathf.Sin(t * 7.4f + 0.5f) * l * 0.0025f)); AddTube(root, "uruz_hewn_shaft", array, Radii(array.Length, l * 0.0105f, l * 0.0082f), 10, material); AddHelix(root, "lower_leather_grip", f, l * 0.04f, l * 0.235f, l * 0.012f, 8.5f, 0f, l * 0.0025f, material2); AddHelix(root, "upper_leather_grip", f, l * 0.655f, l * 0.79f, l * 0.01f, 5.5f, 0.8f, l * 0.0022f, material2); AddTorus(root, "lower_grip_stop", f.Base + f.Long * (l * 0.035f), f.Long, f.Right, f.Forward, l * 0.0125f, l * 0.0025f, material2); AddTorus(root, "head_grip_stop", f.Base + f.Long * (l * 0.8f), f.Long, f.Right, f.Forward, l * 0.011f, l * 0.0023f, material2); Vector3 val2 = f.Base + f.Long * (l * 0.855f); AddAxeBlade(root, "uruz_broad_blade", val2, f.Long, f.Right, f.Forward, 1f, l, material3, edgeMaterial, val); AddCrystal(root, "uruz_rear_counterspike", val2 - f.Right * (l * 0.055f), f.Right, f.Long, f.Forward, l * 0.125f, l * 0.027f, 6, val); Vector3[] array2 = (Vector3[])(object)new Vector3[2] { val2 - f.Long * (l * 0.072f), val2 + f.Long * (l * 0.072f) }; AddTube(root, "flint_socket", array2, Radii(array2.Length, l * 0.036f, l * 0.032f), 10, val); AddTorus(root, "lower_socket_rim", val2 - f.Long * (l * 0.06f), f.Long, f.Right, f.Forward, l * 0.036f, l * 0.0045f, material4); AddTorus(root, "upper_socket_rim", val2 + f.Long * (l * 0.06f), f.Long, f.Right, f.Forward, l * 0.033f, l * 0.004f, material4); for (int num = -1; num <= 1; num += 2) { Vector3 val3 = val2 + f.Long * ((float)num * l * 0.032f); Vector3[] array3 = (Vector3[])(object)new Vector3[3] { val3 - f.Right * (l * 0.078f) + f.Forward * (l * 0.024f), val3, val3 + f.Right * (l * 0.078f) + f.Forward * (l * 0.024f) }; AddTube(root, $"cross_head_binding_{num + 1}", array3, Radii(array3.Length, l * 0.004f, l * 0.003f), 7, material2); } for (int num2 = -1; num2 <= 1; num2 += 2) { AddCrystal(root, $"bone_socket_pin_{num2 + 1}", val2 + f.Long * ((float)num2 * l * 0.042f) - f.Right * (l * 0.02f), f.Forward, f.Right, f.Long, l * 0.052f, l * 0.009f, 5, material5); } Vector3 val4 = val2 + f.Right * (l * 0.145f); AddUruzRune(root, "uruz_mark_front", val4 + f.Forward * (l * 0.0215f), f.Long, f.Right, l * 0.07f, l * 0.038f, l * 0.0021f, material6); AddUruzRune(root, "uruz_mark_back", val4 - f.Forward * (l * 0.0215f), f.Long, f.Right, l * 0.07f, l * 0.038f, l * 0.0021f, material6); } private static void AddAxeBlade(Transform root, string name, Vector3 center, Vector3 longitudinal, Vector3 horizontal, Vector3 forward, float side, float length, Material material, Material edgeMaterial, Material shadowMaterial) { //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_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_001d: 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_002f: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0066: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b3: 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_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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e5: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0104: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_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_0135: 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_013f: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0253: 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) //IL_0265: 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_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_0299: 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_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: 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_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: 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_041f: 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_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[14] { center - longitudinal * (length * 0.034f) + horizontal * (side * length * 0.012f), center - longitudinal * (length * 0.026f) + horizontal * (side * length * 0.07f), center - longitudinal * (length * 0.04f) + horizontal * (side * length * 0.122f), center - longitudinal * (length * 0.086f) + horizontal * (side * length * 0.184f), center - longitudinal * (length * 0.108f) + horizontal * (side * length * 0.226f), center - longitudinal * (length * 0.076f) + horizontal * (side * length * 0.247f), center - longitudinal * (length * 0.022f) + horizontal * (side * length * 0.259f), center + longitudinal * (length * 0.034f) + horizontal * (side * length * 0.26f), center + longitudinal * (length * 0.084f) + horizontal * (side * length * 0.246f), center + longitudinal * (length * 0.114f) + horizontal * (side * length * 0.218f), center + longitudinal * (length * 0.099f) + horizontal * (side * length * 0.176f), center + longitudinal * (length * 0.066f) + horizontal * (side * length * 0.108f), center + longitudinal * (length * 0.042f) + horizontal * (side * length * 0.06f), center + longitudinal * (length * 0.033f) + horizontal * (side * length * 0.012f) }; int num = array.Length; float[] array2 = new float[14] { length * 0.026f, length * 0.025f, length * 0.022f, length * 0.014f, length * 0.007f, length * 0.005f, length * 0.0042f, length * 0.0038f, length * 0.0042f, length * 0.005f, length * 0.008f, length * 0.016f, length * 0.023f, length * 0.026f }; Vector3[] array3 = (Vector3[])(object)new Vector3[num]; Vector3[] array4 = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { array3[i] = array[i] + forward * array2[i]; array4[i] = array[i] - forward * array2[i]; } Vector3 val = center + horizontal * (side * length * 0.132f); Vector3[] array5 = (Vector3[])(object)new Vector3[num * 2 + 2]; for (int j = 0; j < num; j++) { array5[j] = array3[j]; array5[num + j] = array4[j]; } int num2 = num * 2; int num3 = num2 + 1; array5[num2] = val + forward * (length * 0.022f); array5[num3] = val - forward * (length * 0.022f); List list = new List(); for (int k = 0; k < num; k++) { int num4 = (k + 1) % num; AddTriangleFacing(list, array5, num2, k, num4, forward); AddTriangleFacing(list, array5, num3, num + num4, num + k, -forward); } AddMesh(root, name + "_continuous_faces", array5, (Vector2[])(object)new Vector2[array5.Length], list.ToArray(), material); for (int l = 0; l < num; l++) { int num5 = (l + 1) % num; Vector3 val2 = Vector3.ProjectOnPlane((array[l] + array[num5]) * 0.5f - val, forward); Vector3 normalized = ((Vector3)(ref val2)).normalized; Material material2 = ((l >= 3 && l <= 9) ? edgeMaterial : shadowMaterial); AddBladeWall(root, $"{name}_edge_wall_{l}", array3[l], array4[l], array3[num5], array4[num5], material2, normalized); } AddBladeBevelStrip(root, name + "_sharpened_bevel", array3, array4, array5[num2], array5[num3], 4, 10, forward, length, edgeMaterial); Vector3[] array6 = (Vector3[])(object)new Vector3[7]; Vector3[] array7 = (Vector3[])(object)new Vector3[7]; for (int m = 4; m <= 10; m++) { array6[m - 4] = array3[m] + forward * (length * 0.001f); array7[m - 4] = array4[m] - forward * (length * 0.001f); } AddTube(root, name + "_chipped_edge_front", array6, Radii(array6.Length, length * 0.0015f, length * 0.001f), 6, edgeMaterial); AddTube(root, name + "_chipped_edge_back", array7, Radii(array7.Length, length * 0.0015f, length * 0.001f), 6, edgeMaterial); Vector3[] points = (Vector3[])(object)new Vector3[2] { Vector3.Lerp(array5[num2], array3[4], 0.38f) + forward * (length * 0.0012f), Vector3.Lerp(array5[num2], array3[4], 0.68f) + forward * (length * 0.0012f) }; Vector3[] points2 = (Vector3[])(object)new Vector3[2] { Vector3.Lerp(array5[num2], array3[9], 0.35f) + forward * (length * 0.0012f), Vector3.Lerp(array5[num2], array3[9], 0.64f) + forward * (length * 0.0012f) }; AddTube(root, name + "_crack_a", points, Radii(2, length * 0.0028f, length * 0.0014f), 5, shadowMaterial); AddTube(root, name + "_crack_b", points2, Radii(2, length * 0.0026f, length * 0.0013f), 5, shadowMaterial); } private static void AddBladeWall(Transform root, string name, Vector3 frontA, Vector3 backA, Vector3 frontB, Vector3 backB, Material material, Vector3 expectedNormal) { //IL_0008: 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_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_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) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[4] { frontA, backA, frontB, backB }; int[] triangles = new int[6] { 0, 1, 2, 2, 1, 3 }; if (Vector3.Dot(Vector3.Cross(array[1] - array[0], array[2] - array[0]), expectedNormal) < 0f) { triangles = new int[6] { 0, 2, 1, 2, 3, 1 }; } AddMesh(root, name, array, (Vector2[])(object)new Vector2[4], triangles, material); } private static void AddBladeBevelStrip(Transform root, string name, Vector3[] front, Vector3[] back, Vector3 frontCenter, Vector3 backCenter, int start, int end, Vector3 forward, float length, Material material) { //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_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_002f: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: 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) for (int i = start; i < end; i++) { float num = length * 0.0011f; Vector3 val = front[i] + forward * num; Vector3 val2 = front[i + 1] + forward * num; Vector3 val3 = Vector3.Lerp(frontCenter, front[i], 0.76f) + forward * num; Vector3 val4 = Vector3.Lerp(frontCenter, front[i + 1], 0.76f) + forward * num; Vector3[] vertices = (Vector3[])(object)new Vector3[4] { val, val2, val3, val4 }; List list = new List(); AddTriangleFacing(list, vertices, 0, 1, 2, forward); AddTriangleFacing(list, vertices, 1, 3, 2, forward); AddMesh(root, $"{name}_front_{i}", vertices, (Vector2[])(object)new Vector2[4], list.ToArray(), material); Vector3 val5 = back[i] - forward * num; Vector3 val6 = back[i + 1] - forward * num; Vector3 val7 = Vector3.Lerp(backCenter, back[i], 0.76f) - forward * num; Vector3 val8 = Vector3.Lerp(backCenter, back[i + 1], 0.76f) - forward * num; Vector3[] vertices2 = (Vector3[])(object)new Vector3[4] { val5, val6, val7, val8 }; List list2 = new List(); AddTriangleFacing(list2, vertices2, 0, 2, 1, -forward); AddTriangleFacing(list2, vertices2, 1, 2, 3, -forward); AddMesh(root, $"{name}_back_{i}", vertices2, (Vector2[])(object)new Vector2[4], list2.ToArray(), material); } } private static void AddTriangleFacing(List triangles, Vector3[] vertices, int a, int b, int c, Vector3 expectedNormal) { //IL_0002: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(Vector3.Cross(vertices[b] - vertices[a], vertices[c] - vertices[a]), expectedNormal) < 0f) { int num = c; c = b; b = num; } triangles.Add(a); triangles.Add(b); triangles.Add(c); } private static void AddUruzRune(Transform root, string name, Vector3 origin, Vector3 longitudinal, Vector3 horizontal, float height, float width, float radius, Material material) { //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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) //IL_0066: 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_007a: 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_007c: 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_008a: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Vector3 val = origin - longitudinal * (height * 0.5f) - horizontal * (width * 0.5f); Vector3 val2 = origin + longitudinal * (height * 0.5f) - horizontal * (width * 0.5f); Vector3 val3 = origin + longitudinal * (height * 0.2f) + horizontal * (width * 0.5f); Vector3 val4 = origin - longitudinal * (height * 0.5f) + horizontal * (width * 0.5f); Vector3[] array = (Vector3[])(object)new Vector3[4] { val, val2, val3, val4 }; AddTube(root, name, array, Radii(array.Length, radius, radius), 6, material); } private static void AddRune(Transform root, string name, Vector3 origin, Vector3 longitudinal, Vector3 horizontal, float height, float width, float radius, Material material) { //IL_0008: 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_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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[3] { origin - longitudinal * (height * 0.5f) - horizontal * (width * 0.5f), origin, origin + longitudinal * (height * 0.5f) - horizontal * (width * 0.5f) }; Vector3[] array2 = (Vector3[])(object)new Vector3[2] { origin, origin + horizontal * (width * 0.6f) }; AddTube(root, name + "_spine", array, Radii(array.Length, radius, radius), 6, material); AddTube(root, name + "_arm", array2, Radii(array2.Length, radius, radius), 6, material); } private static void AddHelix(Transform root, string name, Frame f, float from, float to, float helixRadius, float turns, float phase, float tubeRadius, Material material) { Vector3[] array = Path(30, delegate(float t) { //IL_0022: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) float num = phase + t * turns * (float)Math.PI * 2f; return f.Base + f.Long * Mathf.Lerp(from, to, t) + f.Right * (Mathf.Cos(num) * helixRadius) + f.Forward * (Mathf.Sin(num) * helixRadius); }); AddTube(root, name, array, Radii(array.Length, tubeRadius, tubeRadius), 6, material); } private static void AddTube(Transform root, string name, Vector3[] points, float[] radii, int sides, Material material) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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_0067: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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) //IL_00d3: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00e5: 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_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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_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 references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (points == null || points.Length < 2) { return; } sides = Mathf.Max(5, sides); int num = points.Length; Vector3[] array = (Vector3[])(object)new Vector3[num * sides]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[(num - 1) * sides * 6]; Vector3 val = Vector3.up; for (int i = 0; i < num; i++) { Vector3 val2 = ((i == 0) ? (points[1] - points[0]) : ((i == num - 1) ? (points[i] - points[i - 1]) : (points[i + 1] - points[i - 1]))); ((Vector3)(ref val2)).Normalize(); if (Mathf.Abs(Vector3.Dot(val, val2)) > 0.88f) { val = Vector3.right; } Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; val3 = Vector3.Cross(val2, normalized); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; for (int j = 0; j < sides; j++) { float num2 = (float)j * (float)Math.PI * 2f / (float)sides; int num3 = i * sides + j; array[num3] = points[i] + (normalized * Mathf.Cos(num2) + normalized2 * Mathf.Sin(num2)) * radii[i]; array2[num3] = new Vector2((float)j / (float)sides, (float)i / (float)(num - 1)); } } int num4 = 0; for (int k = 0; k < num - 1; k++) { for (int l = 0; l < sides; l++) { int num5 = (l + 1) % sides; int num6 = k * sides + l; int num7 = k * sides + num5; int num8 = (k + 1) * sides + l; int num9 = (k + 1) * sides + num5; array3[num4++] = num6; array3[num4++] = num8; array3[num4++] = num7; array3[num4++] = num7; array3[num4++] = num8; array3[num4++] = num9; } } AddMesh(root, name, array, array2, array3, material); } private static void AddCrystal(Transform root, string name, Vector3 center, Vector3 longitudinal, Vector3 right, Vector3 forward, float height, float radius, int sides, Material material) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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) List list = new List(); List list2 = new List(); Vector3 a = center + longitudinal * (height * 0.58f); Vector3 a2 = center - longitudinal * (height * 0.42f); for (int i = 0; i < sides; i++) { float num = (float)i * (float)Math.PI * 2f / (float)sides; float num2 = (float)(i + 1) * (float)Math.PI * 2f / (float)sides; Vector3 val = center + right * (Mathf.Cos(num) * radius) + forward * (Mathf.Sin(num) * radius); Vector3 val2 = center + right * (Mathf.Cos(num2) * radius) + forward * (Mathf.Sin(num2) * radius); AddFacet(list, list2, a, val, val2); AddFacet(list, list2, a2, val2, val); } AddMesh(root, name, list.ToArray(), (Vector2[])(object)new Vector2[list.Count], list2.ToArray(), material); } private static void AddTorus(Transform root, string name, Vector3 center, Vector3 longitudinal, Vector3 right, Vector3 forward, float radius, float thickness, Material material) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[108]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[648]; for (int i = 0; i < 18; i++) { float num = (float)i * (float)Math.PI * 2f / 18f; Vector3 val = right * Mathf.Cos(num) + forward * Mathf.Sin(num); for (int j = 0; j < 6; j++) { float num2 = (float)j * (float)Math.PI * 2f / 6f; array[i * 6 + j] = center + val * (radius + Mathf.Cos(num2) * thickness) + longitudinal * (Mathf.Sin(num2) * thickness); array2[i * 6 + j] = new Vector2((float)i / 18f, (float)j / 6f); } } int num3 = 0; for (int k = 0; k < 18; k++) { for (int l = 0; l < 6; l++) { int num4 = (k + 1) % 18; int num5 = (l + 1) % 6; int num6 = k * 6 + l; int num7 = num4 * 6 + l; int num8 = k * 6 + num5; int num9 = num4 * 6 + num5; array3[num3++] = num6; array3[num3++] = num7; array3[num3++] = num8; array3[num3++] = num8; array3[num3++] = num7; array3[num3++] = num9; } } AddMesh(root, name, array, array2, array3, material); } private static void AddMesh(Transform root, string name, Vector3[] vertices, Vector2[] uv, int[] triangles, Material material) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name) { layer = ((Component)root).gameObject.layer }; val.transform.SetParent(root, false); Mesh val2 = new Mesh { name = name + "_mesh", hideFlags = (HideFlags)61, vertices = vertices, uv = uv, triangles = triangles }; val2.RecalculateNormals(); val2.RecalculateBounds(); val.AddComponent().sharedMesh = val2; ((Renderer)val.AddComponent()).sharedMaterial = material; } private static Material WeaponMaterial(Material fallback, string name, Color color, float metallic, float gloss, int seed, bool grain, Color? emission = null) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) Shader val = Shader.Find("Standard"); Material val2 = (((Object)(object)val != (Object)null) ? new Material(val) : (((Object)(object)fallback != (Object)null) ? new Material(fallback) : new Material(Shader.Find("Sprites/Default")))); ((Object)val2).name = name; ((Object)val2).hideFlags = (HideFlags)61; Texture2D val3 = SurfaceTexture(name + "_surface", color, seed, grain); if (val2.HasProperty("_MainTex")) { val2.SetTexture("_MainTex", (Texture)(object)val3); val2.SetTextureScale("_MainTex", grain ? new Vector2(2f, 4f) : new Vector2(2f, 2f)); } if (val2.HasProperty("_Color")) { val2.SetColor("_Color", Color.white); } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", Color.white); } if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", metallic); } if (val2.HasProperty("_Glossiness")) { val2.SetFloat("_Glossiness", gloss); } if (val2.HasProperty("_Smoothness")) { val2.SetFloat("_Smoothness", gloss); } if (val2.HasProperty("_BumpMap")) { val2.SetTexture("_BumpMap", (Texture)null); } if (val2.HasProperty("_MetallicGlossMap")) { val2.SetTexture("_MetallicGlossMap", (Texture)null); } if (emission.HasValue && val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", emission.Value); } else if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", Color.black); } return val2; } private static Texture2D SurfaceTexture(string name, Color color, int seed, bool grain) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0029: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = name, hideFlags = (HideFlags)61, wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1 }; Color[] array = (Color[])(object)new Color[4096]; Random random = new Random(seed); float num = (float)random.NextDouble() * (float)Math.PI * 2f; float num2 = (float)random.NextDouble() * (float)Math.PI * 2f; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num3 = (float)j / 64f; float num4 = (float)i / 64f; float num5 = (grain ? Mathf.Sin(num3 * (float)Math.PI * 10f + Mathf.Sin(num4 * (float)Math.PI * 3f) * 0.8f + num) : (Mathf.Sin((num3 * 5.2f + num4 * 3.1f) * (float)Math.PI + num) * Mathf.Sin((num3 * 2.4f - num4 * 4.7f) * (float)Math.PI + num2))); float num6 = (float)random.NextDouble() * 2f - 1f; float num7 = (grain ? (0.82f + num5 * 0.12f + num6 * 0.055f) : (0.83f + num5 * 0.16f + num6 * 0.085f)); Color val2 = color * Mathf.Clamp(num7, 0.55f, 1.12f); val2.a = 1f; array[i * 64 + j] = val2; } } val.SetPixels(array); val.Apply(false, true); return val; } private static Material MaterialFrom(Material template, string name, Color color, float metallic, float gloss, Color? emission = null) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0093: 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_00f5: Unknown result type (might be due to invalid IL or missing references) Material val = ((!((Object)(object)template != (Object)null)) ? new Material(Shader.Find("Standard")) : new Material(template)); ((Object)val).name = name; ((Object)val).hideFlags = (HideFlags)61; if (val.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); } if (val.HasProperty("_BumpMap")) { val.SetTexture("_BumpMap", (Texture)null); } if (val.HasProperty("_MetallicGlossMap")) { val.SetTexture("_MetallicGlossMap", (Texture)null); } if (val.HasProperty("_Color")) { val.SetColor("_Color", color); } if (val.HasProperty("_Metallic")) { val.SetFloat("_Metallic", metallic); } if (val.HasProperty("_Glossiness")) { val.SetFloat("_Glossiness", gloss); } if (emission.HasValue && val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", emission.Value); } else if (val.HasProperty("_EmissionColor")) { val.SetColor("_EmissionColor", Color.black); } return val; } private static Material FindTemplate(Renderer[] renderers) { foreach (Renderer val in renderers) { if ((Object)(object)val == (Object)null || (Object)(object)MeshOf(val) == (Object)null) { continue; } Material[] sharedMaterials = val.sharedMaterials; foreach (Material val2 in sharedMaterials) { if ((Object)(object)val2 != (Object)null) { return val2; } } } return null; } private static void DisableInheritedFx(GameObject prefab) { //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) ParticleSystem[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).enabled = false; ParticleSystemRenderer component = ((Component)obj).GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).enabled = false; } } Light[] componentsInChildren2 = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = false; } } private static Mesh MeshOf(Renderer renderer) { if ((Object)(object)((renderer is MeshRenderer) ? renderer : null) != (Object)null) { MeshFilter component = ((Component)renderer).GetComponent(); if (!((Object)(object)component != (Object)null)) { return null; } return component.sharedMesh; } SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (!((Object)(object)val != (Object)null)) { return null; } return val.sharedMesh; } private static float EndRadius(List samples, Bounds bounds, int axis, bool high) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (samples.Count == 0) { return 0f; } float num = Component(((Bounds)(ref bounds)).min, axis); float num2 = Component(((Bounds)(ref bounds)).max, axis); float num3 = Mathf.Lerp(num, num2, high ? 0.72f : 0.28f); float num4 = 0f; foreach (Vector3 sample in samples) { float num5 = Component(sample, axis); if (!(high ? (num5 < num3) : (num5 > num3))) { Vector3 val = sample - ((Bounds)(ref bounds)).center - Axis(axis) * (num5 - Component(((Bounds)(ref bounds)).center, axis)); num4 = Mathf.Max(num4, ((Vector3)(ref val)).magnitude); } } return num4; } private static void AddFacet(List vertices, List triangles, Vector3 a, Vector3 b, Vector3 c) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) int count = vertices.Count; vertices.Add(a); vertices.Add(b); vertices.Add(c); triangles.Add(count); triangles.Add(count + 1); triangles.Add(count + 2); } private static Vector3[] Path(int count, Func point) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[count]; for (int i = 0; i < count; i++) { array[i] = point((float)i / (float)(count - 1)); } return array; } private static float[] Radii(int count, float from, float to) { float[] array = new float[count]; for (int i = 0; i < count; i++) { array[i] = Mathf.Lerp(from, to, (float)i / (float)(count - 1)); } return array; } private static int LongestAxis(Vector3 size) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) if (size.x >= size.y && size.x >= size.z) { return 0; } if (!(size.y >= size.z)) { return 2; } return 1; } private static Vector3 Axis(int axis) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(axis switch { 1 => Vector3.up, 0 => Vector3.right, _ => Vector3.forward, }); } private static float Component(Vector3 value, int axis) { //IL_0015: 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_0007: Unknown result type (might be due to invalid IL or missing references) return axis switch { 1 => value.y, 0 => value.x, _ => value.z, }; } } public static class PassiveEffects { private const string PassiveSeName = "SE_Norns_MagePassive"; private const string WardSeName = "SE_Norns_RunicWard"; private const string RendingSeName = "SE_Norns_RendingBlow"; private const string BearskinSeName = "SE_Norns_Bearskin"; private const string RageSeName = "SE_Norns_RageUnbound"; private const string WarbandSeName = "SE_Norns_WarbandsOath"; private const string FireRainSeName = "SE_Norns_FallOfRagnarok"; private const string BlackHoleSeName = "SE_Norns_BlackHole"; private const string BloodHarvestSeName = "SE_Norns_BloodHarvest"; private const string DreadVeilSeName = "SE_Norns_DreadVeil"; private static SE_Stats _passiveTemplate; private static SE_Stats _wardTemplate; private static readonly Dictionary MarkerTemplates = new Dictionary(); private static SE_Stats PassiveTemplate() { if ((Object)(object)_passiveTemplate != (Object)null) { return _passiveTemplate; } SE_Stats obj = ScriptableObject.CreateInstance(); ((Object)obj).name = "SE_Norns_MagePassive"; ((StatusEffect)obj).m_nameHash = StringExtensionMethods.GetStableHashCode("SE_Norns_MagePassive"); ((StatusEffect)obj).m_name = "Seidr Blood"; ((StatusEffect)obj).m_ttl = 0f; obj.m_eitrRegenMultiplier = 1.25f; _passiveTemplate = obj; return obj; } private static SE_Stats WardTemplate() { if ((Object)(object)_wardTemplate != (Object)null) { return _wardTemplate; } SE_Stats obj = ScriptableObject.CreateInstance(); ((Object)obj).name = "SE_Norns_RunicWard"; ((StatusEffect)obj).m_nameHash = StringExtensionMethods.GetStableHashCode("SE_Norns_RunicWard"); ((StatusEffect)obj).m_name = "Runic Ward"; ((StatusEffect)obj).m_ttl = 20f; ((StatusEffect)obj).m_icon = SpellIcons.StatusFor(MageClass.Spells[3]); ((StatusEffect)obj).m_tooltip = $"+{50f:0} armor and Eitr regeneration for " + $"{20f:0} seconds."; obj.m_addArmor = 50f; obj.m_eitrRegenMultiplier = 3f; _wardTemplate = obj; return obj; } public static void EnsureApplied(Player player) { if (!((Object)(object)player == (Object)null) && ((Character)player).m_seman != null && ClassSystem.GetClass(player) == PlayerClass.Mage) { int stableHashCode = StringExtensionMethods.GetStableHashCode("SE_Norns_MagePassive"); if (!((Character)player).m_seman.HaveStatusEffect(stableHashCode)) { ((Character)player).m_seman.AddStatusEffect((StatusEffect)(object)PassiveTemplate(), false, 0, 0f); } } } public static void RefreshForClass(Player player) { if ((Object)(object)player == (Object)null) { return; } if (((Character)player).m_seman != null) { int stableHashCode = StringExtensionMethods.GetStableHashCode("SE_Norns_MagePassive"); int stableHashCode2 = StringExtensionMethods.GetStableHashCode("SE_Norns_RunicWard"); if (ClassSystem.GetClass(player) != PlayerClass.Mage) { ((Character)player).m_seman.RemoveStatusEffect(stableHashCode, false); ((Character)player).m_seman.RemoveStatusEffect(stableHashCode2, false); } else { EnsureApplied(player); } } float num = default(float); float num2 = default(float); float num3 = default(float); player.GetTotalFoodValue(ref num, ref num2, ref num3); player.SetMaxEitr(num3, false); } public static void ApplyWard(Player player) { if (!((Object)(object)player == (Object)null) && ((Character)player).m_seman != null) { ((Character)player).m_seman.AddStatusEffect((StatusEffect)(object)WardTemplate(), true, 0, 0f); } } public static void ApplyRending(Player player) { ApplyMarker(player, "SE_Norns_RendingBlow", BerserkerClass.Spells[0], 8f, "The next melee hit is empowered."); } public static void RemoveRending(Player player) { RemoveMarker(player, "SE_Norns_RendingBlow"); } public static void ApplyBearskin(Player player) { ApplyMarker(player, "SE_Norns_Bearskin", BerserkerClass.Spells[3], 12f, $"Incoming damage reduced by {40f:0}%."); } public static void ApplyRageUnbound(Player player) { ApplyMarker(player, "SE_Norns_RageUnbound", BerserkerClass.Spells[4], 12f, "Fury is full, Wrathbound is doubled and melee damage steals life."); } public static void ApplyWarband(Player player) { ApplyMarker(player, "SE_Norns_WarbandsOath", BerserkerSpecializations.SpellFor(BerserkerSpecialization.Warlord), 18f, $"Incoming damage reduced by {25f:0}%."); } public static void ApplyFireRain(Player player) { ApplyMarker(player, "SE_Norns_FallOfRagnarok", MageClass.Spells[4], 5.1299996f, "Fall of Ragnarok is striking the targeted area."); } public static void ApplyBlackHole(Player player) { ApplyMarker(player, "SE_Norns_BlackHole", MageSpecializations.SpellFor(MageSpecialization.Void), 6f, "Your singularity is active."); } public static void ApplyBloodHarvest(Player player) { ApplyMarker(player, "SE_Norns_BloodHarvest", MageSpecializations.SpellFor(MageSpecialization.Blood), 2.9f, "Blood Harvest is resolving its pulses."); } public static void ApplyDreadVeil(Player player) { ApplyMarker(player, "SE_Norns_DreadVeil", MageSpecializations.SpellFor(MageSpecialization.Dark), 12f, $"Norns spell damage +{25f:0}%; " + $"incoming damage -{25f:0}%."); } public static void ClearTemporary(Player player) { if (!((Object)(object)player == (Object)null) && ((Character)player).m_seman != null) { string[] array = new string[9] { "SE_Norns_RunicWard", "SE_Norns_RendingBlow", "SE_Norns_Bearskin", "SE_Norns_RageUnbound", "SE_Norns_WarbandsOath", "SE_Norns_FallOfRagnarok", "SE_Norns_BlackHole", "SE_Norns_BloodHarvest", "SE_Norns_DreadVeil" }; foreach (string internalName in array) { RemoveMarker(player, internalName); } DreadVeil.Clear(player); } } private static void ApplyMarker(Player player, string internalName, Spell spell, float duration, string tooltip) { if (!((Object)(object)player == (Object)null) && ((Character)player).m_seman != null && spell != null) { if (!MarkerTemplates.TryGetValue(internalName, out var value) || (Object)(object)value == (Object)null) { value = ScriptableObject.CreateInstance(); ((Object)value).name = internalName; value.m_nameHash = StringExtensionMethods.GetStableHashCode(internalName); value.m_name = spell.Name; value.m_tooltip = tooltip; value.m_ttl = duration; value.m_icon = SpellIcons.StatusFor(spell); MarkerTemplates[internalName] = value; } ((Character)player).m_seman.AddStatusEffect(value, true, 0, 0f); } } private static void RemoveMarker(Player player, string internalName) { if (!((Object)(object)player == (Object)null) && ((Character)player).m_seman != null) { ((Character)player).m_seman.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode(internalName), false); } } public static bool HasWard(Player player) { if ((Object)(object)player != (Object)null && ((Character)player).m_seman != null) { return ((Character)player).m_seman.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("SE_Norns_RunicWard")); } return false; } } [HarmonyPatch(typeof(Player), "SetMaxEitr")] public static class MageEitrPatch { private static void Prefix(Player __instance, ref float eitr) { if (!((Object)(object)__instance == (Object)null) && ClassSystem.GetClass(__instance) == PlayerClass.Mage) { eitr += MageClass.EitrReserve(ClassSystem.GetLevel(__instance)); } } } [HarmonyPatch(typeof(Player), "Load")] public static class MageEitrLoadPatch { private static void Postfix(Player __instance) { if (!((Object)(object)__instance == (Object)null) && ClassSystem.GetClass(__instance) == PlayerClass.Mage) { float num = default(float); float num2 = default(float); float num3 = default(float); __instance.GetTotalFoodValue(ref num, ref num2, ref num3); __instance.SetMaxEitr(num3, false); } } } [BepInPlugin("gianl.norns", "Norns", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "gianl.norns"; public const string PluginName = "Norns"; public const string PluginVersion = "1.0.0"; public static Plugin Instance; public static ManualLogSource Log; private Harmony _harmony; private float _slowTimer; private void Awake() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; NornsConfig.Bind(((BaseUnityPlugin)this).Config); MageStaves.Register(); BerserkerWeapons.Register(); ShrineOfNorns.Register(); _harmony = new Harmony("gianl.norns"); _harmony.PatchAll(); Log.LogInfo((object)"Norns 1.0.0 caricata."); } private void OnDestroy() { VfxAssets.Shutdown(); HudOverlay.Shutdown(); XpPopup.Shutdown(); MageStaves.Shutdown(); BerserkerWeapons.Shutdown(); ShrineOfNorns.Shutdown(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { Network.EnsureRegistered(); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { BerserkerClass.Update(null); BerserkerFury.Update(null); HudOverlay.UpdateInput(null); ClassSelectionGui.Close(); return; } ClassSelectionGui.UpdateGate(localPlayer); if (!ClassSelectionGui.IsOpen) { BerserkerClass.Update(localPlayer); BerserkerFury.Update(localPlayer); HudOverlay.UpdateInput(localPlayer); if (!HudOverlay.IsEditing) { ClassCodexGui.UpdateGate(localPlayer); UpdateCodexInput(localPlayer); } WardRepulsion.Update(localPlayer); if (!ClassCodexGui.IsOpen && !HudOverlay.IsEditing) { Casting.UpdateInput(localPlayer); } _slowTimer += Time.deltaTime; if (!(_slowTimer < 1f)) { _slowTimer = 0f; PassiveEffects.EnsureApplied(localPlayer); XpSystem.CheckMilestones(localPlayer); } } } private static void UpdateCodexInput(Player player) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((!((Object)(object)Chat.instance != (Object)null) || !Chat.instance.HasFocus()) && ClassSystem.HasClass(player)) { if (Input.GetKeyDown(NornsConfig.CodexKey.Value)) { ClassCodexGui.Toggle(); } else if (ClassCodexGui.IsOpen && Input.GetKeyDown((KeyCode)27)) { ClassCodexGui.Close(); } } } private void OnGUI() { if (!((Object)(object)Player.m_localPlayer == (Object)null)) { ClassSelectionGui.Draw(); ClassCodexGui.Draw(); HudOverlay.Draw(); XpPopup.Draw(); } } } public static class Progression { private static readonly string[] BossKeys = new string[7] { "defeated_eikthyr", "defeated_gdking", "defeated_bonemass", "defeated_dragon", "defeated_goblinking", "defeated_queen", "defeated_fader" }; private static readonly float[] TierMultiplier = new float[8] { 1f, 1.5f, 2.2f, 3.2f, 4.5f, 6f, 7.5f, 9f }; private static int _cachedTier = -1; private static float _cacheTime = -999f; public static int WorldTier() { if (Time.time - _cacheTime < 1f && _cachedTier >= 0) { return _cachedTier; } int num = 0; if ((Object)(object)ZoneSystem.instance != (Object)null) { string[] bossKeys = BossKeys; foreach (string text in bossKeys) { if (ZoneSystem.instance.GetGlobalKey(text)) { num++; } } } _cachedTier = Mathf.Clamp(num, 0, TierMultiplier.Length - 1); _cacheTime = Time.time; return _cachedTier; } public static float LevelRamp(int level) { float num = Mathf.Clamp01((float)level / 50f); return 0.55f + 0.45f * num; } public static float Dmg(float baseDamage, int level) { return baseDamage * TierMultiplier[WorldTier()] * LevelRamp(level) * NornsConfig.DamageMultiplier.Value; } } public sealed class RendingBlowVfxController : MonoBehaviour { private static readonly List Active = new List(); public Transform SkyfallGroup; public Transform WeaponAuraGroup; public Transform SustainGroup; public Transform DissipationGroup; public LineRenderer OuterBeam; public LineRenderer CrimsonBeam; public LineRenderer HotCore; public ParticleSystem ContactBurst; public ParticleSystem ConsumedBurst; public ParticleSystem ExpiredAsh; public Light WeaponLight; public float Lifetime = 8f; private Player _player; private VisEquipment _equipment; private Transform _rightHand; private GameObject _weapon; private Renderer[] _weaponRenderers; private float _startedAt; private bool _contactEmitted; private bool _ending; private float _endStartedAt; private Material _runtimeBeamMaterial; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _player = FindNearestPlayer(((Component)this).transform.position); BindPlayerVisuals(); _startedAt = Time.time; _contactEmitted = false; _ending = false; _endStartedAt = 0f; Active.Add(this); EnsureRuntimeBeamMaterial(); PlayUnder(SkyfallGroup); PlayUnder(WeaponAuraGroup); StopAndClear(DissipationGroup); SetBeamIntensity(0f); if ((Object)(object)WeaponLight != (Object)null) { WeaponLight.intensity = 0f; } } private void OnDisable() { Active.Remove(this); } private void OnDestroy() { if ((Object)(object)_runtimeBeamMaterial != (Object)null) { Object.Destroy((Object)(object)_runtimeBeamMaterial); } } private void LateUpdate() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_00b3: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if ((Object)(object)_player == (Object)null) { _player = FindNearestPlayer(((Component)this).transform.position); BindPlayerVisuals(); } ResolveWeaponFrame(out var center, out var rotation, out var length); ((Component)this).transform.position = (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.position : ((Component)this).transform.position); if ((Object)(object)SkyfallGroup != (Object)null) { SkyfallGroup.position = center; } if ((Object)(object)WeaponAuraGroup != (Object)null) { WeaponAuraGroup.position = center; WeaponAuraGroup.rotation = rotation; float num2 = Mathf.Clamp(length / 2.15f, 0.72f, 1.35f); WeaponAuraGroup.localScale = new Vector3(0.9f, num2, 0.9f); } UpdateBeam(num, center); float num3 = Smooth01((num - 0.08f) / 0.34f); float num4 = 1f - Smooth01((num - 0.92f) / 0.34f); if (!_contactEmitted && num >= 0.43f) { _contactEmitted = true; ParticleSystem contactBurst = ContactBurst; if (contactBurst != null) { contactBurst.Emit(24); } } if ((Object)(object)WeaponLight != (Object)null) { ((Component)WeaponLight).transform.position = center; float num5 = num3 * num4; float num6 = ((num < Lifetime) ? (0.1f + Mathf.Sin(num * 3.2f) * 0.025f) : 0f); WeaponLight.intensity = (_ending ? 0f : (num5 * 1.15f + num6)); } if (!_ending && num >= Lifetime) { BeginEnd(consumed: false); } if (_ending) { float num7 = Time.time - _endStartedAt; float num8 = 1f - Smooth01(num7 / 0.42f); if ((Object)(object)WeaponAuraGroup != (Object)null) { Transform weaponAuraGroup = WeaponAuraGroup; weaponAuraGroup.localScale *= Mathf.Max(0.001f, num8); } if (num7 >= 0.78f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public void Consume() { BeginEnd(consumed: true); } public static void ConsumeNearest(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) FindNearest(position)?.Consume(); } public static void SupersedeNearest(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) FindNearest(position)?.BeginEnd(consumed: false); } private static RendingBlowVfxController FindNearest(Vector3 position) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) RendingBlowVfxController result = null; float num = 2.25f; for (int num2 = Active.Count - 1; num2 >= 0; num2--) { RendingBlowVfxController rendingBlowVfxController = Active[num2]; if ((Object)(object)rendingBlowVfxController == (Object)null) { Active.RemoveAt(num2); } else { float num3 = Vector3.Distance(((Component)rendingBlowVfxController).transform.position, position); if (!(num3 >= num)) { num = num3; result = rendingBlowVfxController; } } } return result; } private void BeginEnd(bool consumed) { if (_ending) { return; } _ending = true; _endStartedAt = Time.time; StopEmitting(SkyfallGroup); StopEmitting(WeaponAuraGroup); StopEmitting(SustainGroup); SetBeamIntensity(0f); if (consumed) { ParticleSystem consumedBurst = ConsumedBurst; if (consumedBurst != null) { consumedBurst.Emit(22); } } else { ParticleSystem expiredAsh = ExpiredAsh; if (expiredAsh != null) { expiredAsh.Emit(15); } } } private void UpdateBeam(float elapsed, Vector3 target) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_0104: Unknown result type (might be due to invalid IL or missing references) float num = Smooth01((elapsed - 0.04f) / 0.28f); float num2 = 1f - Smooth01((elapsed - 0.88f) / 0.42f); float num3 = 0.9f + Mathf.Sin(elapsed * 15.7f) * 0.055f + Mathf.Sin(elapsed * 27.3f + 0.8f) * 0.025f; float beamIntensity = (_ending ? 0f : (num * num2 * num3)); Vector3 val = target + Vector3.up * 9.6f; Vector3 to = Vector3.Lerp(val, target, num); SetBeamPath(OuterBeam, val, to, elapsed, 0.155f, 0.2f); SetBeamPath(CrimsonBeam, val, to, elapsed, 0.092f, 2.35f); SetBeamPath(HotCore, val, to, elapsed, 0.034f, 4.6f); if ((Object)(object)_runtimeBeamMaterial != (Object)null) { _runtimeBeamMaterial.mainTextureOffset = new Vector2((0f - elapsed) * 1.35f, 0f); } SetBeamIntensity(beamIntensity); } private static void SetBeamPath(LineRenderer line, Vector3 from, Vector3 to, float elapsed, float sway, float phase) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)line == (Object)null)) { int num = Mathf.Max(2, line.positionCount); for (int i = 0; i < num; i++) { float num2 = (float)i / (float)(num - 1); float num3 = Mathf.Sin(num2 * (float)Math.PI); float num4 = elapsed * 3.9f + (float)i * 1.37f + phase; float num5 = Mathf.Sin(elapsed * 2.1f + num2 * 8.3f + phase) * 0.35f; Vector3 val = new Vector3(Mathf.Sin(num4) + num5, 0f, Mathf.Cos(num4 * 0.79f + phase * 0.4f)) * sway * num3; line.SetPosition(i, Vector3.Lerp(from, to, num2) + val); } } } private void SetBeamIntensity(float intensity) { //IL_001a: 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_0070: Unknown result type (might be due to invalid IL or missing references) SetLine(OuterBeam, 0.4f, new Color(0.42f, 0.004f, 0.01f), intensity * 0.2f); SetLine(CrimsonBeam, 0.18f, new Color(0.88f, 0.018f, 0.012f), intensity * 0.56f); SetLine(HotCore, 0.04f, new Color(1f, 0.46f, 0.12f), intensity * 0.82f); } private static void SetLine(LineRenderer line, float width, Color color, float alpha) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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 (!((Object)(object)line == (Object)null)) { ((Renderer)line).enabled = alpha > 0.001f; line.widthMultiplier = width; color.a = Mathf.Clamp01(alpha); line.startColor = new Color(color.r * 0.68f, color.g * 0.62f, color.b * 0.72f, color.a * 0.42f); line.endColor = color; } } private void EnsureRuntimeBeamMaterial() { //IL_005b: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Shader val = Shader.Find("Sprites/Default"); if ((Object)(object)val == (Object)null) { Plugin.Log.LogWarning((object)"Rending Blow: shader runtime Sprites/Default non disponibile; mantengo il materiale authorato del fascio."); return; } Texture val2 = (((Object)(object)OuterBeam != (Object)null && (Object)(object)((Renderer)OuterBeam).sharedMaterial != (Object)null) ? ((Renderer)OuterBeam).sharedMaterial.mainTexture : null); _runtimeBeamMaterial = new Material(val) { name = "norns_rending_runtime_beam", color = Color.white, hideFlags = (HideFlags)61, renderQueue = 3000 }; if ((Object)(object)val2 != (Object)null) { _runtimeBeamMaterial.mainTexture = val2; _runtimeBeamMaterial.mainTextureScale = Vector2.one; } if (_runtimeBeamMaterial.HasProperty("_SrcBlend")) { _runtimeBeamMaterial.SetInt("_SrcBlend", 5); } if (_runtimeBeamMaterial.HasProperty("_DstBlend")) { _runtimeBeamMaterial.SetInt("_DstBlend", 1); } if (_runtimeBeamMaterial.HasProperty("_ZWrite")) { _runtimeBeamMaterial.SetInt("_ZWrite", 0); } ApplyRuntimeBeamMaterial(OuterBeam); ApplyRuntimeBeamMaterial(CrimsonBeam); ApplyRuntimeBeamMaterial(HotCore); } private void ApplyRuntimeBeamMaterial(LineRenderer line) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)line == (Object)null) && !((Object)(object)_runtimeBeamMaterial == (Object)null)) { ((Renderer)line).sharedMaterial = _runtimeBeamMaterial; line.useWorldSpace = true; line.textureMode = (LineTextureMode)1; line.textureScale = new Vector2(3.2f, 1f); line.numCapVertices = 0; line.widthCurve = BeamWidthCurve(line); ((Renderer)line).enabled = true; } } private AnimationCurve BeamWidthCurve(LineRenderer line) { //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_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_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_005d: 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_006d: Expected O, but got Unknown //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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown if (line != OuterBeam) { if (line != CrimsonBeam) { return new AnimationCurve((Keyframe[])(object)new Keyframe[4] { new Keyframe(0f, 0.36f), new Keyframe(0.48f, 1f), new Keyframe(0.88f, 0.3f), new Keyframe(1f, 0.04f) }); } return new AnimationCurve((Keyframe[])(object)new Keyframe[4] { new Keyframe(0f, 0.52f), new Keyframe(0.38f, 1f), new Keyframe(0.82f, 0.46f), new Keyframe(1f, 0.1f) }); } return new AnimationCurve((Keyframe[])(object)new Keyframe[4] { new Keyframe(0f, 0.62f), new Keyframe(0.32f, 1f), new Keyframe(0.78f, 0.58f), new Keyframe(1f, 0.16f) }); } private void BindPlayerVisuals() { _equipment = (((Object)(object)_player != (Object)null) ? ((Component)_player).GetComponentInChildren() : null); Animator val = (((Object)(object)_player != (Object)null) ? ((Component)_player).GetComponentInChildren() : null); _rightHand = (((Object)(object)val != (Object)null && val.isHuman) ? val.GetBoneTransform((HumanBodyBones)18) : null); RefreshWeapon(); } private void RefreshWeapon() { GameObject val = null; if ((Object)(object)_equipment != (Object)null) { val = (((Object)(object)_equipment.m_rightItemInstance != (Object)null) ? _equipment.m_rightItemInstance : _equipment.m_leftItemInstance); } if (val != _weapon) { _weapon = val; _weaponRenderers = (Renderer[])(((Object)(object)_weapon != (Object)null) ? ((Array)_weapon.GetComponentsInChildren(true)) : ((Array)new Renderer[0])); } } private void ResolveWeaponFrame(out Vector3 center, out Quaternion rotation, out float length) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c3: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_01ab: 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_0060: 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) RefreshWeapon(); bool flag = false; Bounds val = default(Bounds); if (_weaponRenderers != null) { Renderer[] weaponRenderers = _weaponRenderers; foreach (Renderer val2 in weaponRenderers) { if (!((Object)(object)val2 == (Object)null) && val2.enabled && (val2 is MeshRenderer || val2 is SkinnedMeshRenderer)) { if (!flag) { val = val2.bounds; flag = true; } else { ((Bounds)(ref val)).Encapsulate(val2.bounds); } } } } if (flag) { center = ((Bounds)(ref val)).center + Vector3.up * Mathf.Min(0.18f, ((Bounds)(ref val)).extents.y * 0.25f); Vector3 size = ((Bounds)(ref val)).size; length = Mathf.Max(size.x, Mathf.Max(size.y, size.z)); rotation = (((Object)(object)_weapon != (Object)null) ? _weapon.transform.rotation : Quaternion.identity); } else { center = (((Object)(object)_rightHand != (Object)null) ? _rightHand.position : (((Object)(object)_player != (Object)null) ? (((Component)_player).transform.position + Vector3.up * 1.45f) : (((Component)this).transform.position + Vector3.up * 1.45f))); rotation = (((Object)(object)_rightHand != (Object)null) ? _rightHand.rotation : (((Object)(object)_player != (Object)null) ? ((Component)_player).transform.rotation : Quaternion.identity)); length = 1.8f; } } private static Player FindNearestPlayer(Vector3 position) { //IL_0026: 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) Player result = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } private static void PlayUnder(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } private static void StopAndClear(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } private static void StopEmitting(Transform group) { if ((Object)(object)group == (Object)null) { return; } ParticleSystem[] componentsInChildren = ((Component)group).GetComponentsInChildren(true); foreach (ParticleSystem val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)1); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class RendingBlowGestureController : MonoBehaviour { private const float GestureDuration = 1.22f; private Player _player; private Animator _animator; private Transform _spine; private Transform _leftUpperArm; private Transform _leftLowerArm; private Transform _leftHand; private Transform _rightUpperArm; private Transform _rightLowerArm; private Transform _rightHand; private float _startedAt; public static void PlayNearest(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) Player val = FindNearestPlayer(position); if (!((Object)(object)val == (Object)null)) { RendingBlowGestureController rendingBlowGestureController = ((Component)val).GetComponent(); if ((Object)(object)rendingBlowGestureController == (Object)null) { rendingBlowGestureController = ((Component)val).gameObject.AddComponent(); } rendingBlowGestureController.Restart(val); } } private void Restart(Player player) { _player = player; _startedAt = Time.time; BindRig(); ((Behaviour)this).enabled = true; } private void BindRig() { _animator = (((Object)(object)_player != (Object)null) ? ((Component)_player).GetComponentInChildren() : null); if (!((Object)(object)_animator == (Object)null) && _animator.isHuman) { _spine = _animator.GetBoneTransform((HumanBodyBones)54) ?? _animator.GetBoneTransform((HumanBodyBones)8); _leftUpperArm = _animator.GetBoneTransform((HumanBodyBones)13); _leftLowerArm = _animator.GetBoneTransform((HumanBodyBones)15); _leftHand = _animator.GetBoneTransform((HumanBodyBones)17); _rightUpperArm = _animator.GetBoneTransform((HumanBodyBones)14); _rightLowerArm = _animator.GetBoneTransform((HumanBodyBones)16); _rightHand = _animator.GetBoneTransform((HumanBodyBones)18); } } private void LateUpdate() { //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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_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_014f: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_player == (Object)null || ((Character)_player).IsDead()) { Object.Destroy((Object)(object)this); return; } float num = Time.time - _startedAt; if (num >= 1.22f) { Object.Destroy((Object)(object)this); return; } if ((Object)(object)_animator == (Object)null || !_animator.isHuman) { BindRig(); } if ((Object)(object)_rightUpperArm == (Object)null || (Object)(object)_rightHand == (Object)null) { return; } float num2 = Smooth01(num / 0.24f); float num3 = 1f - Smooth01((num - 0.82f) / 0.36f); float num4 = num2 * num3; if (!(num4 <= 0.001f)) { Vector3 up = ((Component)_player).transform.up; Vector3 val = Vector3.ProjectOnPlane(((Component)_player).transform.forward, up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = Vector3.forward; } val = Vector3.Cross(up, val2); Vector3 normalized = ((Vector3)(ref val)).normalized; if ((Object)(object)_spine != (Object)null) { _spine.rotation = Quaternion.AngleAxis(-7f * num4, normalized) * _spine.rotation; } Vector3 target = _rightUpperArm.position + up * 0.92f + val2 * 0.22f + normalized * 0.1f; AimLimb(_rightUpperArm, _rightHand, target, num4); AimLimb(_rightLowerArm, _rightHand, target, num4 * 0.72f); if ((Object)(object)_leftUpperArm != (Object)null && (Object)(object)_leftHand != (Object)null) { Vector3 target2 = _leftUpperArm.position + up * 0.84f + val2 * 0.24f - normalized * 0.13f; AimLimb(_leftUpperArm, _leftHand, target2, num4 * 0.94f); AimLimb(_leftLowerArm, _leftHand, target2, num4 * 0.68f); } } } private static void AimLimb(Transform joint, Transform hand, Vector3 target, float weight) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)joint == (Object)null) && !((Object)(object)hand == (Object)null)) { Vector3 val = hand.position - joint.position; Vector3 val2 = target - joint.position; if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f) && !(((Vector3)(ref val2)).sqrMagnitude < 0.0001f)) { Quaternion val3 = Quaternion.FromToRotation(val, val2); joint.rotation = Quaternion.Slerp(joint.rotation, val3 * joint.rotation, Mathf.Clamp01(weight)); } } } private static Player FindNearestPlayer(Vector3 position) { //IL_0026: 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) Player result = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public sealed class RunicWardVfxController : MonoBehaviour { private static readonly List Active = new List(); public Transform BarrierGroup; public Transform SurfaceGroup; public Transform ActivationGroup; public Transform SustainGroup; public Transform CollapseGroup; public Renderer ShieldSurface; public ParticleSystem ContactSparks; public Light WardLight; public float Radius = 3.8f; public float Lifetime = 20f; private ParticleSystem[] _activationParticles; private ParticleSystem[] _sustainParticles; private ParticleSystem[] _collapseParticles; private MaterialPropertyBlock _surfaceProperties; private Transform _anchor; private float _startedAt; private float _lastPulseAt = -10f; private Vector3 _impactDirection = Vector3.forward; private bool _collapsing; private static readonly int FormationId = Shader.PropertyToID("_Formation"); private static readonly int HitId = Shader.PropertyToID("_Hit"); private static readonly int PhaseId = Shader.PropertyToID("_Phase"); private static readonly int ImpactDirectionId = Shader.PropertyToID("_ImpactDirection"); private static readonly int ImpactTravelId = Shader.PropertyToID("_ImpactTravel"); private void OnEnable() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) _activationParticles = ParticlesUnder(ActivationGroup); _sustainParticles = ParticlesUnder(SustainGroup); _collapseParticles = ParticlesUnder(CollapseGroup); _surfaceProperties = new MaterialPropertyBlock(); StopAndClear(_activationParticles); StopAndClear(_sustainParticles); StopAndClear(_collapseParticles); _anchor = FindNearestPlayer(((Component)this).transform.position); _startedAt = Time.time; _lastPulseAt = -10f; _impactDirection = Vector3.forward; _collapsing = false; Active.Add(this); Play(_activationParticles); Play(_sustainParticles); SetSurface(0f, 0f, 0f, 0f); if ((Object)(object)WardLight != (Object)null) { WardLight.intensity = 0f; } } private void OnDisable() { Active.Remove(this); } private void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; float num2 = Lifetime - num; ((Component)this).transform.position = (((Object)(object)_anchor != (Object)null) ? _anchor.position : ((Component)this).transform.position) + Vector3.up * 0.98f; float num3 = Smooth01(num / 0.38f); float num4 = ((num < 0.62f) ? (1f + Mathf.Sin(Mathf.Clamp01(num / 0.62f) * (float)Math.PI) * 0.045f) : 1f); float num5 = Smooth01(Mathf.Clamp01(num2 / 0.78f)); float num6 = 0.996f + Mathf.Sin(num * 1.15f) * 0.004f; if ((Object)(object)BarrierGroup != (Object)null) { BarrierGroup.localScale = Vector3.one * num3 * num4 * num6; } if ((Object)(object)SurfaceGroup != (Object)null) { SurfaceGroup.localRotation = Quaternion.Euler(0f, num * 1.8f + Mathf.Sin(num * 0.32f) * 1.2f, 0f); } float num7 = Time.time - _lastPulseAt; float num8 = ((num7 < 0.34f) ? (Mathf.Exp((0f - num7) * 8.5f) * Mathf.Sin(Mathf.Clamp01(num7 / 0.12f) * (float)Math.PI * 0.5f)) : 0f); float impactTravel = ((num7 < 0.4f) ? Smooth01(Mathf.Clamp01(num7 / 0.4f)) : 0f); SetSurface(num3 * num5, num8, num, impactTravel); if ((Object)(object)WardLight != (Object)null) { WardLight.color = Color.Lerp(new Color(0.24f, 0.58f, 0.86f), new Color(0.53f, 0.32f, 0.88f), 0.48f + Mathf.Sin(num * 0.4f) * 0.18f); WardLight.intensity = num3 * num5 * (0.1f + num8 * 0.42f); } if (!_collapsing && num2 <= 0.66f) { _collapsing = true; StopEmitting(_sustainParticles); Play(_collapseParticles); } if (num >= Lifetime + 0.9f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void SetSurface(float formation, float hit, float phase, float impactTravel) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ShieldSurface == (Object)null)) { ShieldSurface.GetPropertyBlock(_surfaceProperties); _surfaceProperties.SetFloat(FormationId, formation); _surfaceProperties.SetFloat(HitId, hit); _surfaceProperties.SetFloat(PhaseId, phase); _surfaceProperties.SetVector(ImpactDirectionId, Vector4.op_Implicit(_impactDirection)); _surfaceProperties.SetFloat(ImpactTravelId, impactTravel); ShieldSurface.SetPropertyBlock(_surfaceProperties); } } public void Pulse(Vector3 center, Vector3 contactPoint) { //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_000c: 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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!(Vector3.Distance(((Component)this).transform.position, center + Vector3.up * 0.98f) > Radius + 1.5f) && !(Time.time - _lastPulseAt < 0.55f)) { _lastPulseAt = Time.time; Vector3 val = contactPoint - (center + Vector3.up * 0.98f); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { _impactDirection = ((Vector3)(ref val)).normalized; } if ((Object)(object)ContactSparks != (Object)null) { ContactSparks.Emit(16); } } } public static void NotifyPulse(Vector3 center, Vector3 contactPoint) { //IL_0032: 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) for (int num = Active.Count - 1; num >= 0; num--) { RunicWardVfxController runicWardVfxController = Active[num]; if ((Object)(object)runicWardVfxController == (Object)null) { Active.RemoveAt(num); } else { runicWardVfxController.Pulse(center, contactPoint); } } } private static Transform FindNearestPlayer(Vector3 position) { //IL_0026: 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) Transform result = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(position, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; result = ((Component)allPlayer).transform; } } } return result; } private static ParticleSystem[] ParticlesUnder(Transform group) { if (!((Object)(object)group == (Object)null)) { return ((Component)group).GetComponentsInChildren(true); } return (ParticleSystem[])(object)new ParticleSystem[0]; } private static void Play(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Play(true); } } } private static void StopAndClear(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)0); } } } private static void StopEmitting(ParticleSystem[] systems) { if (systems == null) { return; } foreach (ParticleSystem val in systems) { if ((Object)(object)val != (Object)null) { val.Stop(true, (ParticleSystemStopBehavior)1); } } } private static float Smooth01(float value) { value = Mathf.Clamp01(value); return value * value * (3f - 2f * value); } } public static class ShrineOfNorns { public const string PrefabName = "piece_norns_shrine"; public const string DisplayName = "Shrine of the Norns"; private const string BasePrefab = "stone_floor_2x2"; private const string IconFile = "shrine_of_norns.png"; private static bool _hooked; private static bool _created; private static bool _registrationReady; public static void Register() { if (!_hooked) { _hooked = true; PrefabManager.OnVanillaPrefabsAvailable += Create; } } public static void Shutdown() { if (_hooked) { PrefabManager.OnVanillaPrefabsAvailable -= Create; } PieceManager.OnPiecesRegistered -= MarkRegistrationReady; _hooked = false; _registrationReady = false; } private static void Create() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= Create; _hooked = false; if (_created) { return; } try { PieceConfig val = new PieceConfig(); val.Name = "Shrine of the Norns"; val.Description = "A monumental loom where the Norns reveal and reweave the thread of your class."; val.PieceTable = PieceTables.Hammer; val.Category = PieceCategories.Misc; val.CraftingStation = CraftingStations.Workbench; val.Icon = LoadIcon(); val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig("Stone", 60, 0, true), new RequirementConfig("Wood", 30, 0, true) }; PieceConfig val2 = val; CustomPiece val3 = new CustomPiece("piece_norns_shrine", "stone_floor_2x2", val2); GameObject piecePrefab = val3.PiecePrefab; if ((Object)(object)piecePrefab == (Object)null) { Plugin.Log.LogError((object)"Impossibile creare lo Shrine of the Norns."); return; } Piece component = piecePrefab.GetComponent(); if ((Object)(object)component != (Object)null) { component.m_groundOnly = true; component.m_clipEverything = true; } BoxCollider obj = piecePrefab.AddComponent(); obj.center = new Vector3(0f, 0.2f, 0.08f); obj.size = new Vector3(5.2f, 0.4f, 4.1f); BoxCollider obj2 = piecePrefab.AddComponent(); obj2.center = new Vector3(0f, 2.7f, 0.28f); obj2.size = new Vector3(5.35f, 5.4f, 1.55f); PieceManager.OnPiecesRegistered += MarkRegistrationReady; if (!PieceManager.Instance.AddPiece(val3)) { PieceManager.OnPiecesRegistered -= MarkRegistrationReady; Plugin.Log.LogError((object)"Jotunn ha rifiutato lo Shrine of the Norns."); } else { _created = true; Plugin.Log.LogInfo((object)"Shrine of the Norns accodato per la registrazione."); } } catch (Exception arg) { Plugin.Log.LogError((object)$"Registrazione dello Shrine of the Norns fallita: {arg}"); } } private static void MarkRegistrationReady() { PieceManager.OnPiecesRegistered -= MarkRegistrationReady; _registrationReady = IsPresentInHammerTable(); if (_registrationReady) { Plugin.Log.LogInfo((object)"Shrine of the Norns verificato nella tabella del martello."); } else { Plugin.Log.LogError((object)"Shrine of the Norns assente dalla tabella del martello dopo la registrazione."); } } private static bool IsPresentInHammerTable() { PieceTable pieceTable = PieceManager.Instance.GetPieceTable(PieceTables.Hammer); if ((Object)(object)pieceTable == (Object)null || pieceTable.m_pieces == null) { return false; } foreach (GameObject piece in pieceTable.m_pieces) { if ((Object)(object)piece != (Object)null && ((Object)piece).name.StartsWith("piece_norns_shrine", StringComparison.Ordinal)) { return true; } } return false; } internal static bool IsRuntimeInstance(GameObject gameObject) { if (_registrationReady && (Object)(object)gameObject != (Object)null) { return ((Object)gameObject).name.StartsWith("piece_norns_shrine", StringComparison.Ordinal); } return false; } internal static void DecorateInstance(GameObject gameObject) { if (IsRuntimeInstance(gameObject)) { if ((Object)(object)gameObject.GetComponent() == (Object)null && (Object)(object)gameObject.GetComponent() == (Object)null && (Object)(object)gameObject.GetComponent() == (Object)null) { HideInheritedVisuals(gameObject); } if ((Object)(object)gameObject.GetComponent() == (Object)null) { gameObject.AddComponent(); } if ((Object)(object)gameObject.GetComponent() == (Object)null) { gameObject.AddComponent(); } if ((Object)(object)gameObject.GetComponent() == (Object)null) { gameObject.AddComponent(); } } } private static void HideInheritedVisuals(GameObject gameObject) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (((Component)val).transform.IsChildOf(gameObject.transform)) { val.enabled = false; } } } private static Sprite LoadIcon() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return null; } string text = Path.Combine(directoryName, "art", "pieces", "shrine_of_norns.png"); if (!File.Exists(text)) { Plugin.Log.LogWarning((object)("Icona dello Shrine non trovata: " + text)); return null; } return AssetUtils.LoadSpriteFromFile(text); } internal static void BuildModel(GameObject prefab) { //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_0016: 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_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_0060: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: 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) GameObject val = new GameObject("norns_shrine_model") { layer = prefab.layer }; val.transform.SetParent(prefab.transform, false); AddFittedVisual(val.transform, "stone_floor_2x2", "stone_plinth", new Vector3(0f, 0.04f, 0.08f), Quaternion.identity, new Vector3(5.2f, 0.32f, 4.1f), alignBottom: true); AddFittedVisual(val.transform, "stone_floor_2x2", "upper_stone_plinth", new Vector3(0f, 0.34f, 0.16f), Quaternion.identity, new Vector3(4.45f, 0.28f, 3.25f), alignBottom: true); AddStoneRing(val.transform, 20, 2.46f, 1.92f, 0.3f, new Vector3(0.62f, 0.38f, 0.54f), "foundation_stone"); AddFittedVisual(val.transform, "BossStone_TheElder", "carved_fate_stone", new Vector3(0f, 0.62f, 0.34f), Quaternion.Euler(0f, 180f, 0f), new Vector3(1.35f, 3.45f, 0.72f), alignBottom: true); AddFittedVisual(val.transform, "piece_brazierfloor01", "fate_basin", new Vector3(0f, 0.62f, -1.28f), Quaternion.identity, new Vector3(1.15f, 0.48f, 1.05f), alignBottom: true); AddLoomPost(val.transform, -1f); AddLoomPost(val.transform, 1f); AddFittedVisual(val.transform, "piece_groundtorch_wood", "left_shrine_torch", new Vector3(-1.62f, 0.64f, -0.18f), Quaternion.identity, new Vector3(0.28f, 1.35f, 0.28f), alignBottom: true); AddFittedVisual(val.transform, "piece_groundtorch_wood", "right_shrine_torch", new Vector3(1.62f, 0.64f, -0.18f), Quaternion.identity, new Vector3(0.28f, 1.35f, 0.28f), alignBottom: true); AddFittedVisual(val.transform, "darkwood_arch", "carved_loom_crown", new Vector3(0f, 5.12f, 0.12f), Quaternion.identity, new Vector3(4.6f, 1.08f, 0.44f), alignBottom: false); } private static void AddStoneRing(Transform root, int count, float xRadius, float zRadius, float height, Vector3 stoneSize, string prefix) { //IL_0094: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < count; i++) { float num = (float)i * (float)Math.PI * 2f / (float)count; float num2 = Mathf.Sin((float)i * 2.17f) * 0.035f; float num3 = 0.9f + Mathf.Abs(Mathf.Sin((float)i * 1.73f)) * 0.16f; AddFittedVisual(root, "Stone", $"{prefix}_{i}", new Vector3(Mathf.Cos(num) * (xRadius + num2), height + Mathf.Sin((float)i * 1.31f) * 0.015f, Mathf.Sin(num) * (zRadius + num2) + 0.08f), Quaternion.Euler((float)i * 17f, (float)i * 61f, (float)i * 29f), stoneSize * num3, alignBottom: true); } } private static void AddLoomPost(Transform root, float side) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) AddFittedVisual(root, "darkwood_pole4", (side < 0f) ? "left_carved_post" : "right_carved_post", new Vector3(side * 2.05f, 0.58f, 0.12f), Quaternion.Euler(0f, 0f, side * 3.5f), new Vector3(0.46f, 4.72f, 0.46f), alignBottom: true); AddFittedVisual(root, "Stone", (side < 0f) ? "left_post_buttress" : "right_post_buttress", new Vector3(side * 2.05f, 0.5f, 0.18f), Quaternion.Euler(0f, side * 18f, side * 4f), new Vector3(0.9f, 0.82f, 1.05f), alignBottom: true); } private static GameObject AddFittedVisual(Transform parent, string prefabName, string name, Vector3 position, Quaternion rotation, Vector3 targetSize, bool alignBottom) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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) GameObject prefab = PrefabManager.Instance.GetPrefab(prefabName); if ((Object)(object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("Mesh sorgente dello Shrine non trovata: " + prefabName)); return null; } GameObject val = new GameObject(name); val.layer = ((Component)parent).gameObject.layer; val.transform.SetParent(parent, false); GameObject val2 = new GameObject("visual"); val2.layer = val.layer; val2.transform.SetParent(val.transform, false); CopyVisualTree(prefab.transform, val2.transform, isRoot: true, val.layer); if (TryGetLocalBounds(val2.transform, out var result)) { Vector3 size = ((Bounds)(ref result)).size; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(targetSize.x / Mathf.Max(size.x, 0.001f), targetSize.y / Mathf.Max(size.y, 0.001f), targetSize.z / Mathf.Max(size.z, 0.001f)); val2.transform.localScale = val3; val2.transform.localPosition = new Vector3((0f - ((Bounds)(ref result)).center.x) * val3.x, (0f - (alignBottom ? ((Bounds)(ref result)).min.y : ((Bounds)(ref result)).center.y)) * val3.y, (0f - ((Bounds)(ref result)).center.z) * val3.z); } val.transform.localPosition = position; val.transform.localRotation = rotation; return val; } private static bool TryGetLocalBounds(Transform root, out Bounds result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0084: 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_0098: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) result = default(Bounds); bool flag = false; MeshFilter[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); Vector3 val2 = default(Vector3); foreach (MeshFilter val in componentsInChildren) { if ((Object)(object)val.sharedMesh == (Object)null) { continue; } Bounds bounds = val.sharedMesh.bounds; Vector3 min = ((Bounds)(ref bounds)).min; Vector3 max = ((Bounds)(ref bounds)).max; for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { for (int l = 0; l < 2; l++) { ((Vector3)(ref val2))..ctor((j == 0) ? min.x : max.x, (k == 0) ? min.y : max.y, (l == 0) ? min.z : max.z); Vector3 val3 = root.InverseTransformPoint(((Component)val).transform.TransformPoint(val2)); if (!flag) { result = new Bounds(val3, Vector3.zero); flag = true; } else { ((Bounds)(ref result)).Encapsulate(val3); } } } } } return flag; } private static void CopyVisualTree(Transform source, Transform destination, bool isRoot, int layer) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_004d: 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_005e: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (isRoot || ((Component)source).gameObject.activeSelf) { Transform val = destination; if (!isRoot) { GameObject val2 = new GameObject(((Object)source).name) { layer = layer }; val2.transform.SetParent(destination, false); val2.transform.localPosition = source.localPosition; val2.transform.localRotation = source.localRotation; val2.transform.localScale = source.localScale; val = val2.transform; } MeshFilter component = ((Component)source).GetComponent(); MeshRenderer component2 = ((Component)source).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.sharedMesh != (Object)null && (Object)(object)component2 != (Object)null && ((Renderer)component2).enabled) { ((Component)val).gameObject.AddComponent().sharedMesh = component.sharedMesh; MeshRenderer obj = ((Component)val).gameObject.AddComponent(); ((Renderer)obj).sharedMaterials = ((Renderer)component2).sharedMaterials; ((Renderer)obj).shadowCastingMode = ((Renderer)component2).shadowCastingMode; ((Renderer)obj).receiveShadows = ((Renderer)component2).receiveShadows; ((Renderer)obj).lightProbeUsage = ((Renderer)component2).lightProbeUsage; ((Renderer)obj).reflectionProbeUsage = ((Renderer)component2).reflectionProbeUsage; } for (int i = 0; i < source.childCount; i++) { CopyVisualTree(source.GetChild(i), val, isRoot: false, layer); } } } } [HarmonyPatch(typeof(Piece), "Awake")] internal static class NornsShrinePieceAwakePatch { [HarmonyPostfix] private static void Postfix(Piece __instance) { if ((Object)(object)__instance != (Object)null) { ShrineOfNorns.DecorateInstance(((Component)__instance).gameObject); } } } public sealed class NornsShrineModel : MonoBehaviour { private bool _built; private void Start() { if (_built || (Object)(object)((Component)this).transform.Find("norns_shrine_model") != (Object)null) { return; } _built = true; try { ShrineOfNorns.BuildModel(((Component)this).gameObject); } catch (Exception arg) { Plugin.Log.LogError((object)$"Costruzione visuale dello Shrine fallita: {arg}"); } } } public sealed class NornsShrineInteractable : MonoBehaviour, Interactable, Hoverable { public string GetHoverName() { return "Shrine of the Norns"; } public string GetHoverText() { string text = "Shrine of the Norns\n[$KEY_Use] Read or reweave your thread"; if (Localization.instance == null) { return text; } return Localization.instance.Localize(text); } public bool Interact(Humanoid user, bool hold, bool alt) { if (hold) { return false; } Player val = (Player)(object)((user is Player) ? user : null); if ((Object)(object)val == (Object)null || (Object)(object)val != (Object)(object)Player.m_localPlayer) { return false; } NornsShrineVisual component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { component.TriggerRitual(); } ClassCodexGui.OpenFromShrine(); return true; } public bool UseItem(Humanoid user, ItemData item) { return false; } } public sealed class NornsShrineVisual : MonoBehaviour { private static readonly Color[] ThreadColors = (Color[])(object)new Color[3] { new Color(0.34f, 0.92f, 1f), new Color(1f, 0.72f, 0.28f), new Color(0.72f, 0.42f, 1f) }; private static readonly Color[] FlameColors = (Color[])(object)new Color[3] { new Color(1f, 0.28f, 0.06f, 0.86f), new Color(1f, 0.62f, 0.1f, 0.92f), new Color(1f, 0.91f, 0.42f, 0.96f) }; private readonly LineRenderer[] _threads = (LineRenderer[])(object)new LineRenderer[3]; private readonly LineRenderer[,] _torchFlames = new LineRenderer[2, 3]; private readonly Light[] _torchLights = (Light[])(object)new Light[2]; private Material _glow; private float _ritualUntil; private void Awake() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) _glow = BuildGlowMaterial(); for (int i = 0; i < _threads.Length; i++) { _threads[i] = NewLine($"fate_thread_{i}", 81, 0.06f, ThreadColors[i]); } CreateTorchLights(); } private void Update() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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) float time = Time.time; float num = Mathf.Clamp01((_ritualUntil - time) / 1.6f); Vector3 localPosition = default(Vector3); for (int i = 0; i < _threads.Length; i++) { LineRenderer val = _threads[i]; float num2 = (float)i * (float)Math.PI * 2f / (float)_threads.Length; for (int j = 0; j < val.positionCount; j++) { float num3 = (float)j / (float)(val.positionCount - 1); float num4 = num3 * (float)Math.PI * 4.5f + num2 + time * 0.2f; float num5 = 1f - Mathf.Pow(Mathf.Abs(num3 * 2f - 1f), 2.4f) * 0.1f; ((Vector3)(ref localPosition))..ctor(Mathf.Sin(num4) * 0.72f * num5, Mathf.Lerp(0.76f, 3.86f, num3), 0.34f + Mathf.Cos(num4) * 0.38f * num5); SetLocal(val, j, localPosition); } Color val2 = ThreadColors[i]; val2.a = 0.72f + Mathf.Sin(time * 1.65f + num2) * 0.08f + num * 0.2f; val.startColor = val2; val.endColor = val2; float startWidth = (val.endWidth = 0.06f + num * 0.014f); val.startWidth = startWidth; } UpdateTorchLights(time); } public void TriggerRitual() { _ritualUntil = Time.time + 1.6f; } private void CreateTorchLights() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) for (int i = 0; i < _torchLights.Length; i++) { for (int j = 0; j < 3; j++) { LineRenderer val = NewLine($"shrine_torch_{i}_flame_{j}", 6, j switch { 1 => 0.105f, 0 => 0.16f, _ => 0.065f, }, FlameColors[j]); val.endWidth = 0.008f; _torchFlames[i, j] = val; } float num = ((i == 0) ? (-1f) : 1f); GameObject val2 = new GameObject($"shrine_torch_{i}_light"); val2.transform.SetParent(((Component)this).transform, false); val2.transform.localPosition = new Vector3(num * 1.62f, 2.17f, -0.18f); Light val3 = val2.AddComponent(); val3.type = (LightType)2; val3.color = new Color(1f, 0.48f, 0.18f); val3.range = 12f; val3.intensity = 3.2f; val3.shadows = (LightShadows)0; _torchLights[i] = val3; } } private void UpdateTorchLights(float time) { //IL_0152: Unknown result type (might be due to invalid IL or missing references) Vector3 localPosition = default(Vector3); for (int i = 0; i < _torchLights.Length; i++) { float num = ((i == 0) ? (-1f) : 1f); float num2 = Mathf.Sin(time * 8.7f + (float)i * 1.7f) * 0.1f + Mathf.Sin(time * 13.1f + (float)i) * 0.05f; if ((Object)(object)_torchLights[i] != (Object)null) { _torchLights[i].intensity = 3.15f + num2 * 2.1f; } for (int j = 0; j < 3; j++) { LineRenderer val = _torchFlames[i, j]; float num3 = (float)i * 1.9f + (float)j * 2.15f; float num4 = 0.42f - (float)j * 0.045f; float num5 = Mathf.Sin(time * 4.6f + num3) * 0.055f; for (int k = 0; k < val.positionCount; k++) { float num6 = (float)k / (float)(val.positionCount - 1); float num7 = 1f - num6; ((Vector3)(ref localPosition))..ctor(num * 1.62f + num5 * num6 + Mathf.Sin(time * 7.1f + num3 + num6 * 4.2f) * 0.024f * num7, 2.01f + num6 * num4, -0.18f + Mathf.Cos(time * 5.8f + num3 + num6 * 3.5f) * 0.018f * num7); SetLocal(val, k, localPosition); } } } } private void SetLocal(LineRenderer line, int index, Vector3 localPosition) { //IL_0008: 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) line.SetPosition(index, ((Component)this).transform.TransformPoint(localPosition)); } private LineRenderer NewLine(string name, int points, float width, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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(name); val.transform.SetParent(((Component)this).transform, false); LineRenderer obj = val.AddComponent(); obj.useWorldSpace = true; obj.positionCount = points; ((Renderer)obj).material = _glow; obj.startWidth = width; obj.endWidth = width; obj.numCapVertices = 4; obj.numCornerVertices = 2; obj.startColor = color; obj.endColor = color; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } private static Material BuildGlowMaterial() { return SpellFx.CreateAdditiveMaterial(); } private void OnDestroy() { if ((Object)(object)_glow != (Object)null) { Object.Destroy((Object)(object)_glow); } } } public enum AbilityResource { Eitr, Fury } public class Spell { public const int CoreSlotCount = 5; public const int SlotCount = 6; public string Name; public string Flavor; public int UnlockLevel; public float Cooldown; public AbilityResource Resource; public float ResourceCost; public float CastTime; public bool HoldChannelPose; public FxKind? ChannelFx; public FxKind? ChannelCancelFx; public float BaseDamage; public string CastTrigger; public Func BlockReason; public Func Describe; public Action Cast; public string ResourceName { get { if (Resource != AbilityResource.Fury) { return "Eitr"; } return "Fury"; } } public string ResourceShort { get { if (Resource != AbilityResource.Fury) { return "E"; } return "F"; } } public static Spell[] RosterFor(PlayerClass cls) { return cls switch { PlayerClass.Mage => MageClass.Spells, PlayerClass.Berserker => BerserkerClass.Spells, _ => Array.Empty(), }; } public static Spell Slot(PlayerClass cls, int index) { Spell[] array = RosterFor(cls); if (index < 0 || index >= array.Length) { return null; } return array[index]; } public static Spell Slot(Player player, int index) { if (!((Object)(object)player == (Object)null)) { switch (index) { case 0: case 1: case 2: case 3: case 4: return Slot(ClassSystem.GetClass(player), index); case 5: return ClassSystem.GetClass(player) switch { PlayerClass.Mage => MageSpecializations.SpellFor(ClassSystem.GetMageSpecialization(player)), PlayerClass.Berserker => BerserkerSpecializations.SpellFor(ClassSystem.GetBerserkerSpecialization(player)), _ => null, }; } } return null; } public static Spell[] RosterFor(Player player) { Spell[] array = new Spell[6]; if ((Object)(object)player == (Object)null) { return array; } Spell[] array2 = RosterFor(ClassSystem.GetClass(player)); for (int i = 0; i < array2.Length && i < 5; i++) { array[i] = array2[i]; } array[5] = Slot(player, 5); return array; } public static Spell UnlockedAt(PlayerClass cls, int level) { Spell[] array = RosterFor(cls); foreach (Spell spell in array) { if (spell.UnlockLevel == level) { return spell; } } return null; } } public static class SpellAudio { private sealed class ClipData { public Object Clip; public float Duration; } private const int SampleRate = 44100; private static readonly Dictionary Clips = new Dictionary(); private static readonly Dictionary LastPlayed = new Dictionary(); private static ClipData _blackHoleImplosion; private static ClipData _arcLightningHop; public static void Play(FxKind kind, Vector3 a, Vector3 b) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00cd: 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_00e3: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) try { switch (kind) { case FxKind.BlackHoleChargeCancel: case FxKind.FireballChargeCancel: case FxKind.ArcLightningChargeCancel: case FxKind.FireRainChargeCancel: case FxKind.BloodHarvestChargeCancel: case FxKind.DreadVeilChargeCancel: return; case FxKind.ChainLightning: { if (LastPlayed.TryGetValue(kind, out var value) && Time.unscaledTime - value < 0.5f) { return; } break; } } LastPlayed[kind] = Time.unscaledTime; float num = ((NornsConfig.SpellVolume != null) ? NornsConfig.SpellVolume.Value : 0.75f); bool flag = PlayVanillaLayer(kind, a, b, num); if (!Clips.TryGetValue(kind, out var value2) || value2 == null || value2.Clip == (Object)null) { value2 = Build(kind); Clips[kind] = value2; } if (value2 == null || value2.Clip == (Object)null) { return; } Vector3 position = ((kind == FxKind.ChainLightning) ? b : a); GameObject val = new GameObject("norns_spell_audio") { hideFlags = (HideFlags)61 }; val.transform.position = position; Type type = Type.GetType("UnityEngine.AudioSource, UnityEngine.AudioModule"); if (type == null) { Object.Destroy((Object)(object)val); return; } Component val2 = val.AddComponent(type); Set(val2, "clip", value2.Clip); float num2 = kind switch { FxKind.FireRainImpact => 0.58f, FxKind.FireRainBolt => 0.42f, _ => 1f, }; Set(val2, "volume", num * (flag ? 0.28f : 0.75f) * num2); Set(val2, "spatialBlend", 1f); Set(val2, "minDistance", 2.5f); Set(val2, "maxDistance", (kind == FxKind.FireRainImpact) ? 38f : 28f); Set(val2, "dopplerLevel", 0f); PropertyInfo property = type.GetProperty("rolloffMode"); if (property != null) { property.SetValue(val2, Enum.Parse(property.PropertyType, "Linear"), null); } type.GetMethod("Play", Type.EmptyTypes)?.Invoke(val2, null); Object.Destroy((Object)(object)val, value2.Duration + 0.15f); } catch (Exception ex) { Plugin.Log.LogWarning((object)$"Suono {kind} fallito: {ex.Message}"); } } public static void PlayFireballImpact(Vector3 position) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) float volume = ((NornsConfig.SpellVolume != null) ? NornsConfig.SpellVolume.Value : 0.75f); SpawnVanilla("sfx_imp_fireball_explode", position, volume, 4f); } public static void PlayBlackHoleImplosion(Vector3 position) { //IL_005d: 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_006b: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) try { if (_blackHoleImplosion == null || _blackHoleImplosion.Clip == (Object)null) { _blackHoleImplosion = BuildBlackHoleImplosion(); } ClipData blackHoleImplosion = _blackHoleImplosion; if (blackHoleImplosion == null || blackHoleImplosion.Clip == (Object)null) { return; } float num = ((NornsConfig.SpellVolume != null) ? NornsConfig.SpellVolume.Value : 0.75f); GameObject val = new GameObject("norns_black_hole_implosion_audio") { hideFlags = (HideFlags)61 }; val.transform.position = position; Type type = Type.GetType("UnityEngine.AudioSource, UnityEngine.AudioModule"); if (type == null) { Object.Destroy((Object)(object)val); return; } Component val2 = val.AddComponent(type); Set(val2, "clip", blackHoleImplosion.Clip); Set(val2, "volume", num * 0.72f); Set(val2, "spatialBlend", 1f); Set(val2, "minDistance", 3f); Set(val2, "maxDistance", 34f); Set(val2, "dopplerLevel", 0f); PropertyInfo property = type.GetProperty("rolloffMode"); if (property != null) { property.SetValue(val2, Enum.Parse(property.PropertyType, "Linear"), null); } type.GetMethod("Play", Type.EmptyTypes)?.Invoke(val2, null); Object.Destroy((Object)(object)val, blackHoleImplosion.Duration + 0.15f); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Implosione sonora Black Hole fallita: " + ex.Message)); } } public static void PlayArcLightningHop(Vector3 position) { //IL_005d: 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_006b: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) try { if (_arcLightningHop == null || _arcLightningHop.Clip == (Object)null) { _arcLightningHop = BuildArcLightningHop(); } ClipData arcLightningHop = _arcLightningHop; if (arcLightningHop == null || arcLightningHop.Clip == (Object)null) { return; } float num = ((NornsConfig.SpellVolume != null) ? NornsConfig.SpellVolume.Value : 0.75f); GameObject val = new GameObject("norns_arc_lightning_hop_audio") { hideFlags = (HideFlags)61 }; val.transform.position = position; Type type = Type.GetType("UnityEngine.AudioSource, UnityEngine.AudioModule"); if (type == null) { Object.Destroy((Object)(object)val); return; } Component val2 = val.AddComponent(type); Set(val2, "clip", arcLightningHop.Clip); Set(val2, "volume", num * 0.34f); Set(val2, "spatialBlend", 1f); Set(val2, "minDistance", 2f); Set(val2, "maxDistance", 22f); Set(val2, "dopplerLevel", 0f); PropertyInfo property = type.GetProperty("rolloffMode"); if (property != null) { property.SetValue(val2, Enum.Parse(property.PropertyType, "Linear"), null); } type.GetMethod("Play", Type.EmptyTypes)?.Invoke(val2, null); Object.Destroy((Object)(object)val, arcLightningHop.Duration + 0.12f); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Crack Arc Lightning fallito: " + ex.Message)); } } private static bool PlayVanillaLayer(FxKind kind, Vector3 a, Vector3 b, float volume) { //IL_0041: 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_0065: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) return kind switch { FxKind.Fireball => SpawnVanilla("sfx_firestaff_launch", a, volume, 3f), FxKind.FrostNova => SpawnVanilla("sfx_dverger_ice_aoe_start", a, volume, 4f), FxKind.ChainLightning => SpawnVanilla("sfx_staff_lightning_fire", a, volume, 3f), FxKind.ArcLightningCharge => SpawnVanilla("sfx_staff_lightning_fire", b, volume * 0.28f, 2f), FxKind.RunicWard => SpawnVanilla("sfx_shieldgenerator_startup", a, volume * 0.82f, 5f), FxKind.FireRainStart => SpawnVanilla("sfx_fader_spawn_meteor_ambience", a, volume * 0.62f, 6.1299996f), FxKind.FireRainBolt => SpawnVanilla("sfx_fader_spawn_meteor_arrival", b, volume * 0.28f, 2f), FxKind.FireRainImpact => SpawnVanilla("sfx_imp_fireball_explode", a, volume * 0.48f, 3f), FxKind.BlackHole => SpawnVanilla("sfx_OpenPortal", a, volume * 0.72f, 7f), FxKind.BloodHarvest => SpawnVanilla("sfx_leech_attack_hit", a, volume * 0.72f, 4f), FxKind.DreadVeil => false, _ => false, }; } private static bool SpawnVanilla(string prefabName, Vector3 position, float volume, float lifetime) { //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) GameObject val = Effects.InstantiateLocal(prefabName, position, Quaternion.identity, lifetime); if ((Object)(object)val == (Object)null) { return false; } Type type = Type.GetType("UnityEngine.AudioSource, UnityEngine.AudioModule"); if (type == null) { return true; } Component[] componentsInChildren = val.GetComponentsInChildren(type, true); foreach (Component val2 in componentsInChildren) { PropertyInfo property = ((object)val2).GetType().GetProperty("volume"); if (!(property == null)) { float num = (float)property.GetValue(val2, null); property.SetValue(val2, num * volume, null); } } return true; } private static ClipData Build(FxKind kind) { float num = Duration(kind); int num2 = Mathf.CeilToInt(num * 44100f); float[] array = new float[num2]; Random random = new Random(8803 + (int)kind * 7919); double num3 = 0.0; double num4 = 0.0; float num5 = 0f; float num6 = 0f; for (int i = 0; i < num2; i++) { float num7 = (float)i / 44100f / num; float num8 = (float)random.NextDouble() * 2f - 1f; num5 += (num8 - num5) * 0.035f; float num9 = num8 - num5; float num11; float num18; float num19; float num20; switch (kind) { case FxKind.Fireball: { float num56 = Mathf.Lerp(720f, 105f, Mathf.Pow(num7, 0.62f)); num3 += (double)(num56 / 44100f); if (random.NextDouble() < 0.0025) { num6 = 0.8f; } num6 *= 0.985f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.42f + num9 * 0.2f + num6 * num9) * Envelope(num7, 0.025f, 1.7f); break; } case FxKind.FireballCharge: { num3 += (double)(Mathf.Lerp(118f, 420f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(46f, 132f, num7) / 44100f); float num52 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.12f)); float num53 = 0.32f + num7 * 0.68f; float num54 = 1f - Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.91f, 1f, num7)); float num55 = 0.72f + Mathf.Sin(num7 * num7 * (float)Math.PI * 13f) * 0.08f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.3f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.24f + num9 * (0.08f + num7 * 0.1f)) * num52 * num53 * num54 * num55; break; } case FxKind.FireRainCharge: { num3 += (double)(Mathf.Lerp(42f, 116f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(71f, 188f, num7) / 44100f); float num57 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.16f)); float num58 = 0.76f + Mathf.Sin(num7 * num7 * (float)Math.PI * 17f) * 0.1f; float num59 = 1f - Mathf.SmoothStep(0.91f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.17f + num5 * (0.18f + num7 * 0.16f) + num9 * 0.07f) * num57 * num58 * num59; break; } case FxKind.FrostNova: { float num60 = Mathf.Sin(Mathf.Clamp01(num7 / 0.18f) * (float)Math.PI); float num61 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.035f)); float num62 = 1f - Mathf.SmoothStep(0.18f, 1f, num7); float num63 = 1f - Mathf.SmoothStep(0.05f, 0.82f, num7); num3 += (double)(Mathf.Lerp(82f, 31f, num7) / 44100f); num4 += (double)(Mathf.Lerp(340f, 96f, Mathf.Sqrt(num7)) / 44100f); num11 = (float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f * num60 * num62 + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.12f * num60 + num5 * 0.28f * num61 * num62 + num9 * 0.11f * num61 * num63; break; } case FxKind.ChainLightning: { float num50 = Mathf.Lerp(1900f, 180f, Mathf.Sqrt(num7)); num3 += (double)(num50 / 44100f); float num51 = ((Mathf.Sin(num7 * (float)Math.PI * 28f) > 0f) ? 1f : (-1f)); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.3f + num51 * 0.12f + num9 * 0.4f) * Envelope(num7, 0.004f, 2.8f); break; } case FxKind.ArcLightningCharge: { num3 += (double)(Mathf.Lerp(68f, 310f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(120f, 680f, num7) / 44100f); float num47 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.22f)); float num48 = 0.78f + Mathf.Sin(num7 * num7 * (float)Math.PI * 19f) * 0.13f; float num49 = 1f - Mathf.SmoothStep(0.9f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.24f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.12f + num9 * (0.07f + num7 * 0.14f)) * num47 * num48 * num49; break; } case FxKind.RunicWard: num3 += 0.004988661967217922; num4 += 0.007482993416488171; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.28f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.18f + (float)Math.Sin(num3 * Math.PI * 4.02) * 0.11f + num5 * 0.15f) * Envelope(num7, 0.11f, 1.35f); break; case FxKind.FireRainStart: { num3 += (double)(Mathf.Lerp(34f, 78f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(57f, 112f, num7) / 44100f); float num46 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.16f)); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.45f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.2f + num5 * 0.34f) * num46 * (1f - Mathf.SmoothStep(0.88f, 1f, num7)); break; } case FxKind.FireRainBolt: { float num45 = Mathf.Lerp(980f, 115f, Mathf.Pow(num7, 0.58f)); num3 += (double)(num45 / 44100f); num4 += (double)(Mathf.Lerp(180f, 62f, num7) / 44100f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.24f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.18f + num9 * 0.42f) * Envelope(num7, 0.015f, 1.15f); break; } case FxKind.FireRainImpact: { num3 += (double)(Mathf.Lerp(74f, 29f, num7) / 44100f); num4 += 0.0010430838447064161; float num44 = Mathf.Exp((0f - num7) * 4.8f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.42f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.2f + num5 * 0.4f + num9 * 0.18f) * num44 * Mathf.Clamp01(num7 / 0.006f); break; } case FxKind.BlackHole: { num3 += (double)(Mathf.Lerp(46f, 27f, num7) / 44100f); num4 += (double)(Mathf.Lerp(91f, 38f, num7) / 44100f); float num43 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.1f)) * (1f - Mathf.SmoothStep(0.84f, 1f, num7)); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.54f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.18f + num5 * 0.24f) * num43; break; } case FxKind.BlackHoleCharge: { num3 += (double)(Mathf.Lerp(58f, 112f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(132f, 48f, num7) / 44100f); float num41 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.12f)); float num42 = 0.52f + Mathf.Pow(num7, 1.8f) * 0.48f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.15f + num5 * 0.24f) * num41 * num42 * (1f - Mathf.SmoothStep(0.92f, 1f, num7)); break; } case FxKind.BloodHarvest: { num3 += 0.001451247138902545; float num40 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(num7 * (float)Math.PI * 5f)), 10f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.44f + num5 * 0.22f) * (0.18f + num40 * 0.82f) * Envelope(num7, 0.05f, 1.25f); break; } case FxKind.BloodHarvestCharge: { num3 += (double)(Mathf.Lerp(48f, 108f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(146f, 62f, num7) / 44100f); float num37 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.16f)); float num38 = 0.84f + Mathf.Sin(num7 * num7 * (float)Math.PI * 13f) * 0.1f; float num39 = 1f - Mathf.SmoothStep(0.9f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.3f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.13f + num5 * 0.2f) * num37 * num38 * num39; break; } case FxKind.DreadVeil: { num3 += (double)(Mathf.Lerp(54f, 92f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(176f, 118f, num7) / 44100f); float num35 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.16f)); float num36 = 0.84f + Mathf.Sin(num7 * (float)Math.PI * 9f) * 0.07f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.31f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.12f + num5 * 0.27f) * num35 * num36 * (1f - Mathf.SmoothStep(0.76f, 1f, num7)); break; } case FxKind.DreadVeilCharge: { num3 += (double)(Mathf.Lerp(38f, 84f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(132f, 218f, num7) / 44100f); float num32 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.18f)); float num33 = 0.78f + Mathf.Sin(num7 * num7 * (float)Math.PI * 11f) * 0.08f; float num34 = 1f - Mathf.SmoothStep(0.9f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.28f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.1f + num5 * 0.24f) * num32 * num33 * num34; break; } case FxKind.RendingEmpower: { num3 += (double)(Mathf.Lerp(116f, 44f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(260f, 760f, Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.48f))) / 44100f); float num29 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.24f)); float num30 = Mathf.Exp(0f - Mathf.Pow((num7 - 0.38f) / 0.075f, 2f)); float num31 = 1f - Mathf.SmoothStep(0.62f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f + (float)Math.Sin(num4 * Math.PI * 2.0) * (0.08f + num30 * 0.2f) + num5 * 0.24f + num9 * num30 * 0.16f) * num29 * num31; break; } case FxKind.WarCry: { num3 += (double)(Mathf.Lerp(148f, 62f, Mathf.Sqrt(num7)) / 44100f); num4 += (double)(Mathf.Lerp(310f, 118f, num7) / 44100f); float num27 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.045f)) * (1f - Mathf.SmoothStep(0.1f, 0.62f, num7)); float num28 = Mathf.Sin(Mathf.Clamp01(num7 / 0.55f) * (float)Math.PI); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.46f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.2f) * num27 + num5 * 0.34f * num28 + num9 * 0.11f * num27; break; } case FxKind.Bloodstorm: { float num25 = 3f; float num26 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(num7 * (float)Math.PI * num25)), 3.2f); num3 += (double)(Mathf.Lerp(96f, 152f, num7) / 44100f); num4 += (double)(Mathf.Lerp(420f, 880f, num26) / 44100f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.3f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.16f * num26 + num5 * 0.22f + num9 * (0.06f + num26 * 0.26f)) * (0.3f + num26 * 0.7f) * Envelope(num7, 0.02f, 1.35f); break; } case FxKind.Bearskin: { num3 += (double)(Mathf.Lerp(58f, 41f, num7) / 44100f); num4 += (double)(Mathf.Lerp(126f, 88f, Mathf.Sqrt(num7)) / 44100f); float num23 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.03f)) * (1f - Mathf.SmoothStep(0.06f, 0.48f, num7)); float num24 = Mathf.Sin(num7 * (float)Math.PI) * 0.55f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.44f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.14f) * num23 + num5 * (0.26f * num23 + 0.1f * num24); break; } case FxKind.RageUnbound: { num3 += (double)(Mathf.Lerp(112f, 47f, Mathf.Sqrt(num7)) / 44100f); num4 += (double)(Mathf.Lerp(228f, 74f, num7) / 44100f); float num21 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.05f)) * (1f - Mathf.SmoothStep(0.08f, 0.55f, num7)); float num22 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(num7 * (float)Math.PI * 5f)), 8f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.48f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.18f) * (num21 + num22 * 0.42f) + num5 * 0.3f * num21 + num9 * 0.09f * num21; break; } case FxKind.RendingBlow: num18 = 1f; goto IL_13a6; case FxKind.ExecutionersWake: num18 = 3f; goto IL_13a6; case FxKind.Earthshatter: { num3 += (double)(Mathf.Lerp(74f, 26f, Mathf.Sqrt(num7)) / 44100f); num4 += (double)(Mathf.Lerp(158f, 44f, num7) / 44100f); float num16 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.012f)) * (1f - Mathf.SmoothStep(0.02f, 0.42f, num7)); float num17 = (1f - Mathf.SmoothStep(0.25f, 1f, num7)) * (0.35f + Mathf.Abs(num5) * 0.65f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.58f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.2f) * num16 + num5 * 0.38f * num16 + num9 * 0.16f * num17; break; } case FxKind.EarthshatterDive: { num3 += (double)(Mathf.Lerp(66f, 138f, num7 * num7) / 44100f); num4 += (double)(Mathf.Lerp(184f, 392f, num7) / 44100f); float num14 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.1f)) * (0.35f + num7 * 0.65f); float num15 = 1f - Mathf.SmoothStep(0.88f, 1f, num7); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.26f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.11f + num5 * 0.3f + num9 * 0.1f) * num14 * num15; break; } case FxKind.WarbandsOath: { num3 += (double)(Mathf.Lerp(96f, 92f, num7) / 44100f); num4 += (double)(Mathf.Lerp(144f, 138f, num7) / 44100f); float num12 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num7 / 0.14f)) * (1f - Mathf.SmoothStep(0.58f, 1f, num7)); float num13 = 0.82f + Mathf.Sin(num7 * (float)Math.PI * 2.4f) * 0.18f; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.42f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.28f + num5 * 0.1f) * num12 * num13; break; } default: { int num10 = Mathf.Min(2, (int)(num7 * 3f)); float[] array2 = new float[3] { 293.66f, 369.99f, 440f }; num3 += (double)(array2[num10] / 44100f); num4 += (double)(array2[num10] * 2.01f / 44100f); float position = num7 * 3f - (float)num10; num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.13f) * Envelope(position, 0.08f, 1.4f) * (1f - Mathf.SmoothStep(0.88f, 1f, num7)); break; } IL_13a6: num19 = num18; num20 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(num7 * (float)Math.PI * num19)), 5f); num3 += (double)(Mathf.Lerp(164f, 58f, num7) / 44100f); num4 += (double)(Mathf.Lerp(960f, 240f, Mathf.Sqrt(num7)) / 44100f); num11 = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.34f + (float)Math.Sin(num4 * Math.PI * 2.0) * 0.26f * num20 + num5 * 0.24f + num9 * (0.05f + num20 * 0.22f)) * (0.28f + num20 * 0.72f) * Envelope(num7, 0.015f, 1.55f); break; } array[i] = num11; } Normalize(array, (kind == FxKind.FireRainImpact) ? 0.72f : 0.68f); return CreateClip("norns_" + kind.ToString().ToLowerInvariant(), array, num); } private static ClipData BuildBlackHoleImplosion() { int num = Mathf.CeilToInt(29988f); float[] array = new float[num]; Random random = new Random(19331); double num2 = 0.0; float num3 = 0f; for (int i = 0; i < num; i++) { float num4 = (float)i / (float)num; float num5 = (float)random.NextDouble() * 2f - 1f; num3 += (num5 - num3) * 0.045f; num2 += (double)(Mathf.Lerp(86f, 24f, Mathf.Sqrt(num4)) / 44100f); float num6 = Mathf.Clamp01(num4 / 0.008f); float num7 = Mathf.Exp((0f - num4) * 5.4f); float num8 = Mathf.Exp((0f - num4) * 18f) * (num5 - num3); array[i] = ((float)Math.Sin(num2 * Math.PI * 2.0) * 0.62f + num3 * 0.34f + num8 * 0.28f) * num6 * num7; } Normalize(array, 0.78f); return CreateClip("norns_black_hole_implosion", array, 0.68f); } private static ClipData BuildArcLightningHop() { int num = Mathf.CeilToInt(6174f); float[] array = new float[num]; Random random = new Random(42811); float num2 = 0f; double num3 = 0.0; for (int i = 0; i < num; i++) { float num4 = (float)i / (float)num; float num5 = (float)random.NextDouble() * 2f - 1f; num2 += (num5 - num2) * 0.085f; float num6 = num5 - num2; num3 += (double)(Mathf.Lerp(2150f, 260f, Mathf.Sqrt(num4)) / 44100f); float num7 = Mathf.Clamp01(num4 / 0.012f); float num8 = Mathf.Exp((0f - num4) * 7.8f); float num9 = ((Mathf.Sin(num4 * (float)Math.PI * 34f) > 0f) ? 1f : (-1f)); array[i] = ((float)Math.Sin(num3 * Math.PI * 2.0) * 0.28f + num6 * 0.62f + num9 * 0.08f) * num7 * num8; } Normalize(array, 0.62f); return CreateClip("norns_arc_lightning_hop", array, 0.14f); } private static ClipData CreateClip(string name, float[] samples, float duration) { Type type = Type.GetType("UnityEngine.AudioClip, UnityEngine.AudioModule"); MethodInfo methodInfo = type?.GetMethod("Create", BindingFlags.Static | BindingFlags.Public, null, new Type[5] { typeof(string), typeof(int), typeof(int), typeof(int), typeof(bool) }, null); if (methodInfo == null) { return null; } object obj = methodInfo.Invoke(null, new object[5] { name, samples.Length, 1, 44100, false }); if (obj == null) { return null; } MethodInfo method = type.GetMethod("SetData", BindingFlags.Instance | BindingFlags.Public, null, new Type[2] { typeof(float[]), typeof(int) }, null); if (method == null) { return null; } method.Invoke(obj, new object[2] { samples, 0 }); return new ClipData { Clip = (Object)((obj is Object) ? obj : null), Duration = duration }; } private static void Set(Component component, string property, object value) { ((object)component).GetType().GetProperty(property)?.SetValue(component, value, null); } private static float Duration(FxKind kind) { return kind switch { FxKind.Fireball => 0.48f, FxKind.FireballCharge => 1.15f, FxKind.FrostNova => 0.86f, FxKind.ChainLightning => 0.32f, FxKind.ArcLightningCharge => 0.8f, FxKind.RunicWard => 1.05f, FxKind.FireRainStart => 5.1299996f, FxKind.FireRainCharge => 2.5f, FxKind.FireRainBolt => 0.62f, FxKind.FireRainImpact => 0.72f, FxKind.BlackHole => 6f, FxKind.BlackHoleCharge => 1.5f, FxKind.BloodHarvest => 3.47f, FxKind.BloodHarvestCharge => 1.2f, FxKind.DreadVeil => 2.4f, FxKind.DreadVeilCharge => 2.5f, FxKind.RendingBlow => 0.42f, FxKind.WarCry => 0.85f, FxKind.Bloodstorm => 1.4f, FxKind.Bearskin => 1.05f, FxKind.RendingEmpower => 1.2f, FxKind.RageUnbound => 1.25f, FxKind.ExecutionersWake => 0.65f, FxKind.Earthshatter => 0.95f, FxKind.EarthshatterDive => 0.82f, FxKind.WarbandsOath => 1.15f, _ => 1.05f, }; } private static float Envelope(float position, float attack, float power) { return Mathf.Clamp01(position / Mathf.Max(0.0001f, attack)) * Mathf.Pow(Mathf.Clamp01(1f - position), power); } private static void Normalize(float[] samples, float peak) { float num = 0.0001f; foreach (float num2 in samples) { num = Mathf.Max(num, Mathf.Abs(num2)); } float num3 = peak / num; for (int j = 0; j < samples.Length; j++) { samples[j] *= num3; } } } public enum FxKind { Fireball = 0, FrostNova = 1, ChainLightning = 2, RunicWard = 3, FireRainStart = 4, FireRainImpact = 5, LevelUp = 6, FireRainBolt = 7, BlackHole = 8, BloodHarvest = 9, DreadVeil = 10, RendingBlow = 11, WarCry = 12, Bloodstorm = 13, Bearskin = 14, RageUnbound = 15, ExecutionersWake = 16, Earthshatter = 17, WarbandsOath = 18, RendingEmpower = 19, EarthshatterDive = 20, BlackHoleCharge = 29, BlackHoleChargeCancel = 30, FireballCharge = 31, FireballChargeCancel = 32, ArcLightningCharge = 33, ArcLightningChargeCancel = 34, FireRainCharge = 35, FireRainChargeCancel = 36, BloodHarvestCharge = 37, BloodHarvestChargeCancel = 38, DreadVeilCharge = 39, DreadVeilChargeCancel = 40 } public static class SpellFx { public static readonly Color Ember = new Color(1f, 0.55f, 0.18f); public static readonly Color EmberCore = new Color(1f, 0.92f, 0.7f); public static readonly Color Frost = new Color(0.55f, 0.88f, 1f); public static readonly Color Storm = new Color(0.7f, 0.85f, 1f); public static readonly Color Rune = new Color(0.85f, 0.72f, 0.44f); private static Material _additive; private static bool _materialTried; private static readonly Color BerserkerCrimson = new Color(0.92f, 0.08f, 0.035f); private static readonly Color BerserkerGold = new Color(1f, 0.6f, 0.16f); private const float BloodstormVisualRadius = 3.6000001f; public const float BoltSpeed = 48f; private const int ArcSegments = 14; private static Texture2D _wardRuneSheet; private static Material Additive() { //IL_005b: 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_006d: Expected O, but got Unknown if (_materialTried) { return _additive; } _materialTried = true; string[] array = new string[5] { "Particles/Additive", "Legacy Shaders/Particles/Additive", "Particles/Standard Unlit", "Sprites/Default", "Unlit/Color" }; foreach (string text in array) { Shader val = Shader.Find(text); if (!((Object)(object)val == (Object)null)) { _additive = new Material(val) { hideFlags = (HideFlags)61 }; ConfigureAdditiveBlend(_additive); Plugin.Log.LogInfo((object)("Shader degli effetti: " + text)); return _additive; } } Plugin.Log.LogWarning((object)"Nessuno shader utilizzabile trovato: gli effetti saranno invisibili."); return null; } internal static Material CreateAdditiveMaterial() { //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_0020: Expected O, but got Unknown Material val = Additive(); if (!((Object)(object)val != (Object)null)) { return null; } return new Material(val) { hideFlags = (HideFlags)61 }; } private static void ConfigureAdditiveBlend(Material material) { if (!((Object)(object)material == (Object)null)) { if (material.HasProperty("_SrcBlend")) { material.SetInt("_SrcBlend", 5); } if (material.HasProperty("_DstBlend")) { material.SetInt("_DstBlend", 1); } if (material.HasProperty("_ZWrite")) { material.SetInt("_ZWrite", 0); } material.DisableKeyword("_ALPHATEST_ON"); material.EnableKeyword("_ALPHABLEND_ON"); material.renderQueue = 3000; } } public static void PlayShared(FxKind kind, Vector3 a, Vector3 b) { //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_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) Play(kind, a, b); Network.BroadcastFx(kind, a, b); } public static void Play(FxKind kind, Vector3 a, Vector3 b) { //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_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_00e9: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: 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_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: 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_0354: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_026a: 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_0343: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03db: 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_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0386: 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_0321: 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_03a3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Plugin.Instance == (Object)null) { return; } try { SpellAudio.Play(kind, a, b); switch (kind) { case FxKind.Fireball: if (!PlayAuthoredFireball(a, b)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BoltRoutine(a, b)); } break; case FxKind.FrostNova: if (!PlayAuthoredFrostNova(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(NovaRoutine(a)); } break; case FxKind.ChainLightning: if (!PlayAuthoredArcLightning(a, b)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(ArcRoutine(a, b)); } break; case FxKind.RunicWard: if (!PlayAuthoredRunicWard(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(WardRoutine(a)); } break; case FxKind.FireRainStart: if (!PlayAuthoredFireRainStart(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireRainStartRoutine(a)); } break; case FxKind.FireRainBolt: if (!PlayAuthoredFireRainBolt(a, b)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireRainBoltRoutine(a, b)); } break; case FxKind.FireRainImpact: if (!PlayAuthoredFireRainImpact(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(FireRainImpactRoutine(a)); } break; case FxKind.FireRainCharge: PlayFireRainCharge(a, b); break; case FxKind.FireRainChargeCancel: FallOfRagnarokChargeVfxController.CancelNearest(b); break; case FxKind.LevelUp: ((MonoBehaviour)Plugin.Instance).StartCoroutine(LevelUpRoutine(a)); break; case FxKind.BlackHole: if (!PlayAuthoredBlackHole(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BlackHoleRoutine(a)); } break; case FxKind.BlackHoleCharge: PlayBlackHoleCharge(a, b); break; case FxKind.BlackHoleChargeCancel: BlackHoleChargeVfxController.CancelNearest(a); break; case FxKind.FireballCharge: PlayFireballCharge(a, b); break; case FxKind.FireballChargeCancel: FireballChargeVfxController.CancelNearest(b); break; case FxKind.ArcLightningCharge: PlayArcLightningCharge(a, b); break; case FxKind.ArcLightningChargeCancel: ArcLightningChargeVfxController.CancelNearest(b); break; case FxKind.BloodHarvest: if (!PlayAuthoredBloodHarvest(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BloodHarvestRoutine(a)); } break; case FxKind.BloodHarvestCharge: PlayBloodHarvestCharge(a, b); break; case FxKind.BloodHarvestChargeCancel: BloodHarvestChargeVfxController.CancelNearest(b); break; case FxKind.DreadVeil: if (!PlayAuthoredDreadVeil(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(DreadVeilFallbackRoutine(a)); } break; case FxKind.DreadVeilCharge: PlayDreadVeilCharge(a, b); break; case FxKind.DreadVeilChargeCancel: DreadVeilChargeVfxController.CancelNearest(a); break; case FxKind.RendingBlow: RendingBlowVfxController.ConsumeNearest(a); ((MonoBehaviour)Plugin.Instance).StartCoroutine(BerserkerSlashRoutine(kind, a, b)); break; case FxKind.ExecutionersWake: if (!PlayAuthoredExecutionersWake(a, b)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(ExecutionersWakeRoutine(a, b)); } break; case FxKind.RendingEmpower: RendingBlowGestureController.PlayNearest(a); if (!PlayAuthoredRendingBlow(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(RendingEmpowerRoutine(a)); } break; case FxKind.WarCry: if (!PlayAuthoredWarCry(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BerserkerPulseRoutine(kind, a)); } break; case FxKind.WarbandsOath: if (!PlayAuthoredWarbandsOath(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BerserkerPulseRoutine(kind, a)); } break; case FxKind.Earthshatter: if (!PlayAuthoredEarthshatterImpact(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(EarthshatterExplosionRoutine(a)); } break; case FxKind.EarthshatterDive: if (!PlayAuthoredEarthshatterDive(a, b)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(EarthshatterDiveRoutine(a, b)); } break; case FxKind.Bearskin: if (!PlayAuthoredBearskin(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BerserkerAuraRoutine(kind, a)); } break; case FxKind.RageUnbound: if (!PlayAuthoredRageUnbound(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BerserkerAuraRoutine(kind, a)); } break; case FxKind.Bloodstorm: if (!PlayAuthoredBloodstorm(a)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(BloodstormWeaponRoutine(a)); } break; case (FxKind)21: case (FxKind)22: case (FxKind)23: case (FxKind)24: case (FxKind)25: case (FxKind)26: case (FxKind)27: case (FxKind)28: break; } } catch (Exception ex) { Plugin.Log.LogWarning((object)$"Effetto {kind} fallito: {ex.Message}"); } } private static LineRenderer NewLine(int points, Color color, float width) { //IL_0005: 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_004c: Unknown result type (might be due to invalid IL or missing references) LineRenderer obj = new GameObject("norns_fx_line").AddComponent(); ((Renderer)obj).material = Additive(); obj.useWorldSpace = true; obj.positionCount = points; obj.startWidth = width; obj.endWidth = width; obj.numCapVertices = 4; obj.numCornerVertices = 2; obj.startColor = color; obj.endColor = color; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } private static GameObject NewOrb(Color color, float diameter) { //IL_0033: 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_0052: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = obj.GetComponent(); ((Renderer)component2).material = Additive(); ((Renderer)component2).material.color = color; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; obj.transform.localScale = Vector3.one * diameter; return obj; } private static GameObject NewOpaqueOrb(Color color, float diameter) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0067: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = obj.GetComponent(); Shader val = Shader.Find("Standard") ?? Shader.Find("Legacy Shaders/Diffuse") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { ((Renderer)component2).material = new Material(val) { hideFlags = (HideFlags)61 }; ((Renderer)component2).material.color = color; } ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; obj.transform.localScale = Vector3.one * diameter; return obj; } private static GameObject NewOpaqueShard(Color color) { //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_0067: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = obj.GetComponent(); Shader val = Shader.Find("Standard") ?? Shader.Find("Legacy Shaders/Diffuse") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { ((Renderer)component2).material = new Material(val) { hideFlags = (HideFlags)61 }; ((Renderer)component2).material.color = color; } ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; return obj; } private static LineRenderer[] NewBloodPool(Vector3 center, float radius) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_009e: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) LineRenderer[] array = (LineRenderer[])(object)new LineRenderer[17]; float num = radius / 17f; Vector3 val = Effects.SurfacePoint(center); Vector3 val5 = default(Vector3); for (int i = 0; i < 17; i++) { float num2 = ((float)i + 0.42f) / 17f; float num3 = radius * num2; LineRenderer val2 = NewLine(65, new Color(0.46f, 0.003f, 0.008f, 0f), num * 1.34f); ((Object)val2).name = "norns_blood_pool_band"; val2.endWidth = val2.startWidth; Material val3 = Additive(); if ((Object)(object)val3 != (Object)null) { Material val4 = new Material(val3) { hideFlags = (HideFlags)61 }; val4.color = Color.white; if (val4.HasProperty("_RendererColor")) { val4.SetColor("_RendererColor", Color.white); } if (val4.HasProperty("_SrcBlend")) { val4.SetInt("_SrcBlend", 5); } if (val4.HasProperty("_DstBlend")) { val4.SetInt("_DstBlend", 10); } if (val4.HasProperty("_ZWrite")) { val4.SetInt("_ZWrite", 0); } val4.renderQueue = 3000; ((Renderer)val2).material = val4; } for (int j = 0; j < 65; j++) { float num4 = (float)j * (float)Math.PI * 2f / 64f; float num5 = 1f + num2 * (Mathf.Sin(num4 * 3f + 0.7f) * 0.075f + Mathf.Sin(num4 * 7f - 1.1f) * 0.04f + Mathf.Sin(num4 * 11f + 2.4f) * 0.025f); ((Vector3)(ref val5))..ctor(Mathf.Cos(num4) * num3 * num5, 0f, Mathf.Sin(num4) * num3 * num5 * 0.84f); val2.SetPosition(j, Effects.SurfacePoint(val + val5) + Vector3.up * 0.055f); } array[i] = val2; } return array; } private static Light NewLight(Vector3 position, Color color, float range, float intensity) { //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_0010: 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) GameObject val = new GameObject("norns_fx_light"); val.transform.position = position; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = color; obj.range = range; obj.intensity = intensity; obj.shadows = (LightShadows)0; return obj; } private static void SetCircle(LineRenderer line, Vector3 center, float radius, int points) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < points; i++) { float num = (float)i * (float)Math.PI * 2f / (float)(points - 1); line.SetPosition(i, center + new Vector3(Mathf.Cos(num) * radius, 0f, Mathf.Sin(num) * radius)); } } private static void Tint(LineRenderer line, Color color, float alpha) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Color val = color; val.a = alpha; line.startColor = val; line.endColor = val; } private static void Kill(params Object[] objects) { foreach (Object val in objects) { if (!(val == (Object)null)) { Component val2 = (Component)(object)((val is Component) ? val : null); if (val2 != null) { Object.Destroy((Object)(object)val2.gameObject); } else { Object.Destroy(val); } } } } private static bool PlayAuthoredRendingBlow(Vector3 position) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) RendingBlowVfxController.SupersedeNearest(position); GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/rendingblow/norns_vfx_rendingblow.prefab", position, Quaternion.identity, 9.5f); if ((Object)(object)val == (Object)null) { return false; } RendingBlowVfxController component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.Lifetime = 8f; return true; } Kill((Object)val); return false; } private static bool PlayAuthoredWarCry(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/warcry/norns_vfx_warcry.prefab", Effects.SurfacePoint(position), Quaternion.identity, 4.5f); if ((Object)(object)val == (Object)null) { return false; } WarCryVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)"Prefab War Cry privo di WarCryVfxController; uso fallback."); return false; } component.Radius = 8f; return true; } private static bool PlayAuthoredBloodstorm(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/bloodstorm/norns_vfx_bloodstorm.prefab", position, Quaternion.identity, 4.2f); if ((Object)(object)val == (Object)null) { return false; } BloodstormVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)"Prefab Bloodstorm privo di controller; uso fallback."); return false; } component.Lifetime = 1.2f; return true; } private static bool PlayAuthoredBearskin(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return PlayAuthoredBerserkerAura("assets/mod/vfx/abilities/bearskin/norns_vfx_bearskin.prefab", position, 12f, 0f, 0.42f, "Bearskin"); } private static bool PlayAuthoredRageUnbound(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return PlayAuthoredBerserkerAura("assets/mod/vfx/abilities/rageunbound/norns_vfx_rageunbound.prefab", position, 12f, 1.35f, 0.78f, "Rage Unbound"); } private static bool PlayAuthoredBerserkerAura(string assetPath, Vector3 position, float duration, float heartbeatInterval, float intensity, string label) { //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) GameObject val = VfxAssets.InstantiateLocal(assetPath, position, Quaternion.identity, duration + 3.5f); if ((Object)(object)val == (Object)null) { return false; } BerserkerAuraVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)("Prefab " + label + " privo di BerserkerAuraVfxController; uso fallback.")); return false; } component.Lifetime = duration; component.HeartbeatInterval = heartbeatInterval; component.BaseIntensity = intensity; return true; } private static bool PlayAuthoredExecutionersWake(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) Vector3 val = to - from; val.y = 0f; Quaternion rotation = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) : Quaternion.identity); GameObject val2 = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/executionerswake/norns_vfx_executionerswake.prefab", from, rotation, 4f); if ((Object)(object)val2 == (Object)null) { return false; } ExecutionersWakeVfxController component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val2); Plugin.Log.LogError((object)"Prefab Executioner's Wake privo di controller; uso fallback."); return false; } component.Initialize(from, to, 7f); return true; } private static bool PlayAuthoredEarthshatterDive(Vector3 position, Vector3 target) { //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_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_000d: 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) Vector3 landing = Effects.SurfacePoint(target); GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/earthshatter/norns_vfx_earthshatter_dive.prefab", position, Quaternion.identity, 4f); if ((Object)(object)val == (Object)null) { return false; } EarthshatterDiveVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)"Prefab Earthshatter dive privo di controller; uso fallback."); return false; } component.Initialize(landing); return true; } private static bool PlayAuthoredEarthshatterImpact(Vector3 position) { //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_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_000d: 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_0069: Unknown result type (might be due to invalid IL or missing references) Vector3 position2 = Effects.SurfacePoint(position); GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/earthshatter/norns_vfx_earthshatter_impact.prefab", position2, Quaternion.identity, 6f); if ((Object)(object)val == (Object)null) { return false; } EarthshatterImpactVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)"Prefab Earthshatter impact privo di controller; uso fallback."); return false; } component.Radius = 10f; Effects.InstantiateLocal("fx_goblinking_meteor_hit", position2, Quaternion.identity, 6f); return true; } private static bool PlayAuthoredWarbandsOath(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/warbandsoath/norns_vfx_warbandsoath.prefab", Effects.SurfacePoint(position), Quaternion.identity, 22f); if ((Object)(object)val == (Object)null) { return false; } WarbandsOathVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); Plugin.Log.LogError((object)"Prefab Warband's Oath privo di controller; uso fallback."); return false; } component.Radius = 15f; component.Lifetime = 18f; return true; } private static Transform NearestPlayerAnchor(Vector3 position, float maximumDistance = 4f) { //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) Transform result = null; float num = maximumDistance; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, position); if (!(num2 >= num)) { num = num2; result = ((Component)allPlayer).transform; } } } return result; } private static Transform RightHandAnchor(Transform player) { if ((Object)(object)player == (Object)null) { return null; } Animator componentInChildren = ((Component)player).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || !componentInChildren.isHuman) { return null; } return componentInChildren.GetBoneTransform((HumanBodyBones)18); } private static IEnumerator RendingEmpowerRoutine(Vector3 position) { //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) Transform anchor = NearestPlayerAnchor(position); Transform hand = RightHandAnchor(anchor); LineRenderer beam = NewLine(33, BerserkerCrimson, 0.62f); LineRenderer core = NewLine(33, new Color(1f, 0.42f, 0.16f), 0.14f); LineRenderer[] sideBeams = (LineRenderer[])(object)new LineRenderer[3] { NewLine(21, new Color(0.75f, 0.015f, 0.01f), 0.16f), NewLine(21, new Color(1f, 0.1f, 0.025f), 0.11f), NewLine(21, new Color(0.62f, 0.01f, 0.02f), 0.13f) }; GameObject weaponGlow = NewOrb(new Color(1f, 0.1f, 0.025f, 0.72f), 0.42f); Light light = NewLight(position + Vector3.up * 1.4f, BerserkerCrimson, 9f, 0f); float elapsed = 0f; while (elapsed < 0.95f) { Vector3 val = (((Object)(object)hand != (Object)null) ? hand.position : ((((Object)(object)anchor != (Object)null) ? anchor.position : position) + Vector3.up * 1.45f)); Vector3 val2 = val + Vector3.up * 14f; float num = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(elapsed / 0.2f)); Vector3 val3 = Vector3.Lerp(val2, val, num); float num2 = Mathf.Clamp01((0.95f - elapsed) / 0.34f); float num3 = 0.78f + Mathf.Sin(elapsed * 31f) * 0.16f; for (int i = 0; i < beam.positionCount; i++) { float num4 = (float)i / (float)(beam.positionCount - 1); float num5 = Mathf.Sin(num4 * (float)Math.PI); Vector3 val4 = new Vector3(Mathf.Sin((float)i * 2.41f + elapsed * 18f), 0f, Mathf.Cos((float)i * 1.73f - elapsed * 15f)) * 0.055f * num5; Vector3 val5 = Vector3.Lerp(val2, val3, num4) + val4; beam.SetPosition(i, val5); core.SetPosition(i, val5); } for (int j = 0; j < sideBeams.Length; j++) { LineRenderer val6 = sideBeams[j]; float num6 = (float)j * (float)Math.PI * 2f / (float)sideBeams.Length; for (int k = 0; k < val6.positionCount; k++) { float num7 = (float)k / (float)(val6.positionCount - 1); float num8 = Mathf.Sin(num7 * (float)Math.PI) * (0.28f + (float)j * 0.04f); float num9 = num6 + num7 * (float)Math.PI * 5f + elapsed * 7f; val6.SetPosition(k, Vector3.Lerp(val2, val3, num7) + new Vector3(Mathf.Cos(num9) * num8, 0f, Mathf.Sin(num9) * num8)); } Tint(val6, BerserkerCrimson, num * num2 * 0.62f); } Tint(beam, BerserkerCrimson, num * num2 * num3); Tint(core, new Color(1f, 0.58f, 0.25f), num * num2); weaponGlow.transform.position = val; weaponGlow.transform.localScale = Vector3.one * (0.34f + Mathf.Sin(elapsed * 24f) * 0.07f) * num * num2; ((Component)light).transform.position = val; light.intensity = num * num2 * 2.4f; elapsed += Time.deltaTime; yield return null; } Kill((Object)beam, (Object)core, (Object)sideBeams[0], (Object)sideBeams[1], (Object)sideBeams[2], (Object)weaponGlow, (Object)light); } private static IEnumerator BloodstormWeaponRoutine(Vector3 position) { //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) Transform anchor = NearestPlayerAnchor(position); Transform hand = RightHandAnchor(anchor); LineRenderer[] ribbons = (LineRenderer[])(object)new LineRenderer[4] { NewLine(43, new Color(0.88f, 0.01f, 0.015f), 0.34f), NewLine(43, BerserkerCrimson, 0.24f), NewLine(43, new Color(0.48f, 0.005f, 0.01f), 0.3f), NewLine(43, new Color(1f, 0.26f, 0.05f), 0.12f) }; GameObject[] drops = (GameObject[])(object)new GameObject[11]; for (int i = 0; i < drops.Length; i++) { drops[i] = NewOrb((i % 3 == 0) ? new Color(1f, 0.2f, 0.04f) : new Color(0.72f, 0.01f, 0.015f), 0.12f + (float)(i % 3) * 0.035f); } Light light = NewLight(position + Vector3.up, BerserkerCrimson, 8f, 0f); float duration = 1.48f; float elapsed = 0f; while (elapsed < duration) { Vector3 val = (((Object)(object)anchor != (Object)null) ? anchor.position : position) + Vector3.up * 0.92f; Vector3 val2 = (((Object)(object)anchor != (Object)null) ? anchor.right : Vector3.right); Vector3 val3 = (((Object)(object)anchor != (Object)null) ? anchor.forward : Vector3.forward); Vector3 val4 = (((Object)(object)hand != (Object)null) ? hand.position : (val + val2 * 0.45f)); float num = Mathf.Clamp01(elapsed / 0.12f); float num2 = Mathf.Clamp01((duration - elapsed) / 0.34f); float num3 = num * num2; for (int j = 0; j < ribbons.Length; j++) { LineRenderer val5 = ribbons[j]; float num4 = (float)j * (float)Math.PI * 2f / (float)ribbons.Length; for (int k = 0; k < val5.positionCount; k++) { float num5 = (float)k / (float)(val5.positionCount - 1); if (k == 0) { val5.SetPosition(k, val4); continue; } float num6 = Mathf.Lerp(0.24f, 3.6000001f, num5); float num7 = elapsed * 15.7f - num5 * (float)Math.PI * 1.45f + num4; float num8 = Mathf.Sin(num5 * (float)Math.PI * 2f + num4) * 0.24f + (0.42f - num5 * 0.54f); val5.SetPosition(k, val + val2 * (Mathf.Cos(num7) * num6) + val3 * (Mathf.Sin(num7) * num6) + Vector3.up * num8); } Color color = (Color)((j == 3) ? new Color(1f, 0.34f, 0.08f) : BerserkerCrimson); Tint(val5, color, num3 * ((j == 3) ? 0.92f : 0.76f)); } for (int l = 0; l < drops.Length; l++) { float num9 = (float)l * 2.37f; float num10 = 0.65f + (float)(l % 5) * 0.62f; float num11 = elapsed * (13f + (float)l * 0.16f) + num9; drops[l].transform.position = val + val2 * (Mathf.Cos(num11) * num10) + val3 * (Mathf.Sin(num11) * num10) + Vector3.up * (Mathf.Sin(num11 * 1.7f) * 0.34f - 0.05f); drops[l].transform.localScale = Vector3.one * (0.08f + (float)(l % 3) * 0.035f) * num3; } ((Component)light).transform.position = val; light.intensity = num3 * 1.5f; elapsed += Time.deltaTime; yield return null; } LineRenderer[] array = ribbons; foreach (LineRenderer val6 in array) { Kill((Object)val6); } GameObject[] array2 = drops; foreach (GameObject val7 in array2) { Kill((Object)val7); } Kill((Object)light); } private static IEnumerator BerserkerSlashRoutine(FxKind kind, Vector3 from, Vector3 to) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) bool flag = kind == FxKind.ExecutionersWake; Color color = (Color)(flag ? new Color(1f, 0.17f, 0.06f) : BerserkerCrimson); LineRenderer glow = NewLine(29, color, flag ? 0.48f : 0.3f); LineRenderer core = NewLine(29, BerserkerGold, flag ? 0.11f : 0.07f); Vector3 val = from + Vector3.up * 1f; Vector3 val2 = to + Vector3.up * (flag ? 0.45f : 0.75f); Vector3 val3 = val2 - val; Vector3 val4 = Vector3.Cross(Vector3.up, ((Vector3)(ref val3)).normalized); if (((Vector3)(ref val4)).sqrMagnitude < 0.01f) { val4 = Vector3.right; } Vector3 val5 = (val + val2) * 0.5f + val4 * (flag ? 3f : 1.5f) + Vector3.up * 1f; for (int i = 0; i < glow.positionCount; i++) { float num = (float)i / (float)(glow.positionCount - 1); Vector3 val6 = (1f - num) * (1f - num) * val + 2f * (1f - num) * num * val5 + num * num * val2; glow.SetPosition(i, val6); core.SetPosition(i, val6); } float elapsed = 0f; while (elapsed < 0.42f) { float num2 = Mathf.Sin(Mathf.Clamp01(elapsed / 0.42f) * (float)Math.PI); Tint(glow, color, num2 * 0.72f); Tint(core, BerserkerGold, num2); elapsed += Time.deltaTime; yield return null; } Kill((Object)glow, (Object)core); } private static IEnumerator ExecutionersWakeRoutine(Vector3 from, Vector3 to) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = to - from; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.01f) { forward = Vector3.forward; } ((Vector3)(ref forward)).Normalize(); Vector3 val = Vector3.Cross(Vector3.up, forward); Vector3 right = ((Vector3)(ref val)).normalized; LineRenderer[] wakes = (LineRenderer[])(object)new LineRenderer[3] { NewLine(47, new Color(0.58f, 0.005f, 0.01f), 0.42f), NewLine(47, BerserkerCrimson, 0.34f), NewLine(47, new Color(1f, 0.28f, 0.06f), 0.16f) }; LineRenderer core = NewLine(47, BerserkerGold, 0.075f); Light light = NewLight(from + forward * 3.4f + Vector3.up, BerserkerCrimson, 9f, 0f); float elapsed = 0f; while (elapsed < 0.62f) { float num = Mathf.Clamp01(elapsed / 0.26f); float num2 = Mathf.Sin(Mathf.Clamp01(elapsed / 0.62f) * (float)Math.PI); for (int i = 0; i < wakes.Length; i++) { float num3 = 3.1f + (float)i * 1.28f; for (int j = 0; j < 47; j++) { float num4 = Mathf.Min((float)j / 46f, num); float num5 = Mathf.Lerp(-67f, 67f, num4) * ((float)Math.PI / 180f); Vector3 val2 = forward * Mathf.Cos(num5) + right * Mathf.Sin(num5); float num6 = 0.62f + Mathf.Sin(num4 * (float)Math.PI) * (0.72f + (float)i * 0.1f); wakes[i].SetPosition(j, from + val2 * num3 + Vector3.up * num6); if (i == 1) { core.SetPosition(j, from + val2 * (num3 + 0.03f) + Vector3.up * (num6 + 0.025f)); } } Tint(wakes[i], (Color)((i == 2) ? new Color(1f, 0.28f, 0.06f) : BerserkerCrimson), num2 * (0.58f + (float)i * 0.12f)); } Tint(core, BerserkerGold, num2); light.intensity = num2 * 1.8f; elapsed += Time.deltaTime; yield return null; } Kill((Object)wakes[0], (Object)wakes[1], (Object)wakes[2], (Object)core, (Object)light); } private static IEnumerator EarthshatterExplosionRoutine(Vector3 position) { //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) Vector3 center = Effects.SurfacePoint(position) + Vector3.up * 0.07f; Color stone = new Color(0.94f, 0.16f, 0.035f); Color hotStone = new Color(1f, 0.72f, 0.16f); Effects.InstantiateLocal("fx_goblinking_meteor_hit", center, Quaternion.identity, 6f); LineRenderer shock = NewLine(81, stone, 0.52f); LineRenderer shockCore = NewLine(81, hotStone, 0.11f); GameObject flash = NewOrb(new Color(1f, 0.48f, 0.08f, 0.72f), 1f); Light light = NewLight(center + Vector3.up * 0.35f, stone, 13f, 0f); LineRenderer[] cracks = (LineRenderer[])(object)new LineRenderer[14]; Vector3[][] crackPaths = new Vector3[14][]; Random random = new Random(7319); for (int i = 0; i < 14; i++) { cracks[i] = NewLine(9, (i % 4 == 0) ? hotStone : stone, (i % 3 == 0) ? 0.16f : 0.11f); crackPaths[i] = (Vector3[])(object)new Vector3[9]; float num = (float)i * (float)Math.PI * 2f / 14f + ((float)random.NextDouble() - 0.5f) * 0.22f; float num2 = 10f * (0.58f + (float)random.NextDouble() * 0.4f); for (int j = 0; j < 9; j++) { float num3 = (float)j / 8f; float num4 = Mathf.Sin((float)j * 2.13f + (float)i) * 0.12f + ((float)random.NextDouble() - 0.5f) * 0.08f; float num5 = num + num4; Vector3 point = center + new Vector3(Mathf.Cos(num5), 0f, Mathf.Sin(num5)) * (num2 * num3); crackPaths[i][j] = Effects.SurfacePoint(point) + Vector3.up * 0.055f; cracks[i].SetPosition(j, center); } } GameObject[] shards = (GameObject[])(object)new GameObject[20]; Vector3[] velocities = (Vector3[])(object)new Vector3[20]; Vector3[] spins = (Vector3[])(object)new Vector3[20]; Vector3[] sizes = (Vector3[])(object)new Vector3[20]; for (int k = 0; k < 20; k++) { Color color = ((k % 5 == 0) ? hotStone : Color.Lerp(new Color(0.22f, 0.2f, 0.18f), stone, 0.18f + (float)random.NextDouble() * 0.24f)); shards[k] = NewOpaqueShard(color); float num6 = (float)random.NextDouble() * (float)Math.PI * 2f; float num7 = 2.2f + (float)random.NextDouble() * 5.8f; velocities[k] = new Vector3(Mathf.Cos(num6) * num7, 4.2f + (float)random.NextDouble() * 5.5f, Mathf.Sin(num6) * num7); spins[k] = new Vector3(-240f + (float)random.NextDouble() * 480f, -240f + (float)random.NextDouble() * 480f, -240f + (float)random.NextDouble() * 480f); float num8 = 0.11f + (float)random.NextDouble() * 0.24f; sizes[k] = new Vector3(num8 * (0.65f + (float)random.NextDouble()), num8, num8 * (0.65f + (float)random.NextDouble())); shards[k].transform.position = center; shards[k].transform.localScale = sizes[k]; } float elapsed = 0f; while (elapsed < 1.05f) { float num9 = Mathf.Clamp01(elapsed / 1.05f); float num10 = 1f - Mathf.Pow(1f - Mathf.Clamp01(elapsed / 0.42f), 3f); float num11 = Mathf.Lerp(0.25f, 10f, num10); SetCircle(shock, center, num11, 81); SetCircle(shockCore, center + Vector3.up * 0.025f, num11 * 0.92f, 81); float num12 = Mathf.Sin(num9 * (float)Math.PI) * (1f - num9 * 0.35f); Tint(shock, stone, num12 * 0.86f); Tint(shockCore, hotStone, num12); float num13 = Mathf.Clamp01(elapsed / 0.34f) * 8f; for (int l = 0; l < 14; l++) { int num14 = Mathf.Clamp(Mathf.FloorToInt(num13 - (float)l * 0.08f), 0, 8); Vector3 val = crackPaths[l][num14]; for (int m = 0; m < 9; m++) { cracks[l].SetPosition(m, (m <= num14) ? crackPaths[l][m] : val); } Tint(cracks[l], (l % 4 == 0) ? hotStone : stone, Mathf.Clamp01((1.05f - elapsed) / 0.38f) * 0.9f); } float num15 = Mathf.Clamp01((1.05f - elapsed) / 0.3f); for (int n = 0; n < 20; n++) { shards[n].transform.position = center + velocities[n] * elapsed + Vector3.down * (7.4f * elapsed * elapsed); shards[n].transform.rotation = Quaternion.Euler(spins[n] * elapsed); shards[n].transform.localScale = sizes[n] * num15; } flash.transform.position = center + Vector3.up * 0.12f; flash.transform.localScale = new Vector3(1f + num10 * 5.5f, 0.12f + (1f - num10) * 0.65f, 1f + num10 * 5.5f) * Mathf.Clamp01((1.05f - elapsed) / 0.52f); light.intensity = Mathf.Clamp01((1.05f - elapsed) / 0.45f) * 2.8f; elapsed += Time.deltaTime; yield return null; } LineRenderer[] array = cracks; foreach (LineRenderer val2 in array) { Kill((Object)val2); } GameObject[] array2 = shards; foreach (GameObject val3 in array2) { Kill((Object)val3); } Kill((Object)shock, (Object)shockCore, (Object)flash, (Object)light); } private static IEnumerator EarthshatterDiveRoutine(Vector3 position, Vector3 target) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform anchor = NearestPlayerAnchor(position, 7f); if ((Object)(object)anchor == (Object)null) { yield break; } Vector3 landing = Effects.SurfacePoint(target) + Vector3.up * 0.08f; LineRenderer outerTrail = NewLine(28, BerserkerCrimson, 0.68f); LineRenderer innerTrail = NewLine(28, BerserkerGold, 0.2f); LineRenderer targetRing = NewLine(49, BerserkerCrimson, 0.2f); LineRenderer targetCore = NewLine(49, BerserkerGold, 0.07f); SetCircle(targetRing, landing, 2.2f, 49); SetCircle(targetCore, landing + Vector3.up * 0.025f, 1.55f, 49); GameObject meteorCore = NewOrb(new Color(1f, 0.34f, 0.04f, 0.78f), 1.25f); Light light = NewLight(anchor.position + Vector3.up, BerserkerCrimson, 12f, 3.2f); GameObject[] embers = (GameObject[])(object)new GameObject[10]; for (int i = 0; i < 10; i++) { embers[i] = NewOrb((i % 3 == 0) ? BerserkerGold : BerserkerCrimson, 0.08f + (float)(i % 4) * 0.025f); } float elapsed = 0f; Vector3 val2 = default(Vector3); while (elapsed < 2.2f && (Object)(object)anchor != (Object)null) { Vector3 val = anchor.position + Vector3.up * 0.92f; float num = Mathf.Clamp01(elapsed / 0.08f); float num2 = 0.9f + Mathf.Sin(elapsed * 22f) * 0.1f; for (int j = 0; j < 28; j++) { float num3 = (float)j / 27f; float num4 = elapsed * 11f + num3 * (float)Math.PI * 5f; float num5 = Mathf.Sin(num3 * (float)Math.PI) * 0.2f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num4) * num5, num3 * 6.5f, Mathf.Sin(num4) * num5); outerTrail.SetPosition(j, val + val2); innerTrail.SetPosition(j, val + val2 * 0.72f); } Tint(outerTrail, BerserkerCrimson, num * (0.72f + num2 * 0.2f)); Tint(innerTrail, BerserkerGold, num); Tint(targetRing, BerserkerCrimson, num * (0.58f + num2 * 0.2f)); Tint(targetCore, BerserkerGold, num * 0.92f); meteorCore.transform.position = val; meteorCore.transform.localScale = Vector3.one * (1.15f * num2); ((Component)light).transform.position = val; light.intensity = num * (2.6f + num2); for (int k = 0; k < 10; k++) { float num6 = Mathf.Repeat(elapsed * (1.8f + (float)k * 0.07f) + (float)k * 0.17f, 1f); float num7 = (float)k * 2.399f + elapsed * ((k % 2 == 0) ? 5f : (-4f)); float num8 = 0.18f + num6 * 0.58f; embers[k].transform.position = val + new Vector3(Mathf.Cos(num7) * num8, num6 * 3.6f, Mathf.Sin(num7) * num8); embers[k].transform.localScale = Vector3.one * (0.05f + (1f - num6) * 0.16f) * num; } if (Vector3.Distance(anchor.position, landing) < 1.1f && elapsed > 0.08f) { break; } elapsed += Time.deltaTime; yield return null; } GameObject[] array = embers; foreach (GameObject val3 in array) { Kill((Object)val3); } Kill((Object)outerTrail, (Object)innerTrail, (Object)targetRing, (Object)targetCore, (Object)meteorCore, (Object)light); } private static IEnumerator BerserkerPulseRoutine(FxKind kind, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Color color = (Color)(kind switch { FxKind.Earthshatter => new Color(0.65f, 0.82f, 0.92f), FxKind.WarbandsOath => BerserkerGold, _ => BerserkerCrimson, }); float radius = kind switch { FxKind.WarbandsOath => 15f, FxKind.Earthshatter => 10f, FxKind.WarCry => 8f, _ => 3.2f, }; float duration = ((kind == FxKind.WarbandsOath) ? 1.25f : 0.85f); if (kind == FxKind.WarCry || kind == FxKind.WarbandsOath) { Effects.InstantiateLocal("fx_GP_Activation", position, Quaternion.identity, 3f); } LineRenderer outer = NewLine(73, color, 0.25f); LineRenderer inner = NewLine(73, BerserkerGold, 0.07f); Light light = NewLight(position + Vector3.up * 0.4f, color, Mathf.Min(radius, 9f), 0f); float elapsed = 0f; while (elapsed < duration) { float num = Mathf.Clamp01(elapsed / duration); float num2 = 1f - (1f - num) * (1f - num); Vector3 val = Effects.SurfacePoint(position) + Vector3.up * 0.08f; SetCircle(outer, val, Mathf.Lerp(0.35f, radius, num2), 73); SetCircle(inner, val + Vector3.up * 0.025f, Mathf.Lerp(0.22f, radius * 0.82f, num2), 73); float num3 = Mathf.Sin(num * (float)Math.PI); Tint(outer, color, num3 * 0.76f); Tint(inner, BerserkerGold, num3 * 0.86f); light.intensity = num3 * 1.1f; elapsed += Time.deltaTime; yield return null; } Kill((Object)outer, (Object)inner, (Object)light); } private static IEnumerator BerserkerAuraRoutine(FxKind kind, Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) bool rage = kind == FxKind.RageUnbound; float duration = (rage ? 12f : 12f); Transform anchor = NearestPlayerAnchor(position); if (rage) { Effects.InstantiateLocal("fx_GP_Activation", position, Quaternion.identity, 3f); } LineRenderer[] rings = (LineRenderer[])(object)new LineRenderer[3] { NewLine(49, BerserkerCrimson, rage ? 0.18f : 0.13f), NewLine(49, BerserkerGold, rage ? 0.07f : 0.09f), NewLine(49, new Color(1f, 0.25f, 0.06f), rage ? 0.12f : 0.08f) }; Light light = NewLight(position + Vector3.up, BerserkerCrimson, 7f, 0f); float elapsed = 0f; while (elapsed < duration) { Vector3 val = (((Object)(object)anchor != (Object)null) ? anchor.position : position) + Vector3.up * 0.9f; float num = Mathf.Clamp01(elapsed / 0.2f); float num2 = Mathf.Clamp01((duration - elapsed) / 0.55f); float num3 = num * num2; for (int i = 0; i < rings.Length; i++) { float num4 = (rage ? 1.15f : 0.92f) + (float)i * (rage ? 0.24f : 0.2f); float num5 = (float)(i - 1) * (rage ? 0.48f : 0.58f); for (int j = 0; j < 49; j++) { float num6 = (float)j * (float)Math.PI * 2f / 48f + elapsed * (rage ? 2.1f : 1.15f) * ((i % 2 == 0) ? 1f : (-1f)); float num7 = Mathf.Sin(num6 * 3f + elapsed * 7f) * (rage ? 0.1f : 0.07f); rings[i].SetPosition(j, val + new Vector3(Mathf.Cos(num6) * (num4 + num7), num5, Mathf.Sin(num6) * (num4 + num7))); } Tint(rings[i], (i == 1) ? BerserkerGold : BerserkerCrimson, num3 * (rage ? 0.48f : 0.58f)); } ((Component)light).transform.position = val; light.intensity = num3 * (rage ? 0.82f : 0.62f); elapsed += Time.deltaTime; yield return null; } Kill((Object)rings[0], (Object)rings[1], (Object)rings[2], (Object)light); } public static float BoltTravelTime(Vector3 from, Vector3 to) { //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) return Mathf.Clamp(Vector3.Distance(from, to) / 48f, 0.08f, 0.95f); } private static bool PlayAuthoredFireball(Vector3 from, Vector3 to) { //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_0008: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) float num = BoltTravelTime(from, to); Vector3 val = to - from; Quaternion rotation = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) : Quaternion.identity); GameObject val2 = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/emberbolt/norns_vfx_fireball.prefab", from, rotation, num + 1.1f); if ((Object)(object)val2 == (Object)null) { return false; } FireballVfxController component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val2); Plugin.Log.LogError((object)"Prefab Fireball privo di FireballVfxController; uso fallback."); return false; } component.Initialize(from, to, num); return true; } private static IEnumerator BoltRoutine(Vector3 from, Vector3 to) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject core = NewOrb(EmberCore, 0.3f); GameObject body = NewOrb(Ember, 0.62f); GameObject halo = NewOrb(new Color(0.85f, 0.22f, 0.05f, 0.5f), 1.05f); TrailRenderer obj = core.AddComponent(); ((Renderer)obj).material = Additive(); obj.time = 0.35f; obj.startWidth = 0.62f; obj.endWidth = 0f; obj.startColor = Ember; obj.endColor = new Color(0.7f, 0.12f, 0f, 0f); ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; Light light = NewLight(from, Ember, 11f, 3f); float duration = BoltTravelTime(from, to); float elapsed = 0f; while (elapsed < duration) { float num = elapsed / duration; Vector3 position = Vector3.Lerp(from, to, num); core.transform.position = position; body.transform.position = position; halo.transform.position = position; ((Component)light).transform.position = position; float num2 = 1f + 0.14f * Mathf.Sin(Time.time * 47f); body.transform.localScale = Vector3.one * 0.62f * num2; halo.transform.localScale = Vector3.one * 1.05f * (2f - num2); elapsed += Time.deltaTime; yield return null; } Object.Destroy((Object)(object)core); Object.Destroy((Object)(object)body); Object.Destroy((Object)(object)halo); Effects.InstantiateLocal("fx_fireball_staff_explosion", to, Quaternion.identity); SpellAudio.PlayFireballImpact(to); yield return Explosion(to, light, Ember, EmberCore, 0.9f, 4.2f, 0.34f, 10); Kill((Object)light); } private unsafe static IEnumerator Explosion(Vector3 center, Light light, Color color, Color coreColor, float fromSize, float toSize, float duration, int shardCount) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) GameObject burst = NewOrb(coreColor, fromSize); burst.transform.position = center; if ((Object)(object)light != (Object)null) { ((Component)light).transform.position = center; } GameObject[] shards = (GameObject[])(object)new GameObject[shardCount]; Vector3[] directions = (Vector3[])(object)new Vector3[shardCount]; Vector3[] spins = (Vector3[])(object)new Vector3[shardCount]; Random random = new Random(((object)(*(Vector3*)(¢er))/*cast due to .constrained prefix*/).GetHashCode()); for (int i = 0; i < shardCount; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = val.GetComponent(); ((Renderer)component2).material = new Material(Additive()) { hideFlags = (HideFlags)61 }; ((Renderer)component2).material.color = coreColor; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; val.transform.position = center; val.transform.localScale = new Vector3(0.1f, 0.1f, 0.45f); float num = (float)random.NextDouble() * (float)Math.PI * 2f; float num2 = 0.15f + (float)random.NextDouble() * 0.75f; int num3 = i; Vector3 val2 = new Vector3(Mathf.Cos(num), num2, Mathf.Sin(num)); directions[num3] = ((Vector3)(ref val2)).normalized * (0.6f + (float)random.NextDouble() * 0.55f); spins[i] = new Vector3((float)random.Next(-360, 360), (float)random.Next(-360, 360), (float)random.Next(-360, 360)); shards[i] = val; } float elapsed = 0f; while (elapsed < duration) { float num4 = elapsed / duration; float num5 = 1f - (1f - num4) * (1f - num4); burst.transform.localScale = Vector3.one * Mathf.Lerp(fromSize, toSize, num5); Color color2 = Color.Lerp(coreColor, color, num4); color2.a = 1f - num4; ((Renderer)burst.GetComponent()).material.color = color2; for (int j = 0; j < shards.Length; j++) { if (!((Object)(object)shards[j] == (Object)null)) { float num6 = num5 * toSize * 1.35f; Vector3 val3 = directions[j] * num6; val3.y -= 3.2f * num4 * num4; shards[j].transform.position = center + val3; shards[j].transform.rotation = Quaternion.Euler(spins[j] * num4); Color color3 = coreColor; color3.a = 1f - num4; ((Renderer)shards[j].GetComponent()).material.color = color3; } } if ((Object)(object)light != (Object)null) { light.intensity = Mathf.Lerp(6f, 0f, num4); } elapsed += Time.deltaTime; yield return null; } GameObject[] array = shards; foreach (GameObject val4 in array) { Kill((Object)val4); } Kill((Object)burst); } private static bool PlayAuthoredFrostNova(Vector3 center) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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) center = Effects.SurfacePoint(center) + Vector3.up * 0.08f; if ((Object)(object)VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/frostnova/norns_vfx_frostnova.prefab", center, Quaternion.identity, 3.1f) == (Object)null) { return false; } return true; } private static IEnumerator NovaRoutine(Vector3 center) { //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) center.y += 0.15f; Effects.InstantiateLocal("fx_fenring_icenova", center, Quaternion.identity, 6f); Effects.InstantiateLocal("fx_DvergerMage_Nova_ring", center, Quaternion.identity); Effects.InstantiateLocal("fx_DvergerMage_Ice_hit", center + Vector3.up * 0.65f, Quaternion.identity); Light light = NewLight(center, Frost, 14f, 3.2f); float elapsed = 0f; while (elapsed < 0.58f) { float num = elapsed / 0.58f; light.intensity = Mathf.Lerp(4.2f, 0f, num * num); elapsed += Time.deltaTime; yield return null; } Kill((Object)light); } private static bool PlayAuthoredArcLightning(Vector3 from, Vector3 to) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/arclightning/norns_vfx_arclightning.prefab", from, Quaternion.identity, 1.35f); if ((Object)(object)val == (Object)null) { return false; } ArcLightningVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); return false; } component.Initialize(from, to, 0f, 0); return true; } private static void PlayArcLightningCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/arclightning/norns_vfx_arclightning_cast.prefab", castOrigin, Quaternion.identity, 1.2f); if (!((Object)(object)val == (Object)null) && (Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); } } private unsafe static IEnumerator ArcRoutine(Vector3 from, Vector3 to) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Effects.InstantiateLocal("fx_chainlightning_hit", to, Quaternion.identity, 4f); LineRenderer arc = NewLine(14, Storm, 0.16f); LineRenderer glow = NewLine(14, Storm, 0.42f); Light light = NewLight(to, Storm, 10f, 2.6f); float elapsed = 0f; Random random = new Random(((object)(*(Vector3*)(&from))/*cast due to .constrained prefix*/).GetHashCode() ^ ((object)(*(Vector3*)(&to))/*cast due to .constrained prefix*/).GetHashCode()); while (elapsed < 0.26f) { Jitter(arc, glow, from, to, random); float num = elapsed / 0.26f; Tint(arc, Color.white, 1f - num); Tint(glow, Storm, (1f - num) * 0.55f); light.intensity = Mathf.Lerp(2.6f, 0f, num); elapsed += Time.deltaTime; yield return null; } Kill((Object)arc, (Object)glow, (Object)light); } private static void Jitter(LineRenderer arc, LineRenderer glow, Vector3 from, Vector3 to, Random random) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00fa: Unknown result type (might be due to invalid IL or missing references) Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude < 0.01f)) { val /= magnitude; Vector3 val2 = Vector3.Cross(val, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.right; } Vector3 val4 = Vector3.Cross(val3, val); float num = Mathf.Clamp(magnitude * 0.09f, 0.15f, 1.3f); for (int i = 0; i < 14; i++) { float num2 = (float)i / 13f; Vector3 val5 = Vector3.Lerp(from, to, num2); float num3 = Mathf.Sin(num2 * (float)Math.PI); float num4 = ((float)random.NextDouble() - 0.5f) * 2f * num * num3; float num5 = ((float)random.NextDouble() - 0.5f) * 2f * num * num3; val5 += val3 * num4 + val4 * num5; arc.SetPosition(i, val5); glow.SetPosition(i, val5); } } } private static bool PlayAuthoredRunicWard(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_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) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/runicward/norns_vfx_runicward.prefab", position + Vector3.up, Quaternion.identity, 21.5f); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); return false; } Effects.InstantiateLocal("fx_shield_start", position, Quaternion.identity); return true; } private static bool PlayAuthoredDreadVeil(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/dreadveil/norns_vfx_dreadveil.prefab", position + Vector3.up * 0.96f, Quaternion.identity, 13.5f); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)val.GetComponent() != (Object)null) { return true; } Kill((Object)val); return false; } private static void PlayDreadVeilCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/dreadveil/norns_vfx_dreadveil_cast.prefab", casterPosition + Vector3.up * 0.95f, Quaternion.identity, 3.1f); if (!((Object)(object)val == (Object)null) && (Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); } } private static GameObject NewWardShell(string name, Vector3 scale, Texture texture, Color color) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)obj).name = name; Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = obj.GetComponent(); ((Renderer)component2).material = new Material(Additive()) { hideFlags = (HideFlags)61 }; if ((Object)(object)texture != (Object)null) { ((Renderer)component2).material.mainTexture = texture; } ((Renderer)component2).material.color = color; ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; obj.transform.localScale = scale; return obj; } private static void WardShellColor(GameObject shell, Color color, float alpha) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) MeshRenderer val = (((Object)(object)shell != (Object)null) ? shell.GetComponent() : null); if (!((Object)(object)val == (Object)null)) { color.a = alpha; ((Renderer)val).material.color = color; } } private static void SetWardArc(LineRenderer line, Vector3 center, Vector3 right, Vector3 up, float radius, float startDegrees, float sweepDegrees, float time, float phase) { //IL_006b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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) int positionCount = line.positionCount; for (int i = 0; i < positionCount; i++) { float num = (float)i / (float)(positionCount - 1); float num2 = (startDegrees + sweepDegrees * num) * ((float)Math.PI / 180f); float num3 = 1f + Mathf.Sin(num2 * 5f + time * 2.1f + phase) * 0.01f + Mathf.Sin(num2 * 11f - time * 1.3f + phase) * 0.006f; line.SetPosition(i, center + (right * Mathf.Cos(num2) + up * Mathf.Sin(num2)) * radius * num3); } } private static GameObject NewWardMote(Color color, float diameter, bool trail) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) GameObject val = NewOrb(color, diameter); ((Object)val).name = "norns_ward_mote"; if (!trail) { return val; } TrailRenderer obj = val.AddComponent(); ((Renderer)obj).material = new Material(Additive()) { hideFlags = (HideFlags)61 }; obj.time = 0.42f; obj.startWidth = diameter * 0.72f; obj.endWidth = 0f; obj.startColor = color; Color endColor = color; endColor.a = 0f; obj.endColor = endColor; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return val; } private static GameObject NewWardCrystal(Color color, float height, float width) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_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_010d: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("norns_ward_crystal"); Mesh val2 = new Mesh { name = "norns_ward_crystal_mesh", hideFlags = (HideFlags)61 }; float num = height * 0.18f; val2.vertices = (Vector3[])(object)new Vector3[6] { new Vector3(0f, height * 0.55f, 0f), new Vector3(0f, (0f - height) * 0.45f, 0f), new Vector3(width, 0f - num, 0f), new Vector3(0f, 0f - num, width), new Vector3(0f - width, 0f - num, 0f), new Vector3(0f, 0f - num, 0f - width) }; val2.triangles = new int[24] { 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 2, 1, 3, 2, 1, 4, 3, 1, 5, 4, 1, 2, 5 }; val2.RecalculateNormals(); val.AddComponent().sharedMesh = val2; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).material = new Material(Additive()) { hideFlags = (HideFlags)61 }; ((Renderer)obj).material.color = color; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return val; } private static IEnumerator WardRoutine(Vector3 position) { //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) Effects.InstantiateLocal("fx_shield_start", position, Quaternion.identity); Transform anchor = null; float num = 16f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, position); if (!(num2 >= num)) { num = num2; anchor = ((Component)allPlayer).transform; } } } float diameter = 7.6f; if ((Object)(object)_wardRuneSheet == (Object)null) { _wardRuneSheet = ClassArt.RuneSheet(1024, 512, Color.white, 15, 8147); } GameObject membrane = NewWardShell("norns_ward_membrane", Vector3.one * (diameter * 0.97f), null, new Color(0.38f, 0.88f, 1f, 0f)); GameObject runeShell = NewWardShell("norns_ward_runes", Vector3.one * diameter, (Texture)(object)_wardRuneSheet, new Color(0.75f, 0.92f, 1f, 0f)); LineRenderer rimGlow = NewLine(97, new Color(0.45f, 0.92f, 1f, 0f), 0.28f); LineRenderer rimCore = NewLine(97, new Color(1f, 0.97f, 0.88f, 0f), 0.065f); LineRenderer cyanArc = NewLine(31, new Color(0.25f, 0.95f, 1f, 0f), 0.16f); LineRenderer violetArc = NewLine(29, new Color(0.95f, 0.34f, 1f, 0f), 0.2f); LineRenderer emberArc = NewLine(25, new Color(1f, 0.47f, 0.16f, 0f), 0.14f); GameObject[] motes = (GameObject[])(object)new GameObject[14]; Vector3[] moteSeed = (Vector3[])(object)new Vector3[14]; float[] moteSize = new float[14]; Random random = new Random(5149); for (int i = 0; i < 14; i++) { Color color = ((i % 3 == 0) ? new Color(1f, 0.45f, 0.95f, 0.48f) : ((i % 3 == 1) ? new Color(0.32f, 0.95f, 1f, 0.52f) : new Color(1f, 0.72f, 0.28f, 0.42f))); moteSize[i] = 0.045f + (float)random.NextDouble() * 0.075f; motes[i] = NewWardMote(color, moteSize[i], i < 6); moteSeed[i] = new Vector3((float)random.NextDouble() * (float)Math.PI * 2f, (float)random.NextDouble() * 3.8f, 0.45f + (float)random.NextDouble() * 1.55f); } GameObject[] crystals = (GameObject[])(object)new GameObject[4]; Vector3[] crystalOffsets = (Vector3[])(object)new Vector3[4] { new Vector3(-1.72f, -1.92f, 0.18f), new Vector3(-1.34f, -1.76f, -0.48f), new Vector3(1.66f, -1.9f, 0.12f), new Vector3(1.25f, -1.7f, -0.55f) }; for (int j = 0; j < crystals.Length; j++) { Color color2 = ((j % 2 == 0) ? new Color(0.48f, 0.92f, 1f, 0.24f) : new Color(0.88f, 0.55f, 1f, 0.2f)); crystals[j] = NewWardCrystal(color2, 0.72f + (float)j * 0.09f, 0.2f + (float)j * 0.015f); crystals[j].transform.rotation = Quaternion.Euler((j % 2 == 0) ? (-9f) : 11f, (float)j * 57f, (j % 2 == 0) ? 13f : (-15f)); } Light light = NewLight(position, new Color(0.55f, 0.78f, 1f), 8f, 0.9f); float duration = 20f; float elapsed = 0f; while (elapsed < duration) { Vector3 val = (((Object)(object)anchor != (Object)null) ? anchor.position : position) + Vector3.up * 1f; float num3 = Mathf.Clamp01(elapsed / 0.3f); float num4 = Mathf.Clamp01((duration - elapsed) / 0.8f); float num5 = 0.92f + 0.08f * Mathf.Sin(elapsed * 1.8f); float num6 = num3 * num4 * num5; membrane.transform.position = val; runeShell.transform.position = val; runeShell.transform.rotation = Quaternion.Euler(0f, elapsed * 1.15f, 0f); float num7 = Mathf.SmoothStep(0.86f, 1f, num3); membrane.transform.localScale = Vector3.one * diameter * 0.97f * num7; runeShell.transform.localScale = Vector3.one * diameter * num7; WardShellColor(membrane, new Color(0.4f, 0.82f, 1f), num6 * 0.028f); WardShellColor(runeShell, Color.Lerp(new Color(0.58f, 0.92f, 1f), Rune, 0.18f), num6 * 0.15f); Camera main = Camera.main; Vector3 right = (((Object)(object)main != (Object)null) ? ((Component)main).transform.right : Vector3.right); Vector3 up = (((Object)(object)main != (Object)null) ? ((Component)main).transform.up : Vector3.up); float num8 = diameter * 0.5f * num7; SetWardArc(rimGlow, val, right, up, num8, 0f, 360f, elapsed, 0.3f); SetWardArc(rimCore, val, right, up, num8, 0f, 360f, elapsed, 1.7f); SetWardArc(cyanArc, val, right, up, num8 * 1.005f, -18f, 105f, elapsed, 2.4f); SetWardArc(violetArc, val, right, up, num8 * 1.009f, 78f, 92f, elapsed, 4.1f); SetWardArc(emberArc, val, right, up, num8 * 1.004f, 192f, 76f, elapsed, 5.8f); Tint(rimGlow, new Color(0.42f, 0.9f, 1f), num6 * 0.24f); Tint(rimCore, new Color(1f, 0.97f, 0.88f), num6 * (0.72f + Mathf.Sin(elapsed * 4.3f) * 0.08f)); Tint(cyanArc, new Color(0.22f, 0.95f, 1f), num6 * 0.55f); Tint(violetArc, new Color(0.96f, 0.34f, 1f), num6 * 0.48f); Tint(emberArc, new Color(1f, 0.47f, 0.15f), num6 * 0.4f); for (int k = 0; k < motes.Length; k++) { float num9 = -1.75f + Mathf.Repeat(moteSeed[k].y + elapsed * (0.18f + (float)k * 0.006f), 3.5f); float num10 = Mathf.Sqrt(Mathf.Clamp01(1f - num9 * num9 / 6.8f)); float num11 = moteSeed[k].x + elapsed * (0.18f + (float)k * 0.009f); float num12 = moteSeed[k].z * num10; motes[k].transform.position = val + new Vector3(Mathf.Cos(num11) * num12, num9, Mathf.Sin(num11) * num12); float num13 = (0.82f + Mathf.Sin(elapsed * (3.8f + (float)k * 0.13f) + (float)k) * 0.18f) * num7; motes[k].transform.localScale = Vector3.one * moteSize[k] * num13; } for (int l = 0; l < crystals.Length; l++) { crystals[l].transform.position = val + crystalOffsets[l] * num7; crystals[l].transform.Rotate(Vector3.up, Time.deltaTime * ((l % 2 == 0) ? 5f : (-4f)), (Space)0); } ((Component)light).transform.position = val; light.color = Color.Lerp(new Color(0.42f, 0.88f, 1f), new Color(0.9f, 0.52f, 1f), 0.5f + Mathf.Sin(elapsed * 0.72f) * 0.5f); light.intensity = num6 * 0.82f; elapsed += Time.deltaTime; yield return null; } Kill((Object)membrane, (Object)runeShell, (Object)rimGlow, (Object)rimCore, (Object)cyanArc, (Object)violetArc, (Object)emberArc, (Object)light); GameObject[] array = motes; foreach (GameObject val2 in array) { Kill((Object)val2); } array = crystals; foreach (GameObject val3 in array) { Kill((Object)val3); } } private static IEnumerator LevelUpRoutine(Vector3 feet) { //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) Effects.InstantiateLocal("fx_GP_Activation", feet, Quaternion.identity); LineRenderer[] rings = (LineRenderer[])(object)new LineRenderer[3]; for (int i = 0; i < rings.Length; i++) { rings[i] = NewLine(48, Rune, 0.09f); } Light light = NewLight(feet + Vector3.up, Rune, 10f, 2.4f); float elapsed = 0f; while (elapsed < 1.3f) { float num = elapsed / 1.3f; for (int j = 0; j < rings.Length; j++) { float num2 = (float)j * 0.22f; float num3 = Mathf.Clamp01((num - num2) / (1f - num2)); float num4 = Mathf.Lerp(0.05f, 2.6f, num3); float radius = Mathf.Lerp(1.25f, 0.35f, num3); SetCircle(rings[j], feet + Vector3.up * num4, radius, 48); Tint(rings[j], Rune, (num3 <= 0f) ? 0f : (1f - num3)); } light.intensity = Mathf.Lerp(2.4f, 0f, num); elapsed += Time.deltaTime; yield return null; } LineRenderer[] array = rings; foreach (LineRenderer val in array) { Kill((Object)val); } Kill((Object)light); } private static void PlayFireRainCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_cast.prefab", castOrigin, Quaternion.identity, 2.9f); if (!((Object)(object)val == (Object)null) && (Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); } } private static bool PlayAuthoredFireRainStart(Vector3 center) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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) center = Effects.SurfacePoint(center) + Vector3.up * 0.06f; GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_storm.prefab", center, Quaternion.identity, 6.83f); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)val.GetComponent() != (Object)null) { return true; } Kill((Object)val); return false; } private static bool PlayAuthoredFireRainBolt(Vector3 ground, Vector3 sky) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_bolt.prefab", sky, Quaternion.identity, 1.62f); if ((Object)(object)val == (Object)null) { return false; } FallOfRagnarokBoltVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); return false; } component.Initialize(sky, ground, 0.62f); return true; } private static bool PlayAuthoredFireRainImpact(Vector3 center) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: 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) center = Effects.SurfacePoint(center) + Vector3.up * 0.08f; GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_impact.prefab", center, Quaternion.identity, 2.7f); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); return false; } Effects.InstantiateLocal("fx_fireball_staff_explosion", center, Quaternion.identity, 4f); return true; } private static IEnumerator FireRainStartRoutine(Vector3 center) { //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) center.y += 0.12f; Effects.InstantiateLocal("fx_Fader_Fissure_Prespawn", center, Quaternion.identity, 6.1299996f); LineRenderer outer = NewLine(72, Ember, 0.2f); LineRenderer inner = NewLine(56, EmberCore, 0.08f); SetCircle(outer, center, 10f, 72); SetCircle(inner, center, 7.2000003f, 56); GameObject[] embers = (GameObject[])(object)new GameObject[12]; Vector3[] seeds = (Vector3[])(object)new Vector3[12]; Random random = new Random(9031); for (int i = 0; i < 12; i++) { embers[i] = NewOrb((i % 3 == 0) ? EmberCore : Ember, 0.09f + (float)(i % 4) * 0.025f); seeds[i] = new Vector3((float)random.NextDouble() * (float)Math.PI * 2f, (float)random.NextDouble(), 1.5f + (float)random.NextDouble() * 8f); } Light light = NewLight(center + Vector3.up * 2f, Ember, 24f, 1.5f); float elapsed = 0f; while (elapsed < 5.1299996f) { float num = Mathf.Clamp01(elapsed / 0.28f); float num2 = Mathf.Clamp01((5.1299996f - elapsed) / 0.55f); float num3 = num * num2; float num4 = 0.76f + Mathf.Sin(elapsed * 4.5f) * 0.18f; Tint(outer, Ember, num3 * num4); Tint(inner, EmberCore, num3 * (0.25f + Mathf.Sin(elapsed * 2.9f) * 0.1f)); for (int j = 0; j < embers.Length; j++) { float num5 = Mathf.Repeat(seeds[j].y + elapsed * (0.34f + (float)j * 0.009f), 1f); float num6 = seeds[j].x + elapsed * (0.16f + (float)j * 0.006f); embers[j].transform.position = center + new Vector3(Mathf.Cos(num6), 0f, Mathf.Sin(num6)) * seeds[j].z + Vector3.up * (0.08f + num5 * 4.2f); embers[j].transform.localScale = Vector3.one * (0.07f + (1f - num5) * 0.1f) * num3; } light.intensity = num3 * (1.1f + Mathf.Sin(elapsed * 5.2f) * 0.35f); elapsed += Time.deltaTime; yield return null; } GameObject[] array = embers; foreach (GameObject val in array) { Kill((Object)val); } Kill((Object)outer, (Object)inner, (Object)light); } private static IEnumerator FireRainBoltRoutine(Vector3 ground, Vector3 sky) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject core = NewOrb(EmberCore, 0.22f); GameObject body = NewOrb(Ember, 0.52f); GameObject glow = NewOrb(new Color(1f, 0.26f, 0.04f, 0.42f), 1.05f); TrailRenderer obj = body.AddComponent(); ((Renderer)obj).material = Additive(); obj.time = 0.52f; obj.startWidth = 0.86f; obj.endWidth = 0f; obj.startColor = EmberCore; obj.endColor = new Color(0.7f, 0.08f, 0f, 0f); ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; LineRenderer marker = NewLine(40, Ember, 0.1f); SetCircle(marker, ground + Vector3.up * 0.1f, 3.2f, 40); Light light = NewLight(sky, Ember, 9f, 2.3f); float elapsed = 0f; while (elapsed < 0.62f) { float num = elapsed / 0.62f; float num2 = num * num; Vector3 position = Vector3.Lerp(sky, ground + Vector3.up * 0.16f, num2); core.transform.position = position; body.transform.position = position; glow.transform.position = position; ((Component)light).transform.position = position; float num3 = 1f + Mathf.Sin(Time.time * 43f + sky.x) * 0.13f; body.transform.localScale = Vector3.one * 0.52f * num3; glow.transform.localScale = Vector3.one * 1.05f * (2f - num3); Tint(marker, Ember, 0.1f + num * 0.48f); elapsed += Time.deltaTime; yield return null; } Kill((Object)core, (Object)body, (Object)glow, (Object)marker, (Object)light); } private static IEnumerator FireRainImpactRoutine(Vector3 center) { //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) center.y += 0.15f; Effects.InstantiateLocal("fx_fireball_staff_explosion", center, Quaternion.identity, 4f); LineRenderer shock = NewLine(44, Ember, 0.28f); LineRenderer rim = NewLine(44, EmberCore, 0.11f); GameObject flash = NewOrb(EmberCore, 0.75f); flash.transform.position = center + Vector3.up * 0.2f; Light light = NewLight(center, Ember, 11f, 3.2f); ((MonoBehaviour)Plugin.Instance).StartCoroutine(Explosion(center + Vector3.up * 0.35f, null, Ember, EmberCore, 0.3f, 2.35f, 0.46f, 8)); float elapsed = 0f; while (elapsed < 0.38f) { float num = elapsed / 0.38f; float num2 = 1f - (1f - num) * (1f - num); SetCircle(shock, center, Mathf.Lerp(0.35f, 3.2f, num2), 44); SetCircle(rim, center, Mathf.Lerp(0.22f, 2.496f, num2), 44); Tint(shock, Ember, (1f - num) * 0.78f); Tint(rim, EmberCore, (1f - num) * 0.84f); flash.transform.localScale = Vector3.one * Mathf.Lerp(0.75f, 2.3f, num2); Color emberCore = EmberCore; emberCore.a = 1f - num2; ((Renderer)flash.GetComponent()).material.color = emberCore; light.intensity = Mathf.Lerp(3.2f, 0f, num); elapsed += Time.deltaTime; yield return null; } Kill((Object)shock, (Object)rim, (Object)flash, (Object)light); } private static void PlayFireballCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/emberbolt/norns_vfx_fireball_cast.prefab", castOrigin, Quaternion.identity, 1.45f); if (!((Object)(object)val == (Object)null)) { val.transform.position = castOrigin; } } private static bool PlayAuthoredBlackHole(Vector3 center) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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) center = Effects.SurfacePoint(center) + Vector3.up * 0.06f; GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/blackhole/norns_vfx_blackhole.prefab", center, Quaternion.identity, 7.5f); if ((Object)(object)val == (Object)null) { return false; } BlackHoleVfxController component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.ActiveDuration = 6f; component.ResidualDuration = 1.2f; } return true; } private static void PlayBlackHoleCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/blackhole/norns_vfx_blackhole_cast.prefab", castOrigin, Quaternion.identity, 2.1f); if (!((Object)(object)val == (Object)null)) { val.transform.position = castOrigin; } } private static bool PlayAuthoredBloodHarvest(Vector3 center) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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) center = Effects.SurfacePoint(center) + Vector3.up * 0.045f; GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/bloodharvest/norns_vfx_bloodharvest.prefab", center, Quaternion.identity, 4.15f); if ((Object)(object)val == (Object)null) { return false; } BloodHarvestVfxController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Kill((Object)val); return false; } component.Radius = 8f; component.PulseCount = 5; component.PulseInterval = 0.68f; return true; } private static void PlayBloodHarvestCharge(Vector3 casterPosition, Vector3 castOrigin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = VfxAssets.InstantiateLocal("assets/mod/vfx/abilities/bloodharvest/norns_vfx_bloodharvest_cast.prefab", castOrigin, Quaternion.identity, 1.65f); if (!((Object)(object)val == (Object)null) && (Object)(object)val.GetComponent() == (Object)null) { Kill((Object)val); } } private static IEnumerator BlackHoleRoutine(Vector3 center) { //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) center = Effects.SurfacePoint(center) + Vector3.up * 0.06f; GameObject field = NewOpaqueOrb(new Color(0.002f, 0.004f, 0.009f, 1f), 0.2f); ((Object)field).name = "norns_gravity_field"; GameObject well = NewOpaqueOrb(new Color(0.001f, 0.001f, 0.003f, 1f), 0.2f); ((Object)well).name = "norns_suspended_singularity"; LineRenderer rim = NewLine(97, new Color(0.72f, 0.24f, 1f), 0.12f); LineRenderer[] spirals = (LineRenderer[])(object)new LineRenderer[5]; for (int i = 0; i < spirals.Length; i++) { spirals[i] = NewLine(97, (i % 2 == 0) ? new Color(0.68f, 0.2f, 1f) : new Color(0.3f, 0.06f, 0.72f), 0.06f); spirals[i].endWidth = 0.22f; } GameObject[] motes = (GameObject[])(object)new GameObject[15]; Vector3[] seeds = (Vector3[])(object)new Vector3[15]; Random random = new Random(7731); for (int j = 0; j < 15; j++) { motes[j] = NewOrb((j % 3 == 0) ? new Color(0.92f, 0.62f, 1f, 0.88f) : new Color(0.54f, 0.16f, 0.94f, 0.76f), 0.06f + (float)(j % 4) * 0.018f); seeds[j] = new Vector3((float)random.NextDouble() * (float)Math.PI * 2f, 4.2f + (float)random.NextDouble() * 3.2f, (float)random.NextDouble()); } Light light = NewLight(center + Vector3.up * 2.25f, new Color(0.48f, 0.14f, 0.86f), 8f, 0.72f); float elapsed = 0f; Color endColor = default(Color); while (elapsed < 6f) { float num = Mathf.Clamp01(elapsed / 0.35f); float num2 = Mathf.Clamp01((6f - elapsed) / 0.65f); float num3 = num * num2; float num4 = Mathf.SmoothStep(0f, 1f, num); float num5 = 0.43f * num4 * Mathf.Lerp(0.18f, 1f, num2); float num6 = 2.75f * num4 * Mathf.Lerp(0.04f, 1f, num2); field.transform.position = center - Vector3.up * 0.035f; field.transform.localScale = new Vector3(num6 * 2f, 0.035f, num6 * 2f); well.transform.position = center + Vector3.up * 2.25f; well.transform.localScale = Vector3.one * num5 * 2f; SetCircle(rim, center + Vector3.up * 2.25f, num5 * 1.16f, rim.positionCount); Tint(rim, new Color(0.78f, 0.34f, 1f), num3 * 0.88f); for (int k = 0; k < spirals.Length; k++) { LineRenderer val = spirals[k]; float num7 = (float)k * (float)Math.PI * 2f / (float)spirals.Length; for (int l = 0; l < val.positionCount; l++) { float num8 = (float)l / (float)(val.positionCount - 1); float num9 = Mathf.Lerp(8.2f, num5 * 0.62f, num8 * num8) * num4; float num10 = num7 + num8 * (float)Math.PI * 3.6f + elapsed * (0.72f + (float)k * 0.021f); float num11 = Mathf.Lerp(0.08f, 2.25f, Mathf.SmoothStep(0f, 1f, num8)) + Mathf.Sin(num8 * (float)Math.PI) * 0.34f; val.SetPosition(l, center + new Vector3(Mathf.Cos(num10) * num9, num11, Mathf.Sin(num10) * num9)); } Color startColor = ((k % 2 == 0) ? new Color(0.46f, 0.1f, 0.88f, num3 * 0.48f) : new Color(0.2f, 0.035f, 0.58f, num3 * 0.38f)); ((Color)(ref endColor))..ctor(0.9f, 0.58f, 1f, num3 * 0.9f); val.startColor = startColor; val.endColor = endColor; } for (int m = 0; m < motes.Length; m++) { float num12 = Mathf.Repeat(seeds[m].z + elapsed * (0.34f + (float)m * 0.005f), 1f); float num13 = Mathf.Lerp(seeds[m].y, num5 * 0.45f, num12 * num12); float num14 = seeds[m].x + elapsed * (1.15f + (float)m * 0.012f) + num12 * 6.2f; motes[m].transform.position = center + new Vector3(Mathf.Cos(num14) * num13, Mathf.Lerp(0.1f, 2.25f, num12) + Mathf.Sin(num14 * 1.7f + (float)m) * 0.12f, Mathf.Sin(num14) * num13); motes[m].transform.localScale = Vector3.one * (0.04f + (1f - num12) * 0.08f) * num3; } light.intensity = num3 * (0.62f + Mathf.Sin(elapsed * 3.5f) * 0.1f); elapsed += Time.deltaTime; yield return null; } Kill((Object)field, (Object)well, (Object)rim, (Object)light); LineRenderer[] array = spirals; foreach (LineRenderer val2 in array) { Kill((Object)val2); } GameObject[] array2 = motes; foreach (GameObject val3 in array2) { Kill((Object)val3); } } private static IEnumerator BloodHarvestRoutine(Vector3 center) { //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) center = Effects.SurfacePoint(center) + Vector3.up * 0.035f; List targets = Effects.EnemiesInRange(center, 8f); if (targets.Count > 14) { targets.RemoveRange(14, targets.Count - 14); } LineRenderer[] veins = (LineRenderer[])(object)new LineRenderer[targets.Count]; for (int i = 0; i < veins.Length; i++) { veins[i] = NewLine(13, (i % 3 == 0) ? new Color(1f, 0.18f, 0.16f) : new Color(0.52f, 0.015f, 0.025f), (i % 3 == 0) ? 0.1f : 0.065f); } GameObject heart = NewOrb(new Color(0.92f, 0.04f, 0.08f, 0.78f), 0.45f); LineRenderer[] pool = NewBloodPool(center, 4.7f); Light light = NewLight(center + Vector3.up * 1f, new Color(0.72f, 0.03f, 0.05f), 9f, 1.4f); float duration = 3.47f; float elapsed = 0f; while (elapsed < duration) { float num = Mathf.Clamp01((duration - elapsed) / 0.45f); float num2 = Mathf.Pow(Mathf.Max(0f, Mathf.Sin(elapsed * (float)Math.PI / 0.68f)), 5f); Vector3 val = center + Vector3.up * (1f + num2 * 0.1f); heart.transform.position = val; heart.transform.localScale = Vector3.one * (0.34f + num2 * 0.24f) * num; float num3 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(elapsed / 0.38f)); for (int j = 0; j < pool.Length; j++) { Color color = ((j % 4 == 0) ? new Color(0.66f, 0.008f, 0.012f) : new Color(0.4f, 0.002f, 0.006f)); Tint(pool[j], color, num3 * num * (0.82f + num2 * 0.12f)); } for (int k = 0; k < veins.Length; k++) { if ((Object)(object)targets[k] == (Object)null || targets[k].IsDead()) { Tint(veins[k], Color.red, 0f); continue; } Vector3 centerPoint = targets[k].GetCenterPoint(); Vector3 val2 = val; Vector3 val3 = val2 - centerPoint; Vector3 val4 = Vector3.Cross(((Vector3)(ref val3)).normalized, Vector3.up); for (int l = 0; l < veins[k].positionCount; l++) { float num4 = (float)l / (float)(veins[k].positionCount - 1); Vector3 val5 = Vector3.Lerp(centerPoint, val2, num4); val5 += val4 * Mathf.Sin(num4 * (float)Math.PI * 4f + elapsed * 7f + (float)k) * 0.1f * Mathf.Sin(num4 * (float)Math.PI); veins[k].SetPosition(l, val5); } Tint(veins[k], (k % 3 == 0) ? new Color(1f, 0.15f, 0.13f) : new Color(0.55f, 0.02f, 0.03f), num * (0.42f + num2 * 0.48f)); } light.intensity = num * (0.65f + num2 * 1.35f); elapsed += Time.deltaTime; yield return null; } LineRenderer[] array = veins; foreach (LineRenderer val6 in array) { Kill((Object)val6); } array = pool; foreach (LineRenderer val7 in array) { Kill((Object)val7); } Kill((Object)heart, (Object)light); } private static IEnumerator DreadVeilFallbackRoutine(Vector3 center) { //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) Transform anchor = null; float num = 4.5f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)(object)allPlayer == (Object)null)) { float num2 = Vector3.Distance(center, ((Component)allPlayer).transform.position); if (!(num2 >= num)) { num = num2; anchor = ((Component)allPlayer).transform; } } } LineRenderer[] strands = (LineRenderer[])(object)new LineRenderer[5]; for (int i = 0; i < strands.Length; i++) { strands[i] = NewLine(9, new Color(0.42f, 0.22f, 0.78f), 0.055f); } float elapsed = 0f; while (elapsed < 12f) { Vector3 val = (((Object)(object)anchor != (Object)null) ? anchor.position : center) + Vector3.up * 0.65f; float num3 = Mathf.Clamp01(elapsed / 0.35f); float num4 = Mathf.Clamp01((12f - elapsed) / 0.65f); for (int j = 0; j < strands.Length; j++) { float num5 = (float)j * (float)Math.PI * 2f / (float)strands.Length + elapsed * (0.22f + (float)j * 0.015f); for (int k = 0; k < strands[j].positionCount; k++) { float num6 = (float)k / (float)(strands[j].positionCount - 1); float num7 = Mathf.Lerp(0.72f, 0.18f, num6); float num8 = num5 + num6 * 1.8f + Mathf.Sin(elapsed * 1.7f + (float)j) * 0.18f; strands[j].SetPosition(k, val + new Vector3(Mathf.Cos(num8) * num7, num6 * 1.75f, Mathf.Sin(num8) * num7)); } Tint(strands[j], (j % 2 == 0) ? new Color(0.56f, 0.34f, 0.92f) : new Color(0.25f, 0.15f, 0.48f), num3 * num4 * 0.62f); } elapsed += Time.deltaTime; yield return null; } LineRenderer[] array = strands; foreach (LineRenderer val2 in array) { Kill((Object)val2); } } } public static class SpellIcons { private static readonly Dictionary Cache = new Dictionary(); private static readonly Dictionary StatusCache = new Dictionary(); private static readonly HashSet Missing = new HashSet(); private static readonly string[] Extensions = new string[3] { ".png", ".jpg", ".jpeg" }; public static Texture2D For(Spell spell) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown if (spell == null) { return null; } string text = Stem(spell.Name); if (Cache.TryGetValue(text, out var value) && (Object)(object)value != (Object)null) { return value; } if (Missing.Contains(text)) { return null; } try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return null; } string path = Path.Combine(directoryName, "art", "spells"); string[] extensions = Extensions; foreach (string text2 in extensions) { string text3 = Path.Combine(path, text + text2); if (File.Exists(text3)) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ClassArt.TryLoadImage(val, File.ReadAllBytes(text3))) { ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; ((Object)val).hideFlags = (HideFlags)61; Cache[text] = val; Plugin.Log.LogInfo((object)("Icona abilita caricata: " + text3)); return val; } Object.Destroy((Object)(object)val); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Icona di " + spell.Name + " non caricata: " + ex.Message)); } Missing.Add(text); return null; } public static Sprite StatusFor(Spell spell) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (spell == null) { return null; } string text = Stem(spell.Name); if (StatusCache.TryGetValue(text, out var value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = For(spell); if ((Object)(object)val == (Object)null) { return null; } Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val2).name = "norns_status_" + text; ((Object)val2).hideFlags = (HideFlags)61; StatusCache[text] = val2; return val2; } private static string Stem(string name) { if (string.Equals(name, "Bearskin", StringComparison.Ordinal)) { return "deathless"; } if (string.Equals(name, "Fireball", StringComparison.Ordinal)) { return "fireball"; } return name.ToLowerInvariant().Replace("'", string.Empty).Replace(" ", "_") .Replace("-", "_"); } } public sealed class UruzCleaverVfxController : MonoBehaviour { public Transform CharmPivot; public MeshRenderer FrontRune; public MeshRenderer BackRune; private static readonly int ColorId = Shader.PropertyToID("_Color"); private static readonly Color RuneEmber = new Color(0.62f, 0.075f, 0.028f); private MaterialPropertyBlock _block; private Quaternion _charmRest; private float _phase; private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)CharmPivot != (Object)null) { _charmRest = CharmPivot.localRotation; } _block = new MaterialPropertyBlock(); _phase = (float)(((Object)this).GetInstanceID() & 0x3FF) * 0.0061f; } private void LateUpdate() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) float num = Time.time + _phase; if ((Object)(object)CharmPivot != (Object)null) { float num2 = Mathf.Sin(num * 1.85f) * 4.2f + Mathf.Sin(num * 2.71f + 0.9f) * 1.6f; float num3 = Mathf.Sin(num * 1.33f + 1.7f) * 2.8f; CharmPivot.localRotation = _charmRest * Quaternion.Euler(num2, 0f, num3); } float intensity = 0.86f + Mathf.Sin(num * 1.15f) * 0.11f + Mathf.Sin(num * 2.43f + 0.6f) * 0.045f; ApplyRuneEmber(FrontRune, intensity); ApplyRuneEmber(BackRune, intensity); } private void ApplyRuneEmber(MeshRenderer renderer, float intensity) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)renderer == (Object)null) && _block != null) { ((Renderer)renderer).GetPropertyBlock(_block); Color val = RuneEmber * intensity; val.a = 1f; _block.SetColor(ColorId, val); ((Renderer)renderer).SetPropertyBlock(_block); } } } public static class VfxAssets { public const string BundleFileName = "norns_vfx"; public const string PipelineTestAssetPath = "assets/mod/vfx/testing/prefabs/vfx_pipelinetest.prefab"; public const string BlackHoleAssetPath = "assets/mod/vfx/abilities/blackhole/norns_vfx_blackhole.prefab"; public const string BlackHoleCastAssetPath = "assets/mod/vfx/abilities/blackhole/norns_vfx_blackhole_cast.prefab"; public const string FireballAssetPath = "assets/mod/vfx/abilities/emberbolt/norns_vfx_fireball.prefab"; public const string FireballCastAssetPath = "assets/mod/vfx/abilities/emberbolt/norns_vfx_fireball_cast.prefab"; public const string FrostNovaAssetPath = "assets/mod/vfx/abilities/frostnova/norns_vfx_frostnova.prefab"; public const string ArcLightningAssetPath = "assets/mod/vfx/abilities/arclightning/norns_vfx_arclightning.prefab"; public const string ArcLightningCastAssetPath = "assets/mod/vfx/abilities/arclightning/norns_vfx_arclightning_cast.prefab"; public const string RunicWardAssetPath = "assets/mod/vfx/abilities/runicward/norns_vfx_runicward.prefab"; public const string FallOfRagnarokCastAssetPath = "assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_cast.prefab"; public const string FallOfRagnarokStormAssetPath = "assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_storm.prefab"; public const string FallOfRagnarokBoltAssetPath = "assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_bolt.prefab"; public const string FallOfRagnarokImpactAssetPath = "assets/mod/vfx/abilities/fallofragnarok/norns_vfx_fallofragnarok_impact.prefab"; public const string BloodHarvestAssetPath = "assets/mod/vfx/abilities/bloodharvest/norns_vfx_bloodharvest.prefab"; public const string BloodHarvestCastAssetPath = "assets/mod/vfx/abilities/bloodharvest/norns_vfx_bloodharvest_cast.prefab"; public const string DreadVeilAssetPath = "assets/mod/vfx/abilities/dreadveil/norns_vfx_dreadveil.prefab"; public const string DreadVeilCastAssetPath = "assets/mod/vfx/abilities/dreadveil/norns_vfx_dreadveil_cast.prefab"; public const string RendingBlowAssetPath = "assets/mod/vfx/abilities/rendingblow/norns_vfx_rendingblow.prefab"; public const string WarCryAssetPath = "assets/mod/vfx/abilities/warcry/norns_vfx_warcry.prefab"; public const string BloodstormAssetPath = "assets/mod/vfx/abilities/bloodstorm/norns_vfx_bloodstorm.prefab"; public const string BearskinAssetPath = "assets/mod/vfx/abilities/bearskin/norns_vfx_bearskin.prefab"; public const string RageUnboundAssetPath = "assets/mod/vfx/abilities/rageunbound/norns_vfx_rageunbound.prefab"; public const string ExecutionersWakeAssetPath = "assets/mod/vfx/abilities/executionerswake/norns_vfx_executionerswake.prefab"; public const string EarthshatterDiveAssetPath = "assets/mod/vfx/abilities/earthshatter/norns_vfx_earthshatter_dive.prefab"; public const string EarthshatterImpactAssetPath = "assets/mod/vfx/abilities/earthshatter/norns_vfx_earthshatter_impact.prefab"; public const string WarbandsOathAssetPath = "assets/mod/vfx/abilities/warbandsoath/norns_vfx_warbandsoath.prefab"; public const string ApprenticeStaffAssetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_apprentice.prefab"; public const string RunicStaffAssetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_runic.prefab"; public const string SeidrStaffAssetPath = "assets/mod/vfx/equipment/magestaves/norns_staff_seidr.prefab"; public const string UruzCleaverAssetPath = "assets/mod/vfx/equipment/berserkerweapons/norns_weapon_uruzcleaver.prefab"; private static readonly Dictionary PrefabCache = new Dictionary(StringComparer.OrdinalIgnoreCase); private static AssetBundle _bundle; private static bool _loadAttempted; public static string BundlePath { get { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (!string.IsNullOrEmpty(directoryName)) { return Path.Combine(directoryName, "assets", "norns_vfx"); } return string.Empty; } } public static GameObject InstantiateLocal(string assetPath, Vector3 position, Quaternion rotation, float safetyLifetime) { //IL_001f: 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) GameObject prefab = GetPrefab(assetPath); if ((Object)(object)prefab == (Object)null) { return null; } bool forceDisableInit = ZNetView.m_forceDisableInit; try { ZNetView.m_forceDisableInit = true; GameObject val = Object.Instantiate(prefab, position, rotation); ((Object)val).name = "norns_local_" + ((Object)prefab).name; val.SetActive(true); if (safetyLifetime > 0f) { Object.Destroy((Object)(object)val, safetyLifetime); } return val; } finally { ZNetView.m_forceDisableInit = forceDisableInit; } } public static GameObject InstantiatePipelineTest(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return InstantiateLocal("assets/mod/vfx/testing/prefabs/vfx_pipelinetest.prefab", position, Quaternion.identity, 5f); } public static GameObject GetPrefab(string assetPath) { if (string.IsNullOrWhiteSpace(assetPath)) { Plugin.Log.LogError((object)"VFX AssetBundle: percorso prefab vuoto."); return null; } if (PrefabCache.TryGetValue(assetPath, out var value) && (Object)(object)value != (Object)null) { return value; } if (!EnsureBundleLoaded()) { return null; } GameObject val; try { val = _bundle.LoadAsset(assetPath); } catch (Exception arg) { Plugin.Log.LogError((object)$"VFX AssetBundle: errore caricando '{assetPath}': {arg}"); return null; } if ((Object)(object)val == (Object)null) { Plugin.Log.LogError((object)("VFX AssetBundle: prefab '" + assetPath + "' assente. Asset disponibili: " + string.Join(", ", _bundle.GetAllAssetNames()))); return null; } try { PrefabExtension.FixReferences(val, true); } catch (Exception arg2) { Plugin.Log.LogError((object)$"VFX AssetBundle: risoluzione mock fallita per '{assetPath}': {arg2}"); return null; } if (!ValidateLocalPrefab(val, assetPath)) { return null; } PrefabCache[assetPath] = val; Plugin.Log.LogInfo((object)("VFX prefab pronto: " + assetPath)); return val; } public static void Shutdown() { PrefabCache.Clear(); if ((Object)(object)_bundle != (Object)null) { _bundle.Unload(false); _bundle = null; } _loadAttempted = false; } private static bool EnsureBundleLoaded() { if ((Object)(object)_bundle != (Object)null) { return true; } if (_loadAttempted) { return false; } _loadAttempted = true; string bundlePath = BundlePath; if (string.IsNullOrEmpty(bundlePath) || !File.Exists(bundlePath)) { Plugin.Log.LogError((object)("VFX AssetBundle non trovato: '" + bundlePath + "'. Eseguire scripts/Build-VfxAssetBundle.ps1 dopo aver installato Unity 6000.0.61f1.")); return false; } try { _bundle = AssetUtils.LoadAssetBundle(bundlePath); } catch (Exception arg) { Plugin.Log.LogError((object)$"VFX AssetBundle non caricabile da '{bundlePath}': {arg}"); return false; } if ((Object)(object)_bundle == (Object)null) { Plugin.Log.LogError((object)("VFX AssetBundle.Load ha restituito null per '" + bundlePath + "'. Controllare versione Unity e piattaforma Windows x64.")); return false; } Plugin.Log.LogInfo((object)("VFX AssetBundle caricato: " + bundlePath)); return true; } private static bool ValidateLocalPrefab(GameObject prefab, string assetPath) { if ((Object)(object)prefab.GetComponentInChildren(true) == (Object)null) { Plugin.Log.LogError((object)("VFX prefab '" + assetPath + "' privo di ParticleSystem: bundle rifiutato.")); return false; } if ((Object)(object)prefab.GetComponentInChildren(true) != (Object)null) { Plugin.Log.LogError((object)("VFX prefab locale '" + assetPath + "' contiene ZNetView. Rimuoverlo: la cosmetica authorata non deve creare ZDO.")); return false; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = componentsInChildren[i].sharedMaterials; foreach (Material val in sharedMaterials) { if ((Object)(object)val == (Object)null || (Object)(object)val.shader == (Object)null) { Plugin.Log.LogError((object)("VFX prefab '" + assetPath + "' contiene un materiale/shader mancante.")); return false; } string text = ((Object)val.shader).name ?? string.Empty; if (text.StartsWith("JVLmock_", StringComparison.Ordinal) || text.IndexOf("InternalErrorShader", StringComparison.OrdinalIgnoreCase) >= 0) { Plugin.Log.LogError((object)("VFX prefab '" + assetPath + "': shader non risolto '" + text + "' sul materiale '" + ((Object)val).name + "'.")); return false; } } } return true; } } public sealed class WarbandsOathVfxController : MonoBehaviour { public Transform OathGroup; public Transform FrontGroup; public Transform PersonalGuardGroup; public Transform DissipationGroup; public Light OathLight; public float Radius = 15f; public float Lifetime = 18f; private const float FrontLifetime = 2.6f; private Player _caster; private Player _guarded; private Transform _guardedChest; private float _startedAt; private bool _ending; private float _endStartedAt; private void OnEnable() { //IL_0007: 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_00a6: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) _caster = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); _startedAt = Time.time; _ending = false; float num = Mathf.Max(0.35f, Radius / 15f); if ((Object)(object)FrontGroup != (Object)null) { FrontGroup.localScale = new Vector3(num, 1f, num); } BerserkerVfxSupport.Play(OathGroup); BerserkerVfxSupport.Play(FrontGroup); BerserkerVfxSupport.StopAndClear(DissipationGroup); Player localPlayer = Player.m_localPlayer; Vector3 val = (((Object)(object)localPlayer != (Object)null) ? (((Component)localPlayer).transform.position - ((Component)this).transform.position) : Vector3.positiveInfinity); val.y = 0f; bool flag = (Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead() && ((Vector3)(ref val)).magnitude <= Radius; _guarded = (flag ? localPlayer : null); _guardedChest = BerserkerVfxSupport.ChestAnchor(_guarded); if ((Object)(object)_guarded != (Object)null) { BerserkerVfxSupport.Play(PersonalGuardGroup); } else { BerserkerVfxSupport.StopAndClear(PersonalGuardGroup); } if ((Object)(object)OathLight != (Object)null) { OathLight.intensity = 0f; } } private void LateUpdate() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bb: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if ((Object)(object)OathGroup != (Object)null && (Object)(object)_caster != (Object)null && num < 0.85f) { OathGroup.position = ((Component)_caster).transform.position + Vector3.up * 1.15f; } if ((Object)(object)_guarded != (Object)null && (Object)(object)PersonalGuardGroup != (Object)null) { Vector3 position = (((Object)(object)_guardedChest != (Object)null) ? _guardedChest.position : (((Component)_guarded).transform.position + Vector3.up * 1.32f)); PersonalGuardGroup.position = position; PersonalGuardGroup.rotation = ((Component)_guarded).transform.rotation; } if ((Object)(object)OathLight != (Object)null) { OathLight.intensity = BerserkerVfxSupport.Flash(num, 0.16f, 0.75f) * 1.3f; } if (num >= 2.6f) { BerserkerVfxSupport.StopEmitting(FrontGroup); BerserkerVfxSupport.StopEmitting(OathGroup); } float num2 = (((Object)(object)_guarded != (Object)null) ? Lifetime : 2.6f); if (!_ending && num >= num2) { _ending = true; _endStartedAt = Time.time; BerserkerVfxSupport.StopEmitting(PersonalGuardGroup); if ((Object)(object)_guarded != (Object)null) { BerserkerVfxSupport.Play(DissipationGroup); } } if (_ending) { if ((Object)(object)DissipationGroup != (Object)null && (Object)(object)_guarded != (Object)null) { DissipationGroup.position = ((Component)_guarded).transform.position + Vector3.up * 1.2f; } if (Time.time - _endStartedAt >= 1.5f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public sealed class WarCryVfxController : MonoBehaviour { public Transform BodyOriginGroup; public Transform ShockfrontGroup; public Transform ResidualGroup; public Light CryLight; public float Radius = 8f; private const float BodyFollowDuration = 0.26f; private const float TotalLifetime = 2.35f; private Player _player; private Transform _chest; private float _startedAt; private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) _player = BerserkerVfxSupport.FindNearestPlayer(((Component)this).transform.position); _chest = BerserkerVfxSupport.ChestAnchor(_player); _startedAt = Time.time; float num = Mathf.Max(0.35f, Radius / 8f); if ((Object)(object)ShockfrontGroup != (Object)null) { ShockfrontGroup.localScale = new Vector3(num, 1f, num); } if ((Object)(object)ResidualGroup != (Object)null) { ResidualGroup.localScale = new Vector3(num, 1f, num); } BerserkerVfxSupport.Play(BodyOriginGroup); BerserkerVfxSupport.Play(ShockfrontGroup); BerserkerVfxSupport.Play(ResidualGroup); if ((Object)(object)CryLight != (Object)null) { CryLight.intensity = 0f; } } private void LateUpdate() { //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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _startedAt; if (num < 0.26f && (Object)(object)BodyOriginGroup != (Object)null) { Vector3 position = (((Object)(object)_chest != (Object)null) ? _chest.position : (((Object)(object)_player != (Object)null) ? (((Component)_player).transform.position + Vector3.up * 1.35f) : (((Component)this).transform.position + Vector3.up * 1.35f))); BodyOriginGroup.position = position; if ((Object)(object)_player != (Object)null) { BodyOriginGroup.rotation = ((Component)_player).transform.rotation; } } if ((Object)(object)CryLight != (Object)null) { float num2 = BerserkerVfxSupport.Flash(num - 0.02f, 0.03f, 0.32f) * 3.4f; CryLight.intensity = num2; if (num2 <= 0.001f && num > 0.6f && ((Behaviour)CryLight).enabled) { ((Behaviour)CryLight).enabled = false; } } if (num >= 2.35f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class WardRepulsion { private const float PulseInterval = 0.28f; private const float PushForceAtEdge = 28f; private const float PushForceAtCenter = 46f; private static float _nextPulse; public static void Update(Player player) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && PassiveEffects.HasWard(player) && !(Time.time < _nextPulse)) { _nextPulse = Time.time + 0.28f; Vector3 position = ((Component)player).transform.position; ApplyOwned(position); Network.BroadcastWardPulse(position); } } public static void ApplyOwned(Vector3 center) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: 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_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_00ed: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) bool flag = false; Vector3 contactPoint = center + Vector3.forward * 3.8f; float num = float.MaxValue; foreach (Character item in Effects.EnemiesInRange(center, 3.8f)) { if ((Object)(object)item == (Object)null || (Object)(object)item.m_body == (Object)null || (Object)(object)item.m_nview == (Object)null) { continue; } flag = true; if (item.m_nview.IsOwner()) { Vector3 val = ((Component)item).transform.position - center; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < num) { num = magnitude; contactPoint = ((Component)item).transform.position + Vector3.up * 0.9f; } val = ((!(magnitude < 0.05f)) ? (val / magnitude) : ((Component)item).transform.forward); float num2 = 1f - Mathf.Clamp01(magnitude / 3.8f); float num3 = Mathf.Lerp(28f, 46f, num2); item.ApplyPushback(val, num3); } } if (flag) { RunicWardVfxController.NotifyPulse(center, contactPoint); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class XpPatches { private sealed class Contribution { public float LastHitAt; public float Damage; public bool KillingBlow; } private struct KillMetadata { public string Prefab; public int CreatureLevel; public float MaxHealth; public Biome DeathBiome; } public const float ContributionWindow = 60f; private static readonly Dictionary> Contributions = new Dictionary>(); private static float _nextPrune; private static void Prefix(Character __instance) { //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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected I4, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected I4, but got Unknown if (!EnemyXpCatalog.IsEligible(__instance) || (Object)(object)__instance.m_nview == (Object)null || !__instance.m_nview.IsValid() || !__instance.m_nview.IsOwner()) { return; } string text = TakeContributors(__instance); if (!string.IsNullOrEmpty(text)) { int num = BaseKillXp(__instance); if (num > 0) { Vector3 position = ((Component)__instance).transform.position; Biome val = XpSystem.NativeBiome(__instance, position); string enemyDescriptor = EncodeMetadata(__instance, position); AwardLocal(position, num, text, enemyDescriptor, (int)val, remoteWitness: false); Network.BroadcastKill(position, num, text, enemyDescriptor, (int)val); } } } public static int BaseKillXp(Character character) { //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) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)character == (Object)null) { return 0; } Biome fallback = Heightmap.FindBiome(((Component)character).transform.position); return EnemyXpCatalog.Reward(character, fallback); } internal static void RecordContribution(Character target, long playerId, float damage, bool killingBlow = false) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (EnemyXpCatalog.IsEligible(target) && playerId != 0L && !(damage <= 0.01f) && !((Object)(object)target.m_nview == (Object)null)) { ZDOID zDOID = target.GetZDOID(); if (!Contributions.TryGetValue(zDOID, out var value)) { value = new Dictionary(); Contributions[zDOID] = value; } if (!value.TryGetValue(playerId, out var value2)) { value2 = (value[playerId] = new Contribution()); } value2.LastHitAt = Time.time; value2.Damage += damage; value2.KillingBlow |= killingBlow; if (!(Time.time < _nextPrune)) { _nextPrune = Time.time + 30f; PruneContributions(); } } } private static string TakeContributors(Character target) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) ZDOID zDOID = target.GetZDOID(); if (!Contributions.TryGetValue(zDOID, out var value)) { return string.Empty; } Contributions.Remove(zDOID); List list = new List(); float num = Mathf.Max(0.1f, target.GetMaxHealth() * 0.02f); foreach (KeyValuePair item in value) { if (Time.time - item.Value.LastHitAt <= 60f && (item.Value.Damage >= num || item.Value.KillingBlow)) { list.Add(item.Key.ToString()); } } return string.Join(",", list.ToArray()); } private static void PruneContributions() { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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) List list = new List(); foreach (KeyValuePair> contribution in Contributions) { List list2 = new List(); foreach (KeyValuePair item in contribution.Value) { if (Time.time - item.Value.LastHitAt > 60f) { list2.Add(item.Key); } } foreach (long item2 in list2) { contribution.Value.Remove(item2); } if (contribution.Value.Count == 0) { list.Add(contribution.Key); } } foreach (ZDOID item3 in list) { Contributions.Remove(item3); } } private static bool ContainsContributor(string contributors, long playerId) { if (string.IsNullOrEmpty(contributors) || playerId == 0L) { return false; } string text = playerId.ToString(); string[] array = contributors.Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { if (array[i] == text) { return true; } } return false; } private static string EncodeMetadata(Character character, Vector3 position) { //IL_0083: 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_008a: Expected I4, but got Unknown string text = (((Object)(object)character.m_nview != (Object)null) ? character.m_nview.GetPrefabName() : ((Object)((Component)character).gameObject).name); text = (text ?? string.Empty).Replace("|", string.Empty); return string.Join("|", text, character.GetLevel().ToString(CultureInfo.InvariantCulture), character.GetMaxHealth().ToString("0.##", CultureInfo.InvariantCulture), ((int)Heightmap.FindBiome(position)).ToString(CultureInfo.InvariantCulture)); } private static KillMetadata DecodeMetadata(string descriptor) { //IL_0030: 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) KillMetadata result = new KillMetadata { Prefab = (descriptor ?? string.Empty), CreatureLevel = 1, MaxHealth = 0f, DeathBiome = (Biome)0 }; if (string.IsNullOrEmpty(descriptor)) { return result; } string[] array = descriptor.Split(new char[1] { '|' }); result.Prefab = array[0]; if (array.Length > 1 && int.TryParse(array[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result2)) { result.CreatureLevel = Mathf.Max(1, result2); } if (array.Length > 2 && float.TryParse(array[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3)) { result.MaxHealth = Mathf.Max(0f, result3); } if (array.Length > 3 && int.TryParse(array[3], NumberStyles.Integer, CultureInfo.InvariantCulture, out var result4) && Enum.IsDefined(typeof(Biome), result4)) { result.DeathBiome = (Biome)result4; } return result; } public static void AwardLocal(Vector3 position, int baseXp, string contributors, string enemyDescriptor, int nativeBiome, bool remoteWitness = true) { //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) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && ContainsContributor(contributors, localPlayer.GetPlayerID()) && !(Vector3.Distance(((Component)localPlayer).transform.position, position) > 64f)) { KillMetadata killMetadata = DecodeMetadata(enemyDescriptor); int level = ClassSystem.GetLevel(localPlayer); int num = XpSystem.AdjustKillXp(Mathf.Clamp(baseXp, 0, 1500), (Biome)nativeBiome, level); if (num > 0) { XpSystem.AddKillXp(localPlayer, num, "Enemy defeated"); } if (!string.IsNullOrEmpty(killMetadata.Prefab)) { XpSystem.AwardBossMilestone(localPlayer, killMetadata.Prefab); } } } } [HarmonyPatch(typeof(Character), "SetHealth")] public static class XpContributionPatch { private static void Prefix(Character __instance, float health) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.m_nview == (Object)null || !__instance.m_nview.IsOwner()) { return; } float num = __instance.GetHealth() - health; if (!(num <= 0.01f) && __instance.m_lastHit != null) { Character attacker = __instance.m_lastHit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if ((Object)(object)val != (Object)null && BerserkerFury.IsValidCombatTarget(__instance, val)) { BerserkerFury.AwardDealtDamageFromWitness(val.GetPlayerID(), num, __instance.m_lastHit.m_skill); } if (EnemyXpCatalog.IsEligible(__instance) && !((Object)(object)val == (Object)null)) { XpPatches.RecordContribution(__instance, val.GetPlayerID(), num, health <= 0.01f); } } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class XpDamageRpcContextPatch { [ThreadStatic] internal static long ActivePlayerId; private static void Prefix(Character __instance, HitData hit, out long __state) { __state = ActivePlayerId; ActivePlayerId = 0L; if (EnemyXpCatalog.IsEligible(__instance) && !((Object)(object)__instance.m_nview == (Object)null) && __instance.m_nview.IsOwner() && hit != null) { Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if ((Object)(object)val != (Object)null) { ActivePlayerId = val.GetPlayerID(); } } } private static void Postfix(long __state) { ActivePlayerId = __state; } } [HarmonyPatch(typeof(Character), "AddFireDamage")] public static class XpFireContributionPatch { private static void Prefix(Character __instance, float damage) { long activePlayerId = XpDamageRpcContextPatch.ActivePlayerId; if (damage > 0.01f && activePlayerId != 0L) { XpPatches.RecordContribution(__instance, activePlayerId, damage); } } } [HarmonyPatch(typeof(Character), "AddSpiritDamage")] public static class XpSpiritContributionPatch { private static void Prefix(Character __instance, float damage) { long activePlayerId = XpDamageRpcContextPatch.ActivePlayerId; if (damage > 0.01f && activePlayerId != 0L) { XpPatches.RecordContribution(__instance, activePlayerId, damage); } } } [HarmonyPatch(typeof(Character), "AddPoisonDamage")] public static class XpPoisonContributionPatch { private static void Prefix(Character __instance, float damage) { long activePlayerId = XpDamageRpcContextPatch.ActivePlayerId; if (damage > 0.01f && activePlayerId != 0L) { XpPatches.RecordContribution(__instance, activePlayerId, damage); } } } public static class XpPopup { private sealed class Entry { public Player Player; public int Amount; public float Born; } private const float Duration = 1.8f; private const float MergeWindow = 0.28f; private const int MediumReward = 25; private const int LargeReward = 250; private static readonly List Entries = new List(); private static GUIStyle _small; private static GUIStyle _medium; private static GUIStyle _large; private static GUIStyle _shadow; public static void Show(Player player, int amount) { if ((Object)(object)player == (Object)null || (Object)(object)player != (Object)(object)Player.m_localPlayer || amount <= 0) { return; } float time = Time.time; if (Entries.Count > 0) { Entry entry = Entries[Entries.Count - 1]; if ((Object)(object)entry.Player == (Object)(object)player && time - entry.Born <= 0.28f) { entry.Amount += amount; entry.Born = time; return; } } Entries.Add(new Entry { Player = player, Amount = amount, Born = time }); } public static void Draw() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) if (Entries.Count == 0) { return; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } EnsureStyles(); float time = Time.time; Rect val2 = default(Rect); for (int num = Entries.Count - 1; num >= 0; num--) { Entry entry = Entries[num]; float num2 = time - entry.Born; if ((Object)(object)entry.Player == (Object)null || num2 >= 1.8f) { Entries.RemoveAt(num); } else { Vector3 val = main.WorldToScreenPoint(((Component)entry.Player).transform.position + Vector3.up * 2.35f); if (!(val.z <= 0f)) { float num3 = Mathf.Clamp01(num2 / 1.8f); float num4 = 1f - Mathf.Pow(1f - num3, 3f); float num5 = Mathf.Min(1f, num2 / 0.12f) * Mathf.Clamp01((1.8f - num2) / 0.55f); float num6 = 12f + 58f * num4; ((Rect)(ref val2))..ctor(val.x - 110f, (float)Screen.height - val.y - num6, 220f, 42f); string text = $"+{entry.Amount} XP"; GUIStyle val3 = StyleFor(entry.Amount); _shadow.fontSize = val3.fontSize; Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, num5); GUI.Label(new Rect(((Rect)(ref val2)).x + 2f, ((Rect)(ref val2)).y + 2f, ((Rect)(ref val2)).width, ((Rect)(ref val2)).height), text, _shadow); GUI.Label(val2, text, val3); GUI.color = color; } } } } public static void Shutdown() { Entries.Clear(); _small = null; _medium = null; _large = null; _shadow = null; } private static GUIStyle StyleFor(int amount) { if (amount >= 250) { return _large; } if (amount >= 25) { return _medium; } return _small; } private static void EnsureStyles() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (_small == null) { NornsSkin.EnsureBuilt(); _small = PopupStyle(21, new Color(0.76f, 0.78f, 0.8f)); _medium = PopupStyle(23, new Color(0.45f, 0.88f, 0.48f)); _large = PopupStyle(27, new Color(1f, 0.84f, 0.3f)); _shadow = PopupStyle(27, new Color(0.02f, 0.02f, 0.025f, 0.88f)); } } private static GUIStyle PopupStyle(int size, Color color) { //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_0011: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown GUIStyle val = new GUIStyle(NornsSkin.SpellName) { fontSize = size, alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; val.normal.textColor = color; return val; } } public static class XpSystem { private struct Milestone { public string Id; public string Prefab; public int Xp; public string Label; } public const float KillXpRadius = 64f; private static readonly Milestone[] BossMilestones = new Milestone[7] { new Milestone { Id = "defeated_eikthyr", Prefab = "Eikthyr", Xp = 700, Label = "Eikthyr" }, new Milestone { Id = "defeated_gdking", Prefab = "gd_king", Xp = 2500, Label = "The Elder" }, new Milestone { Id = "defeated_bonemass", Prefab = "Bonemass", Xp = 6000, Label = "Bonemass" }, new Milestone { Id = "defeated_dragon", Prefab = "Dragon", Xp = 12000, Label = "Moder" }, new Milestone { Id = "defeated_goblinking", Prefab = "GoblinKing", Xp = 6000, Label = "Yagluth" }, new Milestone { Id = "defeated_queen", Prefab = "SeekerQueen", Xp = 4000, Label = "The Queen" }, new Milestone { Id = "defeated_fader", Prefab = "Fader", Xp = 2000, Label = "Fader" } }; private static readonly Dictionary BiomeMilestones = new Dictionary { { (Biome)1, new Milestone { Id = "biome_meadows", Xp = 0, Label = "Meadows" } }, { (Biome)8, new Milestone { Id = "biome_blackforest", Xp = 150, Label = "Black Forest" } }, { (Biome)256, new Milestone { Id = "biome_ocean", Xp = 100, Label = "Ocean" } }, { (Biome)2, new Milestone { Id = "biome_swamp", Xp = 400, Label = "Swamp" } }, { (Biome)4, new Milestone { Id = "biome_mountain", Xp = 800, Label = "Mountain" } }, { (Biome)16, new Milestone { Id = "biome_plains", Xp = 1200, Label = "Plains" } }, { (Biome)512, new Milestone { Id = "biome_mistlands", Xp = 2000, Label = "Mistlands" } }, { (Biome)32, new Milestone { Id = "biome_ashlands", Xp = 1000, Label = "Ashlands" } }, { (Biome)64, new Milestone { Id = "biome_deepnorth", Xp = 1000, Label = "Deep North" } } }; public static void AddKillXp(Player player, int amount, string reason = null) { AddScaledXp(player, amount, NornsConfig.KillXpMultiplier.Value); } public static void AddMilestoneXp(Player player, int amount, string reason = null) { AddScaledXp(player, amount, NornsConfig.MilestoneXpMultiplier.Value); } private static void AddScaledXp(Player player, int amount, float multiplier) { if ((Object)(object)player == (Object)null || amount <= 0 || !ClassSystem.HasClass(player)) { return; } int level = ClassSystem.GetLevel(player); if (level < 50) { int xp = ClassSystem.GetXp(player); int num = Mathf.Max(1, Mathf.RoundToInt((float)amount * multiplier)); ClassSystem.SetXp(player, xp + num); int level2 = ClassSystem.GetLevel(player); XpPopup.Show(player, num); if (level2 > level) { OnLevelUp(player, level2); } } } private static void OnLevelUp(Player player, int level) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Message(player, $"Level {level}"); Spell spell = Spell.UnlockedAt(ClassSystem.GetClass(player), level); if (spell != null) { Message(player, "New spell: " + spell.Name); } if (level >= 50) { Message(player, "The Norns have finished your thread."); } SpellFx.Play(FxKind.LevelUp, ((Component)player).transform.position, ((Component)player).transform.position); } public static void CheckMilestones(Player player) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !ClassSystem.HasClass(player) || !NornsConfig.MilestoneXpEnabled.Value || (Object)(object)ZoneSystem.instance == (Object)null) { return; } HashSet milestones = ClassSystem.GetMilestones(player); bool flag = false; Biome key = Heightmap.FindBiome(((Component)player).transform.position); if (BiomeMilestones.TryGetValue(key, out var value) && !milestones.Contains(value.Id)) { milestones.Add(value.Id); flag = true; if (value.Xp > 0) { AddMilestoneXp(player, value.Xp, value.Label + " discovered"); } } if (flag) { ClassSystem.SaveMilestones(player, milestones); } } public static void AwardBossMilestone(Player player, string prefabName) { if ((Object)(object)player == (Object)null || string.IsNullOrEmpty(prefabName) || !NornsConfig.MilestoneXpEnabled.Value) { return; } Milestone[] bossMilestones = BossMilestones; for (int i = 0; i < bossMilestones.Length; i++) { Milestone milestone = bossMilestones[i]; if (string.Equals(milestone.Prefab, prefabName, StringComparison.OrdinalIgnoreCase)) { HashSet milestones = ClassSystem.GetMilestones(player); if (!milestones.Contains(milestone.Id)) { milestones.Add(milestone.Id); ClassSystem.SaveMilestones(player, milestones); AddMilestoneXp(player, milestone.Xp, milestone.Label + " defeated"); } break; } } } public static int AdjustKillXp(int baseXp, Biome biome, int level) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (baseXp <= 0) { return 0; } int num = EnemyXpCatalog.FullXpLevel(biome); if (level <= num) { return baseXp; } int num2 = level - num; if (num2 >= 5) { return 0; } float num3 = 1f - (float)num2 / 5f; return Mathf.Max(0, Mathf.RoundToInt((float)baseXp * num3)); } public static Biome NativeBiome(Character character, Vector3 deathPosition) { //IL_0017: 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_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_0040: 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_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)character == (Object)null || (Object)(object)character.m_nview == (Object)null) { return Heightmap.FindBiome(deathPosition); } string prefabName = character.m_nview.GetPrefabName(); if (string.IsNullOrEmpty(prefabName)) { return Heightmap.FindBiome(deathPosition); } return NativeBiome(prefabName, Heightmap.FindBiome(deathPosition)); } internal static Biome NativeBiome(string prefab, Biome fallback) { //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) return EnemyXpCatalog.NativeBiome(prefab, fallback); } internal static int FullXpUntil(Biome biome) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EnemyXpCatalog.FullXpLevel(biome); } internal static void Message(Player player, string text) { if (!((Object)(object)player != (Object)(object)Player.m_localPlayer) && !((Object)(object)MessageHud.instance == (Object)null)) { MessageHud.instance.ShowMessage((MessageType)1, text, 0, (Sprite)null, false); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }