Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Pantheon v0.7.14
BepInEx/plugins/Redzergling-Pantheon/Pantheon.Bosses.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Cryptography; using System.Text; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.NullifierMonster; using EntityStates.TitanMonster; using KinematicCharacterController; using LeTai.Asset.TranslucentImage; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using R2API; using Redzergling.Pantheon; using Redzergling.PrismantlePreview; using RoR2; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ConVar; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Networking; using RoR2.Projectile; using RoR2.Skills; using RoR2.WwiseUtils; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 Redzergling.Pantheon { internal sealed class NativePresentationCamera : IDisposable { internal const string ProfileAddress = "RoR2/Base/title/PostProcessing/ppRunBase.asset"; private static GameObject cameraPrefab; private static PostProcessProfile baseProfile; private readonly GameObject volumeObject; private readonly GameObject inspectionLight; internal NativePresentationCamera(Camera camera, bool isolateStageVolumes = false) { //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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //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_00f4: 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_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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_01b9: 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) if (!Object.op_Implicit((Object)(object)cameraPrefab)) { cameraPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Core/Camera/Main Camera.prefab").WaitForCompletion(); } if (!Object.op_Implicit((Object)(object)baseProfile)) { baseProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppRunBase.asset").WaitForCompletion(); } PostProcessLayer componentInChildren = cameraPrefab.GetComponentInChildren<PostProcessLayer>(true); PostProcessResources val = (PostProcessResources)typeof(PostProcessLayer).GetField("m_Resources", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(componentInChildren); PostProcessProfile val2 = baseProfile; if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { throw new InvalidOperationException("Native presentation camera resources missing"); } ((Component)camera).gameObject.SetActive(false); camera.allowHDR = true; camera.forceIntoRenderTexture = true; ((Behaviour)camera).enabled = false; PostProcessLayer val3 = ((Component)camera).gameObject.AddComponent<PostProcessLayer>(); val3.Init(val); val3.volumeTrigger = ((Component)camera).transform; val3.volumeLayer = LayerMask.op_Implicit(1 << (isolateStageVolumes ? 31 : 20)); val3.antialiasingMode = componentInChildren.antialiasingMode; val3.stopNaNPropagation = componentInChildren.stopNaNPropagation; volumeObject = new GameObject("PantheonNativePresentationProfile"); volumeObject.SetActive(false); volumeObject.layer = (isolateStageVolumes ? 31 : 20); PostProcessVolume obj = volumeObject.AddComponent<PostProcessVolume>(); obj.isGlobal = true; obj.priority = 100f; obj.weight = 1f; obj.sharedProfile = val2; obj.targetLayer = val3; volumeObject.SetActive(true); inspectionLight = new GameObject("PantheonInspectionKeyLight"); Light obj2 = inspectionLight.AddComponent<Light>(); obj2.type = (LightType)1; obj2.color = new Color(0.92f, 0.96f, 1f); obj2.intensity = 1.2f; obj2.shadows = (LightShadows)0; inspectionLight.transform.rotation = Quaternion.Euler(40f, -35f, 0f); ((Component)camera).gameObject.SetActive(true); } internal static RenderTexture Target(int width, int height) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new RenderTexture(width, height, 24, (RenderTextureFormat)0, (RenderTextureReadWrite)2); } public void Dispose() { if (Object.op_Implicit((Object)(object)volumeObject)) { volumeObject.SetActive(false); Object.Destroy((Object)(object)volumeObject); } if (Object.op_Implicit((Object)(object)inspectionLight)) { inspectionLight.SetActive(false); Object.Destroy((Object)(object)inspectionLight); } } } } namespace Redzergling.PrismantlePreview { internal static class PrismantleShell { private static void BuildCarapace(GameObject root, ShellLifetime life, Func<float, float, float, Vector3> P, Material[] rock, Material[] gem, Material ivory, Material glow) { //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_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_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_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_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_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_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_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_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) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_01d3: 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_01e5: 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_01f4: 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_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: 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_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: 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_034b: 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_0219: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0221: 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_022a: 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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_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_025a: 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_0269: 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_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_041d: 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_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: 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_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) Vector2[] array = (Vector2[])(object)new Vector2[11] { new Vector2(-0.55f, 0.9f), new Vector2(0f, 1.03f), new Vector2(0.55f, 0.9f), new Vector2(0.94f, 0.5f), new Vector2(1f, -0.14f), new Vector2(0.82f, -0.72f), new Vector2(0.37f, -1.02f), new Vector2(-0.37f, -1.02f), new Vector2(-0.82f, -0.72f), new Vector2(-1f, -0.14f), new Vector2(-0.94f, 0.5f) }; Vector3[][] array2 = new Vector3[4][] { array.Select((Vector2 p) => P(p.x * 0.77f, -0.65f, p.y * 0.88f)).ToArray(), array.Select((Vector2 p) => P(p.x, -0.19f, p.y)).ToArray(), array.Select((Vector2 p) => P(p.x * 0.94f, 0.22f, p.y * 0.96f)).ToArray(), array.Select((Vector2 p) => P(p.x * 0.62f, 0.72f, p.y * 0.67f)).ToArray() }; List<Vector3>[] array3 = new List<Vector3>[3] { new List<Vector3>(), new List<Vector3>(), new List<Vector3>() }; Vector3 val = P(0f, 0f, 0f); for (int num = 0; num < array2.Length - 1; num++) { for (int num2 = 0; num2 < array.Length; num2++) { int num3 = (num2 + 1) % array.Length; Vector3 val2 = array2[num][num2]; Vector3 val3 = array2[num][num3]; Vector3 val4 = array2[num + 1][num3]; Vector3 val5 = array2[num + 1][num2]; int num4 = ((num == 0) ? 2 : ((num2 % 3 == 0) ? 1 : 0)); TriFacing(array3[num4], val2, val3, val4, (val2 + val3 + val4) / 3f - val); TriFacing(array3[num4], val2, val4, val5, (val2 + val4 + val5) / 3f - val); } } for (int num5 = 0; num5 < array.Length; num5++) { int num6 = (num5 + 1) % array.Length; TriFacing(array3[0], P(0f, 0.77f, -0.05f), array2[3][num5], array2[3][num6], P(0f, 1f, 0f) - val); TriFacing(array3[2], P(0f, -0.65f, 0f), array2[0][num6], array2[0][num5], P(0f, -1f, 0f) - val); } for (int num7 = 0; num7 < 3; num7++) { Add(root, life, "CarapaceTier" + num7, array3[num7], rock[num7]); } for (int num8 = -1; num8 <= 1; num8 += 2) { for (int num9 = 0; num9 < 3; num9++) { float num10 = 0.47f - (float)num9 * 0.49f; Wedge(root, life, "FlankScute", P((float)num8 * 0.73f, 0.27f, num10 + 0.2f), P((float)num8 * 0.98f, 0.05f, num10 + 0.15f), P((float)num8 * 0.99f, -0.33f, num10 - 0.12f), P((float)num8 * 0.75f, -0.38f, num10 - 0.21f), P((float)num8 * 1.065f, -0.04f, num10 - 0.03f), rock[num9 % 2]); } } Gem(root, life, "CrownSpine", P(0f, 0.6f, 0.12f), P(0f, 1.34f, -0.63f), P(0.05f, 1.8f, -1.12f), 0.55f, 0.46f, gem); for (int num11 = -1; num11 <= 1; num11 += 2) { Gem(root, life, "MantleInner", P((float)num11 * 0.29f, 0.55f, 0.16f), P((float)num11 * 0.42f, 1.15f, -0.55f), P((float)num11 * 0.5f, 1.57f, -1.13f), 0.69f, 0.51f, gem); Gem(root, life, "MantleShoulder", P((float)num11 * 0.6f, 0.31f, 0.25f), P((float)num11 * 0.78f, 0.8f, -0.38f), P((float)num11 * 0.95f, 1.09f, -0.97f), 0.67f, 0.46f, (Material[])(object)new Material[3] { gem[1], gem[0], gem[2] }); Gem(root, life, "RearCrystal", P((float)num11 * 0.46f, 0.37f, -0.52f), P((float)num11 * 0.62f, 0.79f, -0.94f), P((float)num11 * 0.77f, 1.02f, -1.32f), 0.52f, 0.35f, gem); Wedge(root, life, "HeavyBrow", P((float)num11 * 0.12f, 0.19f, 0.78f), P((float)num11 * 0.55f, 0.12f, 0.75f), P((float)num11 * 0.57f, -0.25f, 0.95f), P((float)num11 * 0.16f, -0.25f, 1.02f), P((float)num11 * 0.35f, -0.02f, 1.12f), rock[1]); Gem(root, life, "InsetEye", P((float)num11 * 0.24f, -0.13f, 1.02f), P((float)num11 * 0.29f, -0.16f, 1.1f), P((float)num11 * 0.39f, -0.16f, 1.09f), 0.11f, 0.07f, (Material[])(object)new Material[3] { glow, glow, glow }); Tusk(root, life, P, num11, ivory); Wedge(root, life, "UnderJawClaw", P((float)num11 * 0.52f, -0.43f, 0.68f), P((float)num11 * 0.68f, -0.48f, 0.69f), P((float)num11 * 0.66f, -0.68f, 0.89f), P((float)num11 * 0.54f, -0.69f, 0.94f), P((float)num11 * 0.59f, -0.77f, 1.12f), rock[2]); Gem(root, life, "MantleFissure", P((float)num11 * 0.56f, 0.32f, 0.25f), P((float)num11 * 0.78f, 0.16f, 0.09f), P((float)num11 * 0.97f, -0.05f, -0.12f), 0.045f, 0.038f, (Material[])(object)new Material[3] { glow, glow, glow }); } Wedge(root, life, "LowerJaw", P(-0.4f, -0.42f, 0.85f), P(0.4f, -0.42f, 0.85f), P(0.33f, -0.68f, 1.03f), P(-0.33f, -0.68f, 1.03f), P(0f, -0.39f, 1.19f), rock[2]); } private static void Gem(GameObject root, ShellLifetime life, string name, Vector3 baseCenter, Vector3 crown, Vector3 tip, float radius, float crownRadius, Material[] materials) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_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_0080: 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_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_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_00a5: 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_00bc: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00ff: 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_0106: 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_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) //IL_0146: 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_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_0164: 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_0173: 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_017a: 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_0195: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //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_01d3: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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_021e: 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_0231: 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_023f: 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) Vector3 val = tip - baseCenter; Vector3 normalized = ((Vector3)(ref val)).normalized; val = Vector3.Cross(normalized, Vector3.right); Vector3 normalized2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized2)).sqrMagnitude < 0.1f) { val = Vector3.Cross(normalized, Vector3.up); normalized2 = ((Vector3)(ref val)).normalized; } val = Vector3.Cross(normalized, normalized2); Vector3 normalized3 = ((Vector3)(ref val)).normalized; Vector3[] array = (Vector3[])(object)new Vector3[6]; Vector3[] array2 = (Vector3[])(object)new Vector3[6]; for (int i = 0; i < 6; i++) { float num = (float)i * (float)Math.PI / 3f; Vector3 val2 = normalized2 * Mathf.Cos(num) + normalized3 * Mathf.Sin(num); array[i] = baseCenter + val2 * radius; array2[i] = crown + val2 * crownRadius; } List<Vector3>[] array3 = new List<Vector3>[3] { new List<Vector3>(), new List<Vector3>(), new List<Vector3>() }; Vector3 val3 = (baseCenter + crown + tip) / 3f; for (int j = 0; j < 6; j++) { int num2 = (j + 1) % 6; int num3 = j % 3; TriFacing(array3[num3], array[j], array[num2], array2[num2], (array[j] + array[num2] + array2[num2]) / 3f - val3); TriFacing(array3[num3], array[j], array2[num2], array2[j], (array[j] + array2[num2] + array2[j]) / 3f - val3); TriFacing(array3[num3], array2[j], array2[num2], tip, (array2[j] + array2[num2] + tip) / 3f - val3); TriFacing(array3[2], array[num2], array[j], baseCenter, -normalized); } for (int k = 0; k < 3; k++) { Add(root, life, name + "Facet" + k, array3[k], materials[k]); } } private static void Tusk(GameObject root, ShellLifetime life, Func<float, float, float, Vector3> P, int s, Material material) { //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_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_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_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_00b5: 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_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_00d9: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_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_01d7: 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_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_01f5: 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_01fa: 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_01fe: 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_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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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_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_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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3[] array = (Vector3[])(object)new Vector3[4] { P((float)s * 0.46f, -0.14f, 0.93f), P((float)s * 0.58f, -0.44f, 1.09f), P((float)s * 0.61f, -0.47f, 1.29f), P((float)s * 0.53f, -0.31f, 1.48f) }; float[] array2 = new float[4] { 0.34f, 0.3f, 0.17f, 0f }; Vector3[][] array3 = new Vector3[4][]; List<Vector3> list = new List<Vector3>(); for (int i = 0; i < 4; i++) { Vector3 val = array[Mathf.Min(i + 1, 3)] - array[Mathf.Max(i - 1, 0)]; Vector3 normalized = ((Vector3)(ref val)).normalized; val = Vector3.Cross(normalized, Vector3.right); Vector3 normalized2 = ((Vector3)(ref val)).normalized; val = Vector3.Cross(normalized, normalized2); Vector3 normalized3 = ((Vector3)(ref val)).normalized; array3[i] = (Vector3[])(object)new Vector3[6]; for (int j = 0; j < 6; j++) { array3[i][j] = array[i] + (normalized2 * Mathf.Cos((float)j * (float)Math.PI / 3f) + normalized3 * Mathf.Sin((float)j * (float)Math.PI / 3f)) * array2[i]; } } for (int k = 0; k < 3; k++) { for (int l = 0; l < 6; l++) { int num = (l + 1) % 6; Vector3 val2 = array3[k][l]; Vector3 val3 = array3[k][num]; Vector3 val4 = array3[k + 1][num]; Vector3 val5 = array3[k + 1][l]; Vector3 val6 = (array[k] + array[k + 1]) * 0.5f; TriFacing(list, val2, val3, val4, (val2 + val3 + val4) / 3f - val6); if (k < 2) { TriFacing(list, val2, val4, val5, (val2 + val4 + val5) / 3f - val6); } } } Add(root, life, "CurvedIvoryTusk", list, material); } internal static GameObject Attach(CharacterBody body) { //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_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_023a: 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_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_025b: 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_025f: 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_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: 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_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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_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_02b7: 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_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_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_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0335: 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_0341: 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_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0396: 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_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_042f: 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_046d: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: 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_0528: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { throw new ArgumentException("Missing native model"); } Transform modelTransform = body.modelLocator.modelTransform; Transform[] componentsInChildren = ((Component)modelTransform).GetComponentsInChildren<Transform>(true); Transform val = ((IEnumerable<Transform>)componentsInChildren).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "Base" && Object.op_Implicit((Object)(object)t.parent) && ((Object)t.parent).name == "ROOT")); SkinnedMeshRenderer val2 = ((IEnumerable<SkinnedMeshRenderer>)((Component)modelTransform).GetComponentsInChildren<SkinnedMeshRenderer>(true)).FirstOrDefault((Func<SkinnedMeshRenderer, bool>)((SkinnedMeshRenderer r) => ((Object)r).name == "NullifierArmorMesh")); SkinnedMeshRenderer val3 = ((IEnumerable<SkinnedMeshRenderer>)((Component)modelTransform).GetComponentsInChildren<SkinnedMeshRenderer>(true)).FirstOrDefault((Func<SkinnedMeshRenderer, bool>)((SkinnedMeshRenderer r) => ((Object)r).name == "NullifierMesh")); CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>(); Transform val4 = ((IEnumerable<Transform>)componentsInChildren).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "frontThigh.l")); Transform val5 = ((IEnumerable<Transform>)componentsInChildren).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "frontThigh.r")); Transform val6 = ((IEnumerable<Transform>)componentsInChildren).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "backThigh.l")); Transform val7 = ((IEnumerable<Transform>)componentsInChildren).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "backThigh.r")); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val3) || !Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)val4) || !Object.op_Implicit((Object)(object)val5) || !Object.op_Implicit((Object)(object)val6) || !Object.op_Implicit((Object)(object)val7)) { throw new InvalidOperationException("Nullifier Base, armor or thigh anchors missing"); } GameObject val8 = new GameObject("PrismantleOriginalShell"); val8.layer = ((Component)val2).gameObject.layer; val8.transform.SetParent(val, false); ShellLifetime shellLifetime = val8.AddComponent<ShellLifetime>(); shellLifetime.armor = (Renderer)(object)val2; shellLifetime.oldForceOff = ((Renderer)val2).forceRenderingOff; try { Vector3 val9 = (val.InverseTransformPoint(val4.position) + val.InverseTransformPoint(val5.position)) * 0.5f; Vector3 val10 = (val.InverseTransformPoint(val6.position) + val.InverseTransformPoint(val7.position)) * 0.5f; Vector3 val11 = (val9 + val10) * 0.5f; float num = Mathf.Max(Vector3.Distance(val.InverseTransformPoint(val4.position), val.InverseTransformPoint(val5.position)), Vector3.Distance(val.InverseTransformPoint(val6.position), val.InverseTransformPoint(val7.position))); float num2 = Vector3.Distance(val9, val10); if (num < 0.01f || num2 < 0.01f) { throw new InvalidOperationException("Degenerate Nullifier thigh spacing"); } Vector3 val12 = val9 - val10; Vector3 forward = ((Vector3)(ref val12)).normalized; forward.y = 0f; ((Vector3)(ref forward)).Normalize(); if (((Vector3)(ref forward)).sqrMagnitude < 0.5f) { throw new InvalidOperationException("Degenerate forward axis"); } val12 = Vector3.Cross(Vector3.up, forward); Vector3 right = ((Vector3)(ref val12)).normalized; float w = num * 2.9f; float l = num2 * 3f; float h = Mathf.Min(num, num2) * 1.2f; Vector3 origin = val11 - Vector3.up * 0.9f; Func<float, float, float, Vector3> p = (float x, float y, float z) => origin + right * (x * w) + Vector3.up * (y * h) + forward * (z * l); Material val13 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.34f, 0.35f, 0.37f), glow: false); IsolateLegs(shellLifetime, val3, component, val13); Material val14 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.46f, 0.45f, 0.46f), glow: false); Material val15 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.24f, 0.25f, 0.28f), glow: false); Material val16 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.55f, 0.26f, 0.78f), glow: false); Material val17 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.72f, 0.43f, 0.9f), glow: false); Material val18 = Material(shellLifetime, (Renderer)(object)val2, new Color(0.34f, 0.13f, 0.52f), glow: false); Material[] array = (Material[])(object)new Material[3] { val16, val17, val18 }; foreach (Material obj in array) { obj.SetFloat("_Smoothness", 0.68f); obj.SetFloat("_SpecularStrength", 0.4f); obj.SetColor("_EmColor", new Color(0.13f, 0.035f, 0.24f)); obj.SetFloat("_EmPower", 0.35f); } Material ivory = Material(shellLifetime, (Renderer)(object)val2, new Color(0.9f, 0.85f, 0.7f), glow: false); Material val19 = Material(shellLifetime, (Renderer)(object)val2, new Color(1f, 0.24f, 0.035f), glow: true); BuildCarapace(val8, shellLifetime, p, (Material[])(object)new Material[3] { val13, val14, val15 }, (Material[])(object)new Material[3] { val16, val17, val18 }, ivory, val19); PrismantleLegArmor.Attach(body, val8, shellLifetime, val13, val14, val19); ((Renderer)val2).forceRenderingOff = true; return val8; } catch { Object.Destroy((Object)(object)val8); throw; } } private static void IsolateLegs(ShellLifetime life, SkinnedMeshRenderer skin, CharacterModel model, Material material) { Mesh sharedMesh = skin.sharedMesh; if (!Object.op_Implicit((Object)(object)sharedMesh) || !sharedMesh.isReadable) { throw new InvalidOperationException("NullifierMesh must be readable to isolate legs"); } BoneWeight[] weights = sharedMesh.boneWeights; Transform[] bones = skin.bones; if (weights.Length != sharedMesh.vertexCount) { throw new InvalidOperationException("NullifierMesh missing bone weights"); } bool[] leg = new bool[bones.Length]; for (int i = 0; i < bones.Length; i++) { string text = (Object.op_Implicit((Object)(object)bones[i]) ? ((Object)bones[i]).name : ""); leg[i] = text.StartsWith("frontThigh.") || text.StartsWith("frontCalf.") || text.StartsWith("frontFoot.") || text.StartsWith("frontToe.") || text.StartsWith("backThigh.") || text.StartsWith("backCalf.") || text.StartsWith("backFoot.") || text.StartsWith("backToe."); } Func<int, bool> func = delegate(int num5) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) BoneWeight val2 = weights[num5]; float num6 = 0f; if (((BoneWeight)(ref val2)).boneIndex0 < leg.Length && leg[((BoneWeight)(ref val2)).boneIndex0]) { num6 += ((BoneWeight)(ref val2)).weight0; } if (((BoneWeight)(ref val2)).boneIndex1 < leg.Length && leg[((BoneWeight)(ref val2)).boneIndex1]) { num6 += ((BoneWeight)(ref val2)).weight1; } if (((BoneWeight)(ref val2)).boneIndex2 < leg.Length && leg[((BoneWeight)(ref val2)).boneIndex2]) { num6 += ((BoneWeight)(ref val2)).weight2; } if (((BoneWeight)(ref val2)).boneIndex3 < leg.Length && leg[((BoneWeight)(ref val2)).boneIndex3]) { num6 += ((BoneWeight)(ref val2)).weight3; } return num6 >= 0.5f; }; Mesh val = Object.Instantiate<Mesh>(sharedMesh); ((Object)val).name = "PrismantleNativeLegs"; life.meshes.Add(val); int num = 0; for (int num2 = 0; num2 < sharedMesh.subMeshCount; num2++) { int[] triangles = sharedMesh.GetTriangles(num2); List<int> list = new List<int>(); for (int num3 = 0; num3 < triangles.Length; num3 += 3) { if (func(triangles[num3]) && func(triangles[num3 + 1]) && func(triangles[num3 + 2])) { list.Add(triangles[num3]); list.Add(triangles[num3 + 1]); list.Add(triangles[num3 + 2]); } } num += list.Count; val.SetTriangles(list, num2); } if (num == 0) { throw new InvalidOperationException("NullifierMesh leg filter retained no triangles"); } if (model.baseRendererInfos == null) { throw new InvalidOperationException("Nullifier CharacterModel renderer infos missing"); } RendererInfo[] array = model.baseRendererInfos.ToArray(); bool flag = false; for (int num4 = 0; num4 < array.Length; num4++) { if ((Object)(object)array[num4].renderer == (Object)(object)skin) { array[num4].defaultMaterial = material; flag = true; } } if (!flag) { throw new InvalidOperationException("NullifierMesh missing from CharacterModel renderer infos"); } life.skin = skin; life.originalMesh = sharedMesh; life.originalMaterials = ((Renderer)skin).sharedMaterials; life.characterModel = model; life.originalInfos = model.baseRendererInfos; skin.sharedMesh = val; model.baseRendererInfos = array; ((Renderer)skin).sharedMaterial = material; } private unsafe static Material Material(ShellLifetime life, Renderer source, Color color, bool glow) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //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_007e: 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_00b7: Unknown result type (might be due to invalid IL or missing references) Shader obj = Shader.Find("Hopoo Games/Deferred/Standard"); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("HGStandard shader unavailable"); } Material val = new Material(obj); life.materials.Add(val); Color val2 = color; ((Object)val).name = "Prismantle " + ((object)(*(Color*)(&val2))/*cast due to .constrained prefix*/).ToString(); if (val.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); } if (val.HasProperty("_Color")) { val.SetColor("_Color", color); } if (val.HasProperty("_EmTex")) { val.SetTexture("_EmTex", (Texture)(object)Texture2D.whiteTexture); } if (val.HasProperty("_EmColor")) { val.SetColor("_EmColor", glow ? color : Color.black); } if (val.HasProperty("_EmPower")) { val.SetFloat("_EmPower", glow ? 1f : 0f); } if (val.HasProperty("_Smoothness")) { val.SetFloat("_Smoothness", 0.2f); } if (val.HasProperty("_SpecularStrength")) { val.SetFloat("_SpecularStrength", 0.12f); } if (val.HasProperty("_NormalStrength")) { val.SetFloat("_NormalStrength", 0f); } if (val.HasProperty("_Cull")) { val.SetFloat("_Cull", 2f); } return val; } private static void Tri(List<Vector3> faces, Vector3 a, Vector3 b, Vector3 c) { //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_000f: Unknown result type (might be due to invalid IL or missing references) faces.Add(a); faces.Add(b); faces.Add(c); } private static void TriFacing(List<Vector3> faces, Vector3 a, Vector3 b, Vector3 c, Vector3 outward) { //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_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_0013: 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_002e: 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_0024: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(Vector3.Cross(b - a, c - a), outward) < 0f) { Tri(faces, a, c, b); } else { Tri(faces, a, b, c); } } private static void Wedge(GameObject root, ShellLifetime life, string name, Vector3 a, Vector3 b, Vector3 c, Vector3 d, Vector3 tip, Material mat) { //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_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_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_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_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_002d: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_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_003e: 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_0059: 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_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_0061: 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_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_0079: 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_0085: 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_0089: 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_008d: 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_0096: 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_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_00b3: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_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_00d0: 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_00dc: 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_00e0: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0108: 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_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_0114: 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_0123: 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) List<Vector3> list = new List<Vector3>(); Vector3 val = (a + b + c + d + tip) / 5f; TriFacing(list, a, b, tip, (a + b + tip) / 3f - val); TriFacing(list, b, c, tip, (b + c + tip) / 3f - val); TriFacing(list, c, d, tip, (c + d + tip) / 3f - val); TriFacing(list, d, a, tip, (d + a + tip) / 3f - val); TriFacing(list, a, d, c, (a + d + c) / 3f - val); TriFacing(list, a, c, b, (a + c + b) / 3f - val); Add(root, life, name, list, mat); } private static void Add(GameObject root, ShellLifetime life, string name, List<Vector3> vertices, Material mat) { //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_0012: 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_003b: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name) { layer = root.layer }; val.transform.SetParent(root.transform, false); Mesh val2 = new Mesh { name = "Prismantle " + name }; val2.SetVertices(vertices); val2.SetTriangles(Enumerable.Range(0, vertices.Count).ToArray(), 0); val2.RecalculateNormals(); val2.RecalculateBounds(); life.meshes.Add(val2); val.AddComponent<MeshFilter>().sharedMesh = val2; ((Renderer)val.AddComponent<MeshRenderer>()).sharedMaterial = mat; } } internal static class PrismantleLegArmor { internal static void Attach(CharacterBody body, GameObject shellRoot, ShellLifetime life, Material basalt, Material edge, Material seam) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform) || !Object.op_Implicit((Object)(object)shellRoot) || !Object.op_Implicit((Object)(object)life) || !Object.op_Implicit((Object)(object)basalt) || !Object.op_Implicit((Object)(object)edge) || !Object.op_Implicit((Object)(object)seam)) { throw new ArgumentException("Prismantle leg armor requires model, owner and materials"); } Transform[] componentsInChildren = ((Component)body.modelLocator.modelTransform).GetComponentsInChildren<Transform>(true); PrismantleLegArmorLifetime owner = shellRoot.AddComponent<PrismantleLegArmorLifetime>(); string[] array = new string[2] { ".l", ".r" }; foreach (string text in array) { string[] array2 = new string[2] { "front", "back" }; foreach (string text2 in array2) { Transform bone = Find(componentsInChildren, text2 + "Thigh" + text); Transform val = Find(componentsInChildren, text2 + "Calf" + text); Transform val2 = Find(componentsInChildren, text2 + "Foot" + text); Transform val3 = Find(componentsInChildren, text2 + "Toe" + text); Transform next = Find(componentsInChildren, text2 + "Toe" + text + "_end"); Segment(owner, life, bone, val, text2 + "Thigh" + text, 0.64f, 0.5f, basalt, edge, seam); Segment(owner, life, val, val2, text2 + "Calf" + text, 0.51f, 0.4f, basalt, edge, seam); Segment(owner, life, val2, val3, text2 + "Foot" + text, 0.4f, 0.3f, basalt, edge, seam); Segment(owner, life, val3, next, text2 + "Toe" + text, 0.5f, 0.12f, basalt, edge, seam, 0.1f, 0.64f); } } } private static Transform Find(Transform[] bones, string name) { Transform? obj = ((IEnumerable<Transform>)bones).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == name)); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("Missing native leg bone " + name); } return obj; } private static void Segment(PrismantleLegArmorLifetime owner, ShellLifetime life, Transform bone, Transform next, string name, float radiusStart, float radiusEnd, Material basalt, Material edge, Material seam, float startFraction = 0.12f, float endFraction = 0.88f) { //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_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_0038: 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_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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0070: 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_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_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_0085: 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_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_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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a4: 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_0108: 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_0116: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0142: 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_014e: 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_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_015e: 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_0162: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0178: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_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_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_0249: Expected O, but got Unknown //IL_01af: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_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_01c2: 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_01da: 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_01de: 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_01e9: 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_01fe: 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_0202: 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_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_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_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Expected O, but got Unknown Vector3 position = bone.position; Vector3 position2 = next.position; Vector3 val = position2 - position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.01f) { throw new InvalidOperationException("Degenerate leg segment " + name); } val /= magnitude; Vector3 val2 = bone.TransformDirection(Vector3.right); Vector3 val3 = ((Mathf.Abs(Vector3.Dot(val, val2)) < 0.9f) ? val2 : bone.TransformDirection(Vector3.forward)); Vector3 val4 = Vector3.Cross(val, val3); Vector3 normalized = ((Vector3)(ref val4)).normalized; val4 = Vector3.Cross(val, normalized); Vector3 normalized2 = ((Vector3)(ref val4)).normalized; Vector3 val5 = Vector3.Lerp(position, position2, startFraction); Vector3 val6 = Vector3.Lerp(position, position2, endFraction); List<Vector3> vertices = new List<Vector3>(); List<Vector3> normals = new List<Vector3>(); List<int>[] array = new List<int>[3] { new List<int>(), new List<int>(), new List<int>() }; for (int i = 0; i < 6; i++) { float num = (float)Math.PI * 2f * (float)i / 6f; float num2 = (float)Math.PI * 2f * (float)(i + 1) / 6f; Vector3 val7 = normalized * Mathf.Cos(num) + normalized2 * Mathf.Sin(num); Vector3 val8 = normalized * Mathf.Cos(num2) + normalized2 * Mathf.Sin(num2); Vector3 val9 = val5 + val7 * radiusStart; Vector3 b = val5 + val8 * radiusStart; Vector3 val10 = val6 + val8 * radiusEnd; Vector3 val11 = val6 + val7 * radiusEnd; int num3 = ((i == 0 || i == 3) ? 1 : 0); List<int> triangles = array[num3]; val4 = val7 + val8; Face(vertices, normals, triangles, bone, val9, b, val10, ((Vector3)(ref val4)).normalized); List<int> triangles2 = array[num3]; val4 = val7 + val8; Face(vertices, normals, triangles2, bone, val9, val10, val11, ((Vector3)(ref val4)).normalized); Face(vertices, normals, array[0], bone, val5, b, val9, -val); Face(vertices, normals, array[0], bone, val6, val11, val10, val); } Mesh val12 = new Mesh { name = "PrismantleLegArmor " + name }; life.meshes.Add(val12); val12.SetVertices(vertices); val12.SetNormals(normals); val12.subMeshCount = 3; for (int j = 0; j < 3; j++) { val12.SetTriangles(array[j], j); } val12.RecalculateBounds(); GameObject val13 = new GameObject("PrismantleLegArmor " + name); owner.pieces.Add(val13); val13.layer = ((Component)bone).gameObject.layer; val13.transform.SetParent(bone, false); val13.AddComponent<MeshFilter>().sharedMesh = val12; ((Renderer)val13.AddComponent<MeshRenderer>()).sharedMaterials = (Material[])(object)new Material[3] { basalt, edge, seam }; } private static void Face(List<Vector3> vertices, List<Vector3> normals, List<int> triangles, Transform bone, Vector3 a, Vector3 b, Vector3 c, Vector3 outward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0017: 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_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_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_0040: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_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_005b: 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_006e: 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_007c: 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_0091: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(Vector3.Cross(b - a, c - a), outward) < 0f) { Vector3 val = b; b = c; c = val; } Vector3 val2 = bone.InverseTransformPoint(a); Vector3 val3 = bone.InverseTransformPoint(b); Vector3 val4 = bone.InverseTransformPoint(c); Vector3 val5 = Vector3.Cross(val3 - val2, val4 - val2); Vector3 normalized = ((Vector3)(ref val5)).normalized; int count = vertices.Count; vertices.Add(val2); vertices.Add(val3); vertices.Add(val4); normals.Add(normalized); normals.Add(normalized); normals.Add(normalized); triangles.Add(count); triangles.Add(count + 1); triangles.Add(count + 2); } } internal sealed class PrismantleLegArmorLifetime : MonoBehaviour { internal readonly List<GameObject> pieces = new List<GameObject>(); private void OnDestroy() { foreach (GameObject piece in pieces) { if (Object.op_Implicit((Object)(object)piece)) { Object.Destroy((Object)(object)piece); } } } } internal sealed class ShellLifetime : MonoBehaviour { internal readonly List<Mesh> meshes = new List<Mesh>(); internal readonly List<Material> materials = new List<Material>(); internal Renderer armor; internal bool oldForceOff; internal SkinnedMeshRenderer skin; internal Mesh originalMesh; internal Material[] originalMaterials; internal CharacterModel characterModel; internal RendererInfo[] originalInfos; private void OnDestroy() { if (Object.op_Implicit((Object)(object)armor)) { armor.forceRenderingOff = oldForceOff; } if (Object.op_Implicit((Object)(object)skin)) { skin.sharedMesh = originalMesh; ((Renderer)skin).sharedMaterials = originalMaterials; } if (Object.op_Implicit((Object)(object)characterModel)) { characterModel.baseRendererInfos = originalInfos; } foreach (Mesh mesh in meshes) { if (Object.op_Implicit((Object)(object)mesh)) { Object.Destroy((Object)(object)mesh); } } foreach (Material material in materials) { if (Object.op_Implicit((Object)(object)material)) { Object.Destroy((Object)(object)material); } } } } } namespace Redzergling.PrismantleBoss { internal static class BossAiValidation { internal static IEnumerator Run(Action<bool, string> check, Vector3 origin, CharacterBody target) { //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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)target.healthComponent) || !Object.op_Implicit((Object)(object)PrismantleContent.Master)) { check(arg1: false, "AI fixture requires server, live target and registered master"); yield break; } Vector3 savedPosition = ((Component)target).transform.position; bool savedMotorEnabled = Object.op_Implicit((Object)(object)target.characterMotor) && ((Behaviour)target.characterMotor).enabled; float savedMax = target.baseMaxHealth; float savedLevelHealth = target.levelMaxHealth; float savedRegen = target.baseRegen; float savedHealth = target.healthComponent.health; CharacterMaster master = null; try { target.baseMaxHealth = 100000f; target.levelMaxHealth = 0f; target.baseRegen = 0f; target.RecalculateStats(); target.healthComponent.health = target.maxHealth; if (Object.op_Implicit((Object)(object)target.characterMotor)) { target.characterMotor.velocity = Vector3.zero; ((Behaviour)target.characterMotor).enabled = false; } Place(target, origin + Vector3.forward * 7f); master = new MasterSummon { masterPrefab = PrismantleContent.Master, position = origin + Vector3.up * 2f, rotation = Quaternion.identity, teamIndexOverride = (TeamIndex)2, ignoreTeamMemberLimit = true, useAmbientLevel = false, preSpawnSetupCallback = delegate(CharacterMaster m) { m.preventGameOver = true; } }.Perform(); check(Object.op_Implicit((Object)(object)master), "AI native master spawned"); if (!Object.op_Implicit((Object)(object)master)) { yield break; } float deadline = Time.time + 5f; while (Object.op_Implicit((Object)(object)master) && !Object.op_Implicit((Object)(object)master.GetBody()) && Time.time < deadline) { yield return null; } CharacterBody body = (Object.op_Implicit((Object)(object)master) ? master.GetBody() : null); check(Object.op_Implicit((Object)(object)body), "AI native body spawned"); if (!Object.op_Implicit((Object)(object)body)) { yield break; } body.AddBuff(Buffs.HiddenInvincibility); float modelDeadline = Time.realtimeSinceStartup + 12f; PrismantleModel model = ((Component)body).GetComponent<PrismantleModel>(); while (Object.op_Implicit((Object)(object)body) && (!Object.op_Implicit((Object)(object)model) || !model.Ready) && Time.realtimeSinceStartup < modelDeadline) { yield return null; if (Object.op_Implicit((Object)(object)body) && !Object.op_Implicit((Object)(object)model)) { model = ((Component)body).GetComponent<PrismantleModel>(); } } check(Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)model) && model.Ready, "AI authored model ready within 12 seconds before observation"); if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)model) || !model.Ready) { yield break; } BaseAI ai = ((Component)master).GetComponent<BaseAI>(); EntityStateMachine weapon = ((IEnumerable<EntityStateMachine>)((Component)body).GetComponents<EntityStateMachine>()).FirstOrDefault((Func<EntityStateMachine, bool>)((EntityStateMachine s) => s.customName == "Weapon")); check(Object.op_Implicit((Object)(object)ai) && ((Behaviour)ai).enabled && Object.op_Implicit((Object)(object)weapon), "AI BaseAI enabled and native Weapon machine present"); if (!Object.op_Implicit((Object)(object)ai) || !Object.op_Implicit((Object)(object)weapon)) { yield break; } HashSet<string> observed = new HashSet<string>(); bool acquired = false; bool aimStayedCommitted = true; int lockedSamples = 0; Vector3 firstPosition = CombatGeometry.MotorPosition(body); float furthest = 0f; string lastState = null; for (int phase = 0; phase < 2; phase++) { float num = ((phase == 0) ? 7f : 25f); float seconds = ((phase == 0) ? 6f : 12f); Place(target, body.footPosition + ((phase == 0) ? Vector3.forward : Vector3.right) * num); float started = Time.time; float nextTrace = started; while (Time.time - started < seconds && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)target) && target.healthComponent.alive) { string text = ((weapon.state == null) ? "null" : ((object)weapon.state).GetType().Name); observed.Add(text); Vector3 val; if (weapon.state is PrismantleAttackState { PresentationAge: >0.06f } prismantleAttackState && Object.op_Implicit((Object)(object)body.inputBank)) { lockedSamples++; bool num2 = aimStayedCommitted; val = body.inputBank.aimDirection; Vector3 normalized = ((Vector3)(ref val)).normalized; val = prismantleAttackState.Direction; aimStayedCommitted = num2 & (Vector3.Dot(normalized, ((Vector3)(ref val)).normalized) > 0.995f); val = Vector3.ProjectOnPlane(prismantleAttackState.Direction, Vector3.up); Vector3 normalized2 = ((Vector3)(ref val)).normalized; if (Object.op_Implicit((Object)(object)body.characterDirection) && ((Vector3)(ref normalized2)).sqrMagnitude > 0.001f) { aimStayedCommitted &= Vector3.Dot(body.characterDirection.forward, normalized2) > 0.995f; } } acquired |= (Object)(object)ai.currentEnemy.gameObject == (Object)(object)((Component)target).gameObject; Vector3 val2 = CombatGeometry.MotorPosition(body); float num3 = furthest; val = Vector3.ProjectOnPlane(val2 - firstPosition, Vector3.up); furthest = Mathf.Max(num3, ((Vector3)(ref val)).magnitude); if (text != lastState || Time.time >= nextTrace) { check(arg1: true, "AI trace phase=" + phase + " elapsed=" + (Time.time - started).ToString("F2") + " weapon=" + text + " position=" + ((Vector3)(ref val2)).ToString("F2") + " targetDistance=" + Vector3.Distance(body.corePosition, target.corePosition).ToString("F2") + " acquiredTarget=" + ((Object)(object)ai.currentEnemy.gameObject == (Object)(object)((Component)target).gameObject)); lastState = text; nextTrace = Time.time + 1f; } yield return null; } check(Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)target) && target.healthComponent.alive, "AI phase " + phase + " bodies remain alive"); if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)target)) { break; } } check(acquired, "AI naturally acquired stationary Player target"); check(lockedSamples > 0 && aimStayedCommitted, "AI aim/facing remain committed through active attacks; samples=" + lockedSamples); check(observed.Contains("Shatterclaw"), "AI naturally selected Shatterclaw; observed=" + string.Join(",", observed.ToArray())); check(observed.Contains("PrismVolley"), "AI naturally selected PrismVolley"); check(observed.Contains("BasaltRush"), "AI naturally selected BasaltRush"); check(furthest > 2f && furthest < 70f, "AI actual horizontal displacement bounded; maximum=" + furthest.ToString("F2")); } finally { if (Object.op_Implicit((Object)(object)master)) { master.DestroyBody(); NetworkServer.Destroy(((Component)master).gameObject); } if (Object.op_Implicit((Object)(object)target)) { target.baseMaxHealth = savedMax; target.levelMaxHealth = savedLevelHealth; target.baseRegen = savedRegen; target.RecalculateStats(); target.healthComponent.health = Mathf.Min(savedHealth, target.maxHealth); TeleportHelper.TeleportBody(target, savedPosition); if (Object.op_Implicit((Object)(object)target.characterMotor)) { target.characterMotor.velocity = Vector3.zero; ((Behaviour)target.characterMotor).enabled = savedMotorEnabled; } Physics.SyncTransforms(); } } } private static void Place(CharacterBody target, Vector3 foot) { //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_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) TeleportHelper.TeleportBody(target, foot + Vector3.up); if (Object.op_Implicit((Object)(object)target.characterMotor)) { target.characterMotor.velocity = Vector3.zero; } Physics.SyncTransforms(); } } internal static class BossBeastGoldenValidation { [Serializable] private sealed class Golden { public string schema; public string result; public string model_sha256; public int[] section_vertex_counts; public Vector3 rest_min; public Vector3 rest_max; public RestSample[] rest_samples; public Frame[] frames; } [Serializable] private sealed class RestSample { public int section; public int vertex; public Vector3 rest; } [Serializable] private sealed class Sample { public int section; public int vertex; public Vector3 expected; } [Serializable] private sealed class Bone { public string name; public float[] m; } [Serializable] private sealed class Frame { public string clip; public float normalized; public float duration; public int native_key; public int native_key_count; public Sample[] samples; public Bone[] bones; } internal static void Run(Action<bool, string> check, CharacterBody boss, string goldenPath) { //IL_0b79: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0ba6: 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_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_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) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: 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_02dd: 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_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Expected O, but got Unknown //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_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_030d: 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_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: 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_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_068c: 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_069d: 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_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0823: 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_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_09ee: Unknown result type (might be due to invalid IL or missing references) if (check == null) { throw new ArgumentNullException("check"); } PrismantleModel prismantleModel = (Object.op_Implicit((Object)(object)boss) ? ((Component)boss).GetComponent<PrismantleModel>() : null); PrismantleBeastAssets prismantleBeastAssets = ((Object.op_Implicit((Object)(object)prismantleModel) && prismantleModel.Ready && Object.op_Implicit((Object)(object)prismantleModel.Shell)) ? prismantleModel.Shell.GetComponent<PrismantleBeastAssets>() : null); if (!Object.op_Implicit((Object)(object)prismantleBeastAssets) || prismantleBeastAssets.Bones == null || prismantleBeastAssets.Renderers == null) { check(arg1: false, "Beast golden requires initialized actual Beast rig"); return; } Vector3[] array = (Vector3[])(object)new Vector3[prismantleBeastAssets.Bones.Length]; Quaternion[] array2 = (Quaternion[])(object)new Quaternion[array.Length]; Vector3[] array3 = (Vector3[])(object)new Vector3[array.Length]; for (int i = 0; i < array.Length; i++) { array[i] = prismantleBeastAssets.Bones[i].localPosition; array2[i] = prismantleBeastAssets.Bones[i].localRotation; array3[i] = prismantleBeastAssets.Bones[i].localScale; } PrismantleBeastMotion motion = prismantleBeastAssets.Motion; bool enabled = Object.op_Implicit((Object)(object)motion) && ((Behaviour)motion).enabled; Mesh[] array4 = (Mesh[])(object)new Mesh[prismantleBeastAssets.Renderers.Length]; try { if (Object.op_Implicit((Object)(object)motion)) { ((Behaviour)motion).enabled = false; } FileInfo fileInfo = new FileInfo(goldenPath); if (!fileInfo.Exists || fileInfo.Length > 33554432) { throw new InvalidDataException("Missing/oversized offline Beast golden"); } Golden golden = JsonUtility.FromJson<Golden>(File.ReadAllText(goldenPath)); if (golden == null || golden.schema != "PrismantleBeastGolden1" || golden.result != "PASS" || golden.frames == null || golden.frames.Length != 40) { throw new InvalidDataException("Golden requires actual8clips x5native keyframes"); } string a; using (Stream stream = typeof(PrismantleBeastAssets).Assembly.GetManifestResourceStream("Redzergling.Prismantle.Beast." + prismantleBeastAssets.Definition.model.Replace('/', '.').Replace('\\', '.'))) { using SHA256 sHA = SHA256.Create(); if (stream == null) { throw new FileNotFoundException("Missing actual embedded Beast model"); } a = BitConverter.ToString(sHA.ComputeHash(stream)).Replace("-", ""); } if (!string.Equals(a, golden.model_sha256, StringComparison.OrdinalIgnoreCase)) { throw new InvalidDataException("Golden modelhash differs actual embedded PBM"); } if (golden.section_vertex_counts == null || golden.section_vertex_counts.Length != array4.Length) { throw new InvalidDataException("Golden section count mismatch"); } for (int j = 0; j < array4.Length; j++) { if (prismantleBeastAssets.Renderers[j].sharedMesh.vertexCount != golde
BepInEx/plugins/Redzergling-Pantheon/Pantheon.Oathfall.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using KinematicCharacterController; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using R2API; using Redzergling.Pantheon.Oathfall.FullscaleDraft; using Redzergling.Pantheon.Oathfall.FullscaleNavDraft; using Redzergling.Pantheon.Oathfall.ValidationDraft; using RoR2; using RoR2.AsyncManagement; using RoR2.CharacterAI; using RoR2.Navigation; using RoR2.Networking; using Unity.Profiling; using Unity.Profiling.LowLevel.Unsafe; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Redzergling.Pantheon.Oathfall { public sealed class OathfallAmbientLife : MonoBehaviour { private Mesh mesh; private Material ownedMaterial; private Texture2D ownedAlbedo; private Vector3[] rest; private Vector3[] animated; private Vector3[] bend; private float[] phases; private float[] weights; private float nextTick; public int tuftCount; public static GameObject Build(GameObject details, Material matteStone, bool reducedEffects = false) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)details) || !Object.op_Implicit((Object)(object)matteStone) || reducedEffects) { return null; } Transform val = details.transform.Find("OathfallAmbientLife"); if (Object.op_Implicit((Object)(object)val)) { return ((Component)val).gameObject; } OathfallDetailLifetime component = details.GetComponent<OathfallDetailLifetime>(); if (!Object.op_Implicit((Object)(object)component)) { return null; } int num = Math.Min(component.ambientAnchors.Count, 96); if (num == 0) { return null; } GameObject val2 = new GameObject("OathfallAmbientLife"); val2.layer = LayerIndex.world.intVal; val2.transform.SetParent(details.transform, false); OathfallAmbientLife oathfallAmbientLife = val2.AddComponent<OathfallAmbientLife>(); try { oathfallAmbientLife.Create(component, matteStone, num); return val2; } catch { Object.Destroy((Object)(object)val2); throw; } } private void Create(OathfallDetailLifetime source, Material material, int count) { //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_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_00be: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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) //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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Expected O, but got Unknown //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: 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_0718: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Expected O, but got Unknown //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_0794: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07da: 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_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0837: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_016b: 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_0172: 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_0187: 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_0238: 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_023e: 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_0252: 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_0260: 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_026a: 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_026e: 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_027c: 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_0286: 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_0294: 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_029e: 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_02ac: 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_02b6: 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_02ba: 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_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: 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_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: 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) //IL_0305: 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_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: 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_0349: 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_0357: 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_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0397: 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_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: 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_03c8: 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_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: 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_03f3: 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_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0404: 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_0441: 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_0446: 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_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0523: 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_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: 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_053e: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) tuftCount = count; int num = count * 42; rest = (Vector3[])(object)new Vector3[num]; animated = (Vector3[])(object)new Vector3[num]; bend = (Vector3[])(object)new Vector3[num]; phases = new float[num]; weights = new float[num]; Vector2[] array = (Vector2[])(object)new Vector2[num]; Color[] array2 = (Color[])(object)new Color[num]; int[] array3 = new int[count * 90]; for (int i = 0; i < count; i++) { int num2 = (count + 3) / 4; int num3 = i / 4 * (source.ambientAnchors.Count / 4) / num2; int index = num3 * 4 + i % 4; Vector3 val = source.ambientNormals[index]; Vector3 val2 = source.ambientAnchors[index] + val * 0.03f; Vector3 val3 = Vector3.Cross(val, Vector3.forward); Vector3 normalized = ((Vector3)(ref val3)).normalized; Vector3 val4 = Vector3.Cross(val, normalized); int num4 = (num3 + (int)Mathf.Floor(Mathf.Abs(val2.y) * 0.031f)) % 3; float num5 = 0.78f + 0.28f * (0.5f + 0.5f * Mathf.Sin((float)num3 * 2.17f)); for (int j = 0; j < 3; j++) { float num6 = (float)i * 2.39996f + (float)j * 1.73f; Vector3 val5 = normalized * Mathf.Cos(num6) + val4 * Mathf.Sin(num6); Vector3 val6 = Vector3.Cross(val, val5); Vector3 val7 = val2 + val5 * (0.08f + (float)j * 0.07f); float num7 = 0.76f + 0.31f * (0.5f + 0.5f * Mathf.Sin((float)i * 3.71f + (float)j * 2.13f)); float num8 = num4 switch { 1 => 0.48f, 0 => 0.8f, _ => 0.65f, } * num7 * num5; float num9 = num4 switch { 1 => 0.4f, 0 => 0.3f, _ => 0.17f, } * num7; float num10 = num4 switch { 1 => 0.115f, 0 => 0.06f, _ => 0.04f, } * (1f + (float)j * 0.13f); Vector3 val8 = val7 + val * num8 * 0.34f + val5 * num9 * 0.13f; Vector3 val9 = val7 + val * num8 * 0.74f + val5 * num9 * 0.57f + val6 * num9 * 0.11f; Vector3 val10 = val7 + val * num8 * num4 switch { 1 => 0.82f, 0 => 0.69f, _ => 1f, } + val5 * num9 + val6 * num9 * 0.2f; int num11 = i * 42 + j * 14; Vector3[] array4 = (Vector3[])(object)new Vector3[7] { val7 - val6 * num10 * 0.23f, val7 + val6 * num10 * 0.23f, val8 - val6 * num10 * ((num4 == 1) ? 1f : 0.65f), val8 + val6 * num10 * ((num4 == 1) ? 1f : 0.65f), val9 - val6 * num10 * 0.55f, val9 + val6 * num10 * 0.55f, val10 }; Color val11 = ((num4 == 2) ? new Color(0.43f, 0.44f, 0.29f, 1f) : new Color(0.29f, 0.43f, 0.36f, 1f)); Color val12 = ((num4 == 2) ? new Color(0.55f, 0.49f, 0.31f, 1f) : new Color(0.46f, 0.51f, 0.35f, 1f)); float num12 = 0.5f + 0.5f * Mathf.Sin((float)num3 * 1.31f + (float)i * 0.43f + (float)j); for (int k = 0; k < 14; k++) { int num13 = k % 7; rest[num11 + k] = ((Component)this).transform.InverseTransformPoint(array4[num13]); animated[num11 + k] = rest[num11 + k]; bend[num11 + k] = ((Component)this).transform.InverseTransformVector(val5 * ((num4 == 1) ? 0.024f : 0.046f) + val6 * 0.013f); weights[num11 + k] = ((num13 < 2) ? 0f : ((num13 < 4) ? 0.18f : ((num13 < 6) ? 0.63f : 1f))); phases[num11 + k] = num6; array[num11 + k] = OathfallDetailPalette.UV(num4, 3, num12, (num13 < 2) ? 0f : ((num13 < 4) ? 0.34f : ((num13 < 6) ? 0.74f : 1f))); array2[num11 + k] = Color.Lerp(val11, val12, Mathf.Clamp01(num12 * 0.72f + (float)num13 / 6f * 0.18f)); } int num14 = i * 90 + j * 30; int[] array5 = new int[30] { 0, 2, 1, 1, 2, 3, 2, 4, 3, 3, 4, 5, 4, 6, 5, 8, 9, 7, 10, 9, 8, 10, 11, 9, 12, 11, 10, 12, 13, 11 }; for (int l = 0; l < 30; l++) { array3[num14 + l] = num11 + array5[l]; } } } mesh = new Mesh { name = "Oathfall-local-root-grass" }; mesh.MarkDynamic(); mesh.vertices = animated; mesh.triangles = array3; mesh.uv = array; mesh.colors = array2; mesh.RecalculateNormals(); mesh.RecalculateBounds(); Bounds bounds = mesh.bounds; ((Bounds)(ref bounds)).Expand(0.18f); mesh.bounds = bounds; ((Component)this).gameObject.AddComponent<MeshFilter>().sharedMesh = mesh; MeshRenderer val13 = ((Component)this).gameObject.AddComponent<MeshRenderer>(); ownedMaterial = new Material(material) { name = "Oathfall-matte-alien-brush" }; ownedAlbedo = OathfallDetailPalette.Create("Oathfall-muted-plant-albedo", (Color[])(object)new Color[3] { new Color(0.29f, 0.43f, 0.36f, 1f), new Color(0.29f, 0.43f, 0.36f, 1f), new Color(0.43f, 0.44f, 0.29f, 1f) }, (Color[])(object)new Color[3] { new Color(0.46f, 0.51f, 0.35f, 1f), new Color(0.46f, 0.51f, 0.35f, 1f), new Color(0.55f, 0.49f, 0.31f, 1f) }); OathfallDetailPalette.Bind(ownedMaterial, ownedAlbedo); if (ownedMaterial.HasProperty("_EmColor")) { ownedMaterial.SetColor("_EmColor", Color.black); } if (ownedMaterial.HasProperty("_EmPower")) { ownedMaterial.SetFloat("_EmPower", 0f); } if (ownedMaterial.HasProperty("_Smoothness")) { ownedMaterial.SetFloat("_Smoothness", 0f); } if (ownedMaterial.HasProperty("_SpecularStrength")) { ownedMaterial.SetFloat("_SpecularStrength", 0f); } ((Renderer)val13).sharedMaterial = ownedMaterial; ((Renderer)val13).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val13).receiveShadows = true; } private void Update() { //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_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_0082: Unknown result type (might be due to invalid IL or missing references) if (NetworkClient.active && Object.op_Implicit((Object)(object)mesh) && !(Time.time < nextTick)) { nextTick = Time.time + 0.125f; for (int i = 0; i < animated.Length; i++) { animated[i] = rest[i] + bend[i] * (weights[i] * Mathf.Sin(Time.time * 0.68f + phases[i])); } mesh.vertices = animated; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mesh)) { Object.Destroy((Object)(object)mesh); } mesh = null; if (Object.op_Implicit((Object)(object)ownedMaterial)) { Object.Destroy((Object)(object)ownedMaterial); } ownedMaterial = null; if (Object.op_Implicit((Object)(object)ownedAlbedo)) { Object.Destroy((Object)(object)ownedAlbedo); } ownedAlbedo = null; } } internal sealed class OathfallArchFootings : MonoBehaviour { private readonly List<Mesh> owned = new List<Mesh>(); internal int supports; internal int sections; internal float largestGap; internal static void Build(GameObject geometry) { //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_017a: 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_018b: 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_01a1: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: 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_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Expected O, but got Unknown //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0619: 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_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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_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_0200: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_0270: 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_0276: 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_0282: 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_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: 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_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: 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_0300: 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_030c: 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_031b: 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_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: 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_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) OathfallArchFootings oathfallArchFootings = geometry.AddComponent<OathfallArchFootings>(); DraftRoute[] tunnelPaths = OathfallDraftTerrain.TunnelPaths; foreach (DraftRoute draftRoute in tunnelPaths) { string text = draftRoute.id.Replace("-covered", ""); Transform val = geometry.transform.Find(text + "-carved-root-shell"); Transform val2 = geometry.transform.Find(text + "-mineral-ridge"); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { throw new InvalidOperationException("Arch support source missing: " + text); } DraftRoute draftRoute2 = null; DraftRoute[] groundRoutes = OathfallDraftTerrain.GroundRoutes; foreach (DraftRoute draftRoute3 in groundRoutes) { if (draftRoute3.id == text) { draftRoute2 = draftRoute3; } } if (draftRoute2 == null) { throw new InvalidOperationException("Arch support route missing: " + text); } Vector3[] vertices = ((Component)val).GetComponent<MeshCollider>().sharedMesh.vertices; Vector3[] vertices2 = ((Component)val2).GetComponent<MeshCollider>().sharedMesh.vertices; int num = OathfallRootMouthGeometry.CanonicalVertexCount(((Object)val).name) / 38; if (num != draftRoute.points.Length || vertices2.Length < draftRoute2.points.Length * 8) { throw new InvalidOperationException("Arch support topology changed"); } for (int k = 0; k < 2; k++) { List<Vector3> list = new List<Vector3>(); List<int> list2 = new List<int>(); Vector3 val7; for (int l = 0; l < num; l++) { Vector3 val3 = vertices[l * 38 + ((k != 0) ? 18 : 0)]; Vector3 val4 = vertices[l * 38 + ((k == 0) ? 19 : 37)]; Vector3 val5 = vertices[l * 38 + 18] - vertices[l * 38]; val5.y = 0f; ((Vector3)(ref val5)).Normalize(); Vector3 forward = Vector3.Cross(val5, Vector3.up); Vector3 val6 = Section(vertices2, draftRoute2.points.Length, (k != 0) ? 2 : 0, draftRoute.points[l], forward); val7 = Vector3.ProjectOnPlane(val3 - val6, Vector3.up); float magnitude = ((Vector3)(ref val7)).magnitude; if (magnitude > 18f || Mathf.Abs(val3.y - val6.y) > 4f) { throw new InvalidOperationException("Unsupported arch foundation span: " + text + " " + magnitude); } oathfallArchFootings.largestGap = Mathf.Max(oathfallArchFootings.largestGap, magnitude); Vector3 val8 = val5 * (float)((k == 0) ? 1 : (-1)); list.Add(val6 + val8 * 0.08f - Vector3.up * 0.025f); list.Add(val3 - val8 * 0.35f + Vector3.up * 0.35f); list.Add(val4 + val8 * 0.35f + Vector3.up * 0.35f); list.Add(val6 + val8 * 0.35f - Vector3.up * 8f); if (l == 0 || l == num - 1) { Vector3 val9 = ((l == 0) ? (draftRoute.points[1] - draftRoute.points[0]) : (draftRoute.points[num - 2] - draftRoute.points[num - 1])); val9.y = 0f; ((Vector3)(ref val9)).Normalize(); for (int m = list.Count - 4; m < list.Count; m++) { List<Vector3> list3 = list; int j = m; list3[j] += val9 * 0.35f; } } oathfallArchFootings.sections++; } for (int n = 0; n < num - 1; n++) { for (int num2 = 0; num2 < 4; num2++) { int num3 = n * 4 + num2; int num4 = n * 4 + (num2 + 1) % 4; int c = num3 + 4; int b = num4 + 4; Tri(list2, num3, num4, c); Tri(list2, num4, b, c); } } Tri(list2, 0, 2, 1); Tri(list2, 0, 3, 2); int num5 = (num - 1) * 4; Tri(list2, num5, num5 + 1, num5 + 2); Tri(list2, num5, num5 + 2, num5 + 3); double num6 = 0.0; for (int num7 = 0; num7 < list2.Count; num7 += 3) { Vector3 val10 = list[list2[num7]]; Vector3 val11 = list[list2[num7 + 1]]; Vector3 val12 = list[list2[num7 + 2]]; val7 = Vector3.Cross(val11 - val10, val12 - val10); if (((Vector3)(ref val7)).sqrMagnitude < 1E-10f) { throw new InvalidOperationException("Degenerate arch footing"); } num6 += (double)Vector3.Dot(val10, Vector3.Cross(val11, val12)) / 6.0; } if (num6 < 0.0) { for (int num8 = 0; num8 < list2.Count; num8 += 3) { int value = list2[num8 + 1]; list2[num8 + 1] = list2[num8 + 2]; list2[num8 + 2] = value; } } Mesh val13 = new Mesh { name = text + "-arch-footing-" + k }; oathfallArchFootings.owned.Add(val13); val13.SetVertices(list); val13.SetTriangles(list2, 0); val13.RecalculateNormals(); val13.RecalculateBounds(); GameObject val14 = new GameObject(((Object)val13).name) { layer = LayerIndex.world.intVal }; val14.transform.SetParent(geometry.transform, false); val14.AddComponent<MeshFilter>().sharedMesh = val13; ((Renderer)val14.AddComponent<MeshRenderer>()).sharedMaterial = ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).sharedMaterials[1]; val14.AddComponent<MeshCollider>().sharedMesh = val13; oathfallArchFootings.supports++; } } Physics.SyncTransforms(); Debug.Log((object)("OATHFALL arch footings closedSupports=" + oathfallArchFootings.supports + " anchoredSections=" + oathfallArchFootings.sections + " maximumOldGap=" + oathfallArchFootings.largestGap + " originalTreadsUnchanged=True")); } private static Vector3 Section(Vector3[] points, int count, int corner, Vector3 centre, Vector3 forward) { //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) //IL_001e: 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_002e: 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_0035: 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_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_0046: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_007e: 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_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_0099: 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) float num = float.PositiveInfinity; Vector3 result = Vector3.zero; for (int i = 0; i < count - 1; i++) { Vector3 val = points[i * 8 + corner]; Vector3 val2 = points[(i + 1) * 8 + corner]; float num2 = Vector3.Dot(val - centre, forward); float num3 = Vector3.Dot(val2 - centre, forward); if (!(num2 * num3 > 0f) && !(Mathf.Abs(num2 - num3) < 1E-07f)) { Vector3 val3 = Vector3.LerpUnclamped(val, val2, num2 / (num2 - num3)); Vector3 val4 = val3 - centre; float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = val3; } } } if (float.IsInfinity(num)) { throw new InvalidOperationException("No actual ridge cross-section under arch"); } return result; } private static void Tri(List<int> t, int a, int b, int c) { t.Add(a); t.Add(b); t.Add(c); } private void OnDestroy() { foreach (Mesh item in owned) { if (Object.op_Implicit((Object)(object)item)) { Object.Destroy((Object)(object)item); } } owned.Clear(); } } internal static class OathfallArchSurface { internal static void Build(GameObject geometry) { MeshFilter[] componentsInChildren = geometry.GetComponentsInChildren<MeshFilter>(); foreach (MeshFilter val in componentsInChildren) { int num = ((Object)val).name.IndexOf("-arch-footing-", StringComparison.Ordinal); if (num >= 0) { Transform val2 = geometry.transform.Find(((Object)val).name.Substring(0, num) + "-carved-root-shell"); if (!Object.op_Implicit((Object)(object)val2)) { throw new InvalidOperationException("Missing arch surface parent"); } MeshRenderer component = ((Component)val).GetComponent<MeshRenderer>(); Material[] sharedMaterials = ((Renderer)component).sharedMaterials; sharedMaterials[4] = ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).sharedMaterials[4]; ((Renderer)component).sharedMaterials = sharedMaterials; Mesh sharedMesh = val.sharedMesh; int[] triangles = sharedMesh.triangles; for (int j = 0; j < sharedMesh.subMeshCount; j++) { sharedMesh.SetTriangles(Array.Empty<int>(), j); } sharedMesh.SetTriangles(triangles, 4); } } } } internal sealed class OathfallAtmosphere : MonoBehaviour { private sealed class SkyView { internal Camera camera; internal Mesh mesh; internal Mesh sunMesh; internal Color[] colors; internal Color[] sunColors; internal Vector3[] sunVertices; internal Quaternion rotation; internal float fov; internal float aspect; internal bool colored; internal bool submitted; internal bool sunReported; internal bool sunDrawReported; internal int used; internal int cloudTick; } private const string ShaderKey = "RoR2/Base/Shaders/HGVertexOnly.shader"; private const int Columns = 64; private const int Rows = 32; private const int MaxCameras = 6; private const int SunSegments = 64; private readonly List<SkyView> views = new List<SkyView>(); private AsyncOperationHandle<Shader> shaderHandle; private bool requested; private bool subscribed; private Material sky; private Material sunMaterial; private Vector3 sunset; private Light ownedSun; private static OathfallAtmosphere instance; private int submissions; private int sunSubmissions; private string skyError; internal static Vector3 SunDirection { get { //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_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_004e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)instance) || !Object.op_Implicit((Object)(object)instance.ownedSun)) { Vector3 val = new Vector3(-0.4f, 0.19f, 0.9f); return ((Vector3)(ref val)).normalized; } return -((Component)instance.ownedSun).transform.forward; } } internal static bool SkyReady { get { //IL_0029: 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) if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.sky) && instance.subscribed && SceneManager.GetActiveScene() == ((Component)instance).gameObject.scene) { return instance.skyError == null; } return false; } } internal static int SkySubmissions { get { if (!Object.op_Implicit((Object)(object)instance)) { return 0; } return instance.submissions; } } internal static string SkyStatus { get { if (!Object.op_Implicit((Object)(object)instance)) { return "no owned atmosphere"; } return "requested=" + instance.requested + " loaded=" + Object.op_Implicit((Object)(object)instance.sky) + " subscribed=" + instance.subscribed + " cameraMeshes=" + instance.views.Count + " submissions=" + instance.submissions + " sunSubmissions=" + instance.sunSubmissions + " ownedSun=" + Object.op_Implicit((Object)(object)instance.ownedSun) + " error=" + (instance.skyError ?? "NONE"); } } private static float CosmeticClock { get { if (!Object.op_Implicit((Object)(object)Run.instance)) { return Time.time; } return Run.instance.GetRunStopwatch(); } } internal unsafe static void Build(GameObject owned) { //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_0062: 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: Invalid comparison between Unknown and I4 //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_00c2: 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_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_00db: 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_011c: 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_0142: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)owned) || SceneManager.GetActiveScene() != owned.scene) { throw new InvalidOperationException("Atmosphere requires the active owned scene"); } if (!Object.op_Implicit((Object)(object)owned.GetComponent<OathfallAtmosphere>())) { OathfallAtmosphere oathfallAtmosphere = (instance = owned.AddComponent<OathfallAtmosphere>()); OathfallNativeFog.Build(owned); RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)1; RenderSettings.fogColor = new Color(0.46f, 0.46f, 0.49f); RenderSettings.fogStartDistance = 160f; RenderSettings.fogEndDistance = 1000f; RenderSettings.skybox = null; oathfallAtmosphere.ownedSun = owned.GetComponent<Light>(); if (Object.op_Implicit((Object)(object)oathfallAtmosphere.ownedSun) && (int)oathfallAtmosphere.ownedSun.type == 1) { Vector3 val = new Vector3(-0.4f, 0.19f, 0.9f); Vector3 normalized = ((Vector3)(ref val)).normalized; ((Component)oathfallAtmosphere.ownedSun).transform.rotation = Quaternion.LookRotation(-normalized, Vector3.up); Light obj = oathfallAtmosphere.ownedSun; obj.intensity *= 1.08f; oathfallAtmosphere.ownedSun.color = new Color(1f, 0.685f, 0.43f); RenderSettings.sun = oathfallAtmosphere.ownedSun; string[] obj2 = new string[5] { "OATHFALL owned orange sun direction=", null, null, null, null }; val = normalized; obj2[1] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); obj2[2] = " intensity="; obj2[3] = oathfallAtmosphere.ownedSun.intensity.ToString(); obj2[4] = " colorAndIntensityFixed=True orientationFixed=True"; Debug.Log((object)string.Concat(obj2)); } else { oathfallAtmosphere.ownedSun = null; } oathfallAtmosphere.ConfigureLighting(owned); oathfallAtmosphere.sunset = SunDirection; oathfallAtmosphere.sunset.y = 0f; ((Vector3)(ref oathfallAtmosphere.sunset)).Normalize(); ((MonoBehaviour)oathfallAtmosphere).StartCoroutine(oathfallAtmosphere.LoadSky()); } } private unsafe void ConfigureLighting(GameObject owned) { //IL_0015: 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_0047: 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_0077: 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_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_00ab: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) RenderSettings.ambientMode = (AmbientMode)1; RenderSettings.ambientSkyColor = new Color(0.34f, 0.46f, 0.6f); RenderSettings.ambientEquatorColor = new Color(0.43f, 0.47f, 0.52f); RenderSettings.ambientGroundColor = new Color(0.19f, 0.25f, 0.33f); RenderSettings.ambientIntensity = 1f; GameObject val = new GameObject("OathfallCoolSkyFill"); val.transform.SetParent(owned.transform, false); Light val2 = val.AddComponent<Light>(); val2.type = (LightType)1; Transform transform = val.transform; Vector3 val3 = new Vector3(-0.4f, -0.78f, 0.48f); transform.rotation = Quaternion.LookRotation(((Vector3)(ref val3)).normalized, Vector3.up); val2.color = new Color(0.64f, 0.75f, 0.91f); val2.intensity = 0.24f; val2.shadows = (LightShadows)0; val2.renderMode = (LightRenderMode)1; val3 = -((Component)val2).transform.forward; Debug.Log((object)("OATHFALL lighting ambientMode=Trilight ambientIntensity=1 coolSkyFill=.24 towardFill=" + ((object)(*(Vector3*)(&val3))/*cast due to .constrained prefix*/).ToString() + " fixedDirection=True fillShadows=False nativeLitMaterialsUnchanged=True exposureUnchanged=True")); } private IEnumerator LoadSky() { try { shaderHandle = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGVertexOnly.shader"); requested = true; } catch (Exception ex) { skyError = ex.ToString(); Debug.LogWarning((object)("OATHFALL sky shader request failed: " + ex)); } if (!requested) { yield break; } yield return shaderHandle; if (Object.op_Implicit((Object)(object)this)) { if ((int)shaderHandle.Status != 1 || !Object.op_Implicit((Object)(object)shaderHandle.Result) || !shaderHandle.Result.isSupported) { skyError = "Native shader load/support failure: RoR2/Base/Shaders/HGVertexOnly.shader status=" + ((object)shaderHandle.Status/*cast due to .constrained prefix*/).ToString(); Debug.LogWarning((object)("OATHFALL sky unavailable; " + skyError)); yield break; } sky = new Material(shaderHandle.Result) { name = "Oathfall-owned-amber-blue-sky", renderQueue = 3000 }; sky.SetColor("_TintColor", Color.white); sunMaterial = new Material(sky) { name = "Oathfall-owned-orange-sun-disk", renderQueue = 3000 }; Subscribe(); Debug.Log((object)("OATHFALL sky ready shader=" + ((Object)sky.shader).name + " cameraSpecificDraw=True noCollider=True shadows=False maxCameraMeshes=6")); } } private void Subscribe() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if (!subscribed && Object.op_Implicit((Object)(object)sky) && ((Behaviour)this).isActiveAndEnabled) { Camera.onPreCull = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(DrawSky)); subscribed = true; } } private void OnEnable() { Subscribe(); } private void OnDisable() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (subscribed) { Camera.onPreCull = (CameraCallback)Delegate.Remove((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(DrawSky)); subscribed = false; } } private static void DestroyView(SkyView view) { if (Object.op_Implicit((Object)(object)view.mesh)) { Object.Destroy((Object)(object)view.mesh); } if (Object.op_Implicit((Object)(object)view.sunMesh)) { Object.Destroy((Object)(object)view.sunMesh); } } private SkyView View(Camera camera) { //IL_0177: 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_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_0235: Expected O, but got Unknown //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Expected O, but got Unknown //IL_02f1: 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) //IL_0300: Unknown result type (might be due to invalid IL or missing references) for (int num = views.Count - 1; num >= 0; num--) { if (!Object.op_Implicit((Object)(object)views[num].camera)) { DestroyView(views[num]); views.RemoveAt(num); } } foreach (SkyView view in views) { if ((Object)(object)view.camera == (Object)(object)camera) { view.used = Time.frameCount; return view; } } if (views.Count >= 6) { int index = 0; for (int i = 1; i < views.Count; i++) { if (views[i].used < views[index].used) { index = i; } } DestroyView(views[index]); views.RemoveAt(index); } Vector3[] array = (Vector3[])(object)new Vector3[2145]; int[] array2 = new int[12288]; int num2 = 0; for (int j = 0; j <= 32; j++) { for (int k = 0; k <= 64; k++) { array[j * 65 + k] = new Vector3((float)k / 64f * 2f - 1f, (float)j / 32f * 2f - 1f, 0f); } } for (int l = 0; l < 32; l++) { for (int m = 0; m < 64; m++) { int num3 = l * 65 + m; int num4 = num3 + 1; int num5 = num3 + 64 + 1; int num6 = num5 + 1; array2[num2++] = num3; array2[num2++] = num5; array2[num2++] = num4; array2[num2++] = num4; array2[num2++] = num5; array2[num2++] = num6; } } Mesh val = new Mesh { name = "Oathfall-sky-camera-" + ((Object)camera).GetInstanceID() }; val.vertices = array; val.triangles = array2; val.RecalculateBounds(); SkyView skyView = new SkyView { camera = camera, mesh = val, colors = (Color[])(object)new Color[array.Length], used = Time.frameCount }; float[] array3 = new float[4] { 0.85f, 1f, 1.35f, 2f }; skyView.sunVertices = (Vector3[])(object)new Vector3[1 + 64 * array3.Length]; List<int> list = new List<int>(); for (int n = 0; n < array3.Length; n++) { for (int num7 = 0; num7 < 64; num7++) { float num8 = (float)num7 * (float)Math.PI * 2f / 64f; skyView.sunVertices[1 + n * 64 + num7] = new Vector3(Mathf.Cos(num8), Mathf.Sin(num8), 0f) * array3[n]; int num9 = (num7 + 1) % 64; int num10 = 1 + n * 64 + num7; int num11 = 1 + n * 64 + num9; if (n == 0) { list.Add(0); list.Add(num11); list.Add(num10); continue; } int item = num10 - 64; int item2 = num11 - 64; list.Add(item); list.Add(item2); list.Add(num10); list.Add(num10); list.Add(item2); list.Add(num11); } } skyView.sunMesh = new Mesh { name = "Oathfall-sun-camera-" + ((Object)camera).GetInstanceID() }; skyView.sunMesh.vertices = skyView.sunVertices; skyView.sunMesh.triangles = list.ToArray(); skyView.sunMesh.RecalculateBounds(); skyView.sunColors = (Color[])(object)new Color[skyView.sunVertices.Length]; views.Add(skyView); return skyView; } private static float Ramp(float a, float b, float value) { return Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(a, b, value)); } private Color SkyColor(Vector3 direction, float time) { //IL_0000: 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_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_00db: 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_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_013d: 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_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_0177: 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_01ac: 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_01d3: 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_026e: 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_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Invalid comparison between Unknown and I4 //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_02a5: Unknown result type (might be due to invalid IL or missing references) float y = direction.y; Color val = default(Color); ((Color)(ref val))..ctor(0.55f, 0.42f, 0.4f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.29f, 0.38f, 0.47f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.15f, 0.22f, 0.3f); Color val4 = ((y < 0.02f) ? Color.Lerp(new Color(0.105f, 0.15f, 0.23f), val, Mathf.SmoothStep(0f, 1f, (y + 0.42f) / 0.44f)) : ((y < 0.24f) ? Color.Lerp(val, val2, Mathf.SmoothStep(0f, 1f, (y - 0.02f) / 0.22f)) : Color.Lerp(val2, val3, Mathf.SmoothStep(0f, 1f, (y - 0.24f) / 0.76f)))); Vector3 val5 = new Vector3(direction.x, 0f, direction.z); Vector3 normalized = ((Vector3)(ref val5)).normalized; float num = Mathf.Pow(Mathf.Max(0f, Vector3.Dot(normalized, sunset)), 7f) * Mathf.Exp(0f - Mathf.Pow((y - 0.035f) / 0.16f, 2f)); val4 = Color.Lerp(val4, new Color(0.94f, 0.54f, 0.27f), num * 0.74f); val4.a = 1f; float num2 = time * 0.0018f; float num3 = Mathf.PerlinNoise(normalized.x * 1.6f + 17f, y * 3.5f + normalized.z * 0.8f) * 0.45f; float num4 = normalized.x * 2.8f + normalized.z * 0.7f + num2; float num5 = y * 8.5f + normalized.z * 2.4f + num3; float value = Mathf.PerlinNoise(num4, num5) * 0.76f + Mathf.PerlinNoise(num4 * 2.1f + 23f, num5 * 1.7f - num2 * 0.4f) * 0.24f; float num6 = Ramp(0.49f, 0.7f, value) * Ramp(0.035f, 0.16f, y) * (1f - Ramp(0.54f, 0.79f, y)); val4 = Color.Lerp(val4, Color.Lerp(new Color(0.43f, 0.46f, 0.52f), new Color(0.74f, 0.57f, 0.44f), num), num6 * 0.24f); if ((int)QualitySettings.activeColorSpace != 1) { return val4; } return ((Color)(ref val4)).linear; } private unsafe void DrawSky(Camera camera) { //IL_0015: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //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_00d2: 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_01b8: 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_01f5: 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_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_022e: 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_0240: 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_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_0177: 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_017a: 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_0186: 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_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)sky) || !((Behaviour)this).isActiveAndEnabled || SceneManager.GetActiveScene() != ((Component)this).gameObject.scene || !Object.op_Implicit((Object)(object)camera) || camera.orthographic || (int)camera.cameraType != 1) { return; } int intVal = LayerIndex.world.intVal; if ((camera.cullingMask & (1 << intVal)) == 0 || camera.farClipPlane <= camera.nearClipPlane + 1f) { return; } SkyView skyView = View(camera); Quaternion rotation = ((Component)camera).transform.rotation; float num = Mathf.Tan(camera.fieldOfView * ((float)Math.PI / 180f) * 0.5f); float aspect = camera.aspect; float cosmeticClock = CosmeticClock; int num2 = Mathf.FloorToInt(cosmeticClock * 2f); Vector3 val; if (!skyView.colored || skyView.cloudTick != num2 || Quaternion.Angle(skyView.rotation, rotation) > 0.02f || Mathf.Abs(skyView.fov - camera.fieldOfView) > 0.001f || Mathf.Abs(skyView.aspect - aspect) > 0.001f) { for (int i = 0; i <= 32; i++) { for (int j = 0; j <= 64; j++) { val = new Vector3(((float)j / 64f * 2f - 1f) * num * aspect, ((float)i / 32f * 2f - 1f) * num, 1f); Vector3 normalized = ((Vector3)(ref val)).normalized; skyView.colors[i * 65 + j] = SkyColor(rotation * normalized, cosmeticClock); } } skyView.mesh.colors = skyView.colors; skyView.rotation = rotation; skyView.fov = camera.fieldOfView; skyView.aspect = aspect; skyView.colored = true; skyView.cloudTick = num2; } float num3 = camera.farClipPlane * 0.9f; Matrix4x4 val2 = Matrix4x4.TRS(((Component)camera).transform.position + ((Component)camera).transform.forward * num3, rotation, new Vector3(num3 * num * aspect * 1.001f, num3 * num * 1.001f, 1f)); Graphics.DrawMesh(skyView.mesh, val2, sky, intVal, camera, 0, (MaterialPropertyBlock)null, (ShadowCastingMode)0, false, (Transform)null, (LightProbeUsage)0, (LightProbeProxyVolume)null); DrawSun(skyView, camera, num3, intVal, cosmeticClock); submissions++; if (!skyView.submitted) { skyView.submitted = true; string[] obj = new string[13] { "OATHFALL sky draw submitted camera=", ((Object)camera).name, " path=", ((object)camera.actualRenderingPath/*cast due to .constrained prefix*/).ToString(), " farPlane=", num3.ToString(), " vertices=", skyView.colors.Length.ToString(), " transparentSort=", ((object)camera.transparencySortMode/*cast due to .constrained prefix*/).ToString(), " axis=", null, null }; val = camera.transparencySortAxis; obj[11] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); obj[12] = " collision=False shadows=False"; Debug.Log((object)string.Concat(obj)); } } private void DrawSun(SkyView view, Camera camera, float distance, int layer, float skyClock) { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_008c: 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_00d1: 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_00ef: 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_0113: 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_0129: 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_013a: 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_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_0170: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_019e: 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_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_01b4: 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_01ce: 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_01ee: 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_01fb: Invalid comparison between Unknown and I4 //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0326: 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_0348: 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_0357: 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_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_0238: 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) distance *= 0.9f; Vector3 sunDirection = SunDirection; Vector3 val = Quaternion.Inverse(((Component)camera).transform.rotation) * sunDirection; if (!view.sunReported) { view.sunReported = true; Debug.Log((object)("OATHFALL sun camera=" + ((Object)camera).name + " worldDirection=" + ((Vector3)(ref sunDirection)).ToString("F4") + " facing=" + val.z + " angularRadiusDegrees=1.45")); } if (val.z <= 0.01f || !Object.op_Implicit((Object)(object)sunMaterial)) { return; } float num = Mathf.Tan(camera.fieldOfView * ((float)Math.PI / 180f) * 0.5f); float num2 = Mathf.Tan(0.05061455f) / val.z; if (Mathf.Abs(val.x / val.z) > num * camera.aspect + num2 || Mathf.Abs(val.y / val.z) > num + num2) { return; } float num3 = distance * Mathf.Tan(0.025307275f) / val.z; Vector3 val2 = ((Component)camera).transform.position + sunDirection * (distance / val.z); for (int i = 0; i < view.sunColors.Length; i++) { Vector3 val3 = view.sunVertices[i]; float magnitude = ((Vector3)(ref val3)).magnitude; Vector3 val4 = sunDirection * (distance / val.z) + ((Component)camera).transform.right * (val3.x * num3) + ((Component)camera).transform.up * (val3.y * num3); Vector3 normalized = ((Vector3)(ref val4)).normalized; Color val5 = SkyColor(normalized, skyClock); Color val6 = Color.Lerp(new Color(1f, 0.7f, 0.31f), new Color(0.98f, 0.38f, 0.09f), Mathf.Clamp01(magnitude)); if ((int)QualitySettings.activeColorSpace == 1) { val6 = ((Color)(ref val6)).linear; } view.sunColors[i] = ((magnitude <= 1f) ? val6 : Color.Lerp(val5, val6, (1f - Ramp(1f, 2f, magnitude)) * 0.1f)); } view.sunMesh.colors = view.sunColors; Graphics.DrawMesh(view.sunMesh, Matrix4x4.TRS(val2, ((Component)camera).transform.rotation, Vector3.one * num3), sunMaterial, layer, camera, 0, (MaterialPropertyBlock)null, (ShadowCastingMode)0, false, (Transform)null, (LightProbeUsage)0, (LightProbeProxyVolume)null); sunSubmissions++; if (!view.sunDrawReported) { view.sunDrawReported = true; Debug.Log((object)("OATHFALL orange sun draw submitted camera=" + ((Object)camera).name + " direction=" + ((Vector3)(ref sunDirection)).ToString("F4") + " facing=" + val.z + " viewport=" + ((object)new Vector2(0.5f + 0.5f * val.x / val.z / (num * camera.aspect), 0.5f + 0.5f * val.y / val.z / num)/*cast due to .constrained prefix*/).ToString() + " collider=False shadows=False")); } } private void OnDestroy() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) OnDisable(); foreach (SkyView view in views) { DestroyView(view); } views.Clear(); if (Object.op_Implicit((Object)(object)sky)) { Object.Destroy((Object)(object)sky); } if (Object.op_Implicit((Object)(object)sunMaterial)) { Object.Destroy((Object)(object)sunMaterial); } if (requested && shaderHandle.IsValid()) { Addressables.Release<Shader>(shaderHandle); } if ((Object)(object)instance == (Object)(object)this) { instance = null; } } } internal static class OathfallAudio { internal static bool OwnedEmitter { get { if (Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return OathfallCrystalAmbience.Current.HasEmitter; } return false; } } internal static uint PlayingId { get { if (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return 0u; } return OathfallCrystalAmbience.Current.PlayingId; } } internal static bool Failed { get { if (Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return OathfallCrystalAmbience.Current.Failed; } return false; } } internal static float NearestListener { get { if (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return float.PositiveInfinity; } return OathfallCrystalAmbience.Current.NearestListener; } } internal static int ListenerCount { get { if (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return 0; } return OathfallCrystalAmbience.Current.ListenerCount; } } internal static int ExcludedListenerCount { get { if (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return 0; } return OathfallCrystalAmbience.Current.ExcludedListenerCount; } } internal static float CappedGain { get { if (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return 0f; } return OathfallCrystalAmbience.Current.CappedGain; } } internal static Vector3 EmissionPosition { get { //IL_0017: 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 (!Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return Vector3.zero; } return OathfallCrystalAmbience.Current.EmissionPosition; } } internal static bool IsListenerRouted(ulong id) { if (Object.op_Implicit((Object)(object)OathfallCrystalAmbience.Current)) { return OathfallCrystalAmbience.Current.IsListenerRouted(id); } return false; } internal static bool IsWorldListener(AkAudioListener listener) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)listener) || !((Behaviour)listener).isActiveAndEnabled) { return false; } SceneCamera component = ((Component)listener).GetComponent<SceneCamera>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.camera) && (int)component.camera.cameraType == 1 && Object.op_Implicit((Object)(object)component.cameraRigController) && (Object)(object)component.cameraRigController.sceneCam == (Object)(object)component.camera) { return component.cameraRigController.localUserViewer != null; } return false; } internal static void ConfigurePads() { //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) OathfallPadInfo[] pads = OathfallJumpPads.Pads; if (pads == null || pads.Length != 8) { throw new InvalidOperationException("Oathfall audio requires eight authored native pads"); } OathfallPadInfo[] array = pads; foreach (OathfallPadInfo oathfallPadInfo in array) { if (oathfallPadInfo == null || !Object.op_Implicit((Object)(object)oathfallPadInfo.volume)) { throw new InvalidOperationException("Oathfall audio found a missing native pad volume"); } } array = pads; for (int i = 0; i < array.Length; i++) { array[i].volume.jumpSoundString = "Play_env_geyser_launch"; } Debug.Log((object)("OATHFALL audio configuredPads=" + pads.Length + " nativeJumpSound=Play_env_geyser_launch nativeEntryAuthority=True addedListeners=False")); if (!NetworkClient.active || !Object.op_Implicit((Object)(object)OathfallPlugin.Geometry)) { return; } GameObject gameObject = ((Component)((Component)pads[0].volume).transform.parent).gameObject; if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<OathfallCrystalAmbience>())) { Transform val = OathfallPlugin.Geometry.transform.Find("west-middle-upper-mineral-ridge"); if (Object.op_Implicit((Object)(object)val)) { gameObject.AddComponent<OathfallCrystalAmbience>().Initialize(val.TransformPoint(new Vector3(-51.93266f, 59.05318f, 92.15742f))); } } } } internal sealed class OathfallCrystalAmbience : MonoBehaviour { private static OathfallCrystalAmbience current; private const string StartEvent = "Play_env_dampCave_crystalLight_loop"; private const string StopEvent = "Stop_env_dampCave_crystalLight_loop"; private const float Gain = 0.12f; private const float Radius = 30f; private readonly ulong[] listenerIds = new ulong[4]; private readonly AkAudioListener[] listeners = (AkAudioListener[])(object)new AkAudioListener[4]; private GameObject emitter; private uint playingId; private float nextUpdate; private bool initialized; private bool failed; private AkAuxSendArray emptyAuxSends; internal static OathfallCrystalAmbience Current => current; internal bool HasEmitter => Object.op_Implicit((Object)(object)emitter); internal uint PlayingId => playingId; internal bool Failed => failed; internal float NearestListener { get; private set; } = float.PositiveInfinity; internal int ListenerCount { get; private set; } internal int ExcludedListenerCount { get; private set; } internal float CappedGain { get; private set; } internal Vector3 EmissionPosition { get { //IL_001e: 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 (!Object.op_Implicit((Object)(object)emitter)) { return Vector3.zero; } return emitter.transform.position; } } internal bool IsListenerRouted(ulong id) { for (int i = 0; i < ListenerCount; i++) { if (listenerIds[i] == id) { return true; } } return false; } internal unsafe void Initialize(Vector3 point) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0054: 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_0088: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { initialized = true; current = this; emitter = new GameObject("OathfallOwnedLocalCrystalAudio"); emitter.SetActive(false); emitter.transform.SetParent(((Component)this).transform, false); emitter.transform.position = point; AkGameObj obj = emitter.AddComponent<AkGameObj>(); obj.isEnvironmentAware = false; obj.ScalingFactor = 0.2f; emitter.SetActive(true); Vector3 val = point; Debug.Log((object)("OATHFALL ambience ownedPoints=1 position=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString() + " gainCap=.12 attenuationScale=.2 radiusMeters=30 dedicated=False reducedEffectsIndependent=True")); } } private void Update() { try { UpdateAudio(); } catch (Exception ex) { Fail("native setup exception " + ex.GetType().Name + ": " + ex.Message); } } private void UpdateAudio() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Invalid comparison between Unknown and I4 //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Invalid comparison between Unknown and I4 //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Invalid comparison between Unknown and I4 //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_0275: Invalid comparison between Unknown and I4 if (!initialized || failed || !Object.op_Implicit((Object)(object)emitter)) { return; } if (!NetworkClient.active || SceneManager.GetActiveScene() != ((Component)this).gameObject.scene) { Stop(); } else { if (Time.unscaledTime < nextUpdate) { return; } nextUpdate = Time.unscaledTime + 0.5f; if (!AkSoundEngine.IsInitialized()) { return; } List<AkAudioListener> listenerList = ((BaseListenerList)AkAudioListener.DefaultListeners).ListenerList; int num = 0; ExcludedListenerCount = 0; foreach (AkAudioListener item in listenerList) { if (!Object.op_Implicit((Object)(object)item) || !((Behaviour)item).isActiveAndEnabled) { continue; } if (!OathfallAudio.IsWorldListener(item)) { ExcludedListenerCount++; continue; } if (num == listeners.Length) { Fail("more than four active audio listeners"); return; } listeners[num] = item; listenerIds[num] = item.GetAkGameObjectID(); num++; } ListenerCount = num; CappedGain = 0f; if (num == 0) { NearestListener = float.PositiveInfinity; Stop(); return; } float num2 = float.PositiveInfinity; for (int i = 0; i < num; i++) { num2 = Mathf.Min(num2, Vector3.Distance(emitter.transform.position, ((Component)listeners[i]).transform.position)); } NearestListener = num2; if (num2 >= 30f) { Stop(); return; } if (emptyAuxSends == null) { emptyAuxSends = new AkAuxSendArray(); } if ((int)AkSoundEngine.SetListeners(emitter, listenerIds, (uint)num) != 1 || (int)AkSoundEngine.SetScalingFactor(emitter, 0.2f) != 1 || (int)AkSoundEngine.SetGameObjectAuxSendValues(emitter, emptyAuxSends, 0u) != 1) { Fail("native emitter routing/attenuation setup failed"); return; } for (int j = 0; j < num; j++) { float num3 = Vector3.Distance(emitter.transform.position, ((Component)listeners[j]).transform.position); float num4 = 0.12f * (1f - Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(8f, 30f, num3))); CappedGain = Mathf.Max(CappedGain, num4); if ((int)AkSoundEngine.SetGameObjectOutputBusVolume(emitter, ((Component)listeners[j]).gameObject, num4) != 1) { Fail("native per-listener gain setup failed"); return; } } if (playingId == 0) { playingId = AkSoundEngine.PostEvent("Play_env_dampCave_crystalLight_loop", emitter); if (playingId == 0) { Fail("native loop returned invalid playingID"); return; } Debug.Log((object)("OATHFALL ambience nativeLoopStarted playingId=" + playingId + " listeners=" + num + " nearest=" + num2 + " gainCap=" + 0.12f)); } } } private void Fail(string reason) { if (!failed) { failed = true; try { Stop(); } catch (Exception ex) { reason = reason + "; stop exception " + ex.GetType().Name + ": " + ex.Message; } Debug.LogWarning((object)("OATHFALL ambience disabled: " + reason)); } } private void Stop() { CappedGain = 0f; if (playingId == 0) { return; } uint num = playingId; playingId = 0u; if (AkSoundEngine.IsInitialized()) { if (Object.op_Implicit((Object)(object)emitter)) { AkSoundEngine.PostEvent("Stop_env_dampCave_crystalLight_loop", emitter); } AkSoundEngine.StopPlayingID(num, 200); } Debug.Log((object)("OATHFALL ambience nativeLoopStopped playingId=" + num)); } private void OnDisable() { Stop(); } private void OnDestroy() { try { Stop(); } finally { if (emptyAuxSends != null) { emptyAuxSends.Dispose(); emptyAuxSends = null; } if (Object.op_Implicit((Object)(object)emitter)) { Object.Destroy((Object)(object)emitter); } if ((Object)(object)current == (Object)(object)this) { current = null; } } } } internal sealed class OathfallCliffTransition : MonoBehaviour { internal sealed class Island { internal string id; internal float centerHeight; internal Mesh source; internal Material material; internal Texture2D texture; internal Color regionalCap; internal int boundaryEdges; internal int affectedVertices; internal float maxWeight; internal readonly Dictionary<Vector3, Color> masks = new Dictionary<Vector3, Color>(); } private struct Edge { internal int a; internal int b; internal int faces; internal int capFaces; } private struct Segment { internal Vector3 a; internal Vector3 b; } private readonly Dictionary<string, Island> islands = new Dictionary<string, Island>(); private long paletteMilliseconds; private long maskMilliseconds; private long textureMilliseconds; private long materialMilliseconds; internal IEnumerable<Island> Islands => islands.Values; internal int IslandCount => islands.Count; internal long BuildMilliseconds { get; private set; } internal static OathfallCliffTransition Build(GameObject geometry, Material cliff) { if (!Object.op_Implicit((Object)(object)geometry) || !Object.op_Implicit((Object)(object)cliff)) { throw new ArgumentException("Owned geometry and cliff material required"); } OathfallCliffTransition component = geometry.GetComponent<OathfallCliffTransition>(); if (Object.op_Implicit((Object)(object)component)) { return component; } OathfallCliffTransition oathfallCliffTransition = geometry.AddComponent<OathfallCliffTransition>(); Stopwatch stopwatch = Stopwatch.StartNew(); try { Stopwatch stopwatch2 = Stopwatch.StartNew(); Color[][] capBases = BasePalettes(); oathfallCliffTransition.paletteMilliseconds = stopwatch2.ElapsedMilliseconds; DraftZone[] zones = OathfallDraftTerrain.Zones; foreach (DraftZone draftZone in zones) { Transform val = geometry.transform.Find(draftZone.id); MeshCollider val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<MeshCollider>() : null); if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.sharedMesh)) { throw new InvalidOperationException("Canonical island missing for cliff transition: " + draftZone.id); } oathfallCliffTransition.Prepare(draftZone, val2, cliff, capBases); } if (oathfallCliffTransition.islands.Count != 8) { throw new InvalidOperationException("Eight canonical island weathering states required"); } oathfallCliffTransition.BuildMilliseconds = stopwatch.ElapsedMilliseconds; Debug.Log((object)("[Oathfall] Cliff transition build ms=" + oathfallCliffTransition.BuildMilliseconds + " paletteMs=" + oathfallCliffTransition.paletteMilliseconds + " topologyMasksMs=" + oathfallCliffTransition.maskMilliseconds + " textureBlendUploadMs=" + oathfallCliffTransition.textureMilliseconds + " materialMs=" + oathfallCliffTransition.materialMilliseconds + " basePaletteSamples=49152 localPaletteBytes=786432 ownedMaterials=8 ownedTextures=8 texture=128x128 updates=0 extraGeometry=0")); return oathfallCliffTransition; } catch { Object.Destroy((Object)(object)oathfallCliffTransition); throw; } } internal bool TryMask(string id, Vector3 world, out Color mask) { //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_0021: Unknown result type (might be due to invalid IL or missing references) mask = Color.red; if (islands.TryGetValue(id, out var value)) { return value.masks.TryGetValue(world, out mask); } return false; } internal Material IslandCliff(string id, Material fallback) { if (!islands.TryGetValue(id, out var value)) { return fallback; } return value.material; } internal bool Owns(Material material) { foreach (Island value in islands.Values) { if ((Object)(object)value.material == (Object)(object)material) { return true; } } return false; } internal void CollectOwnedResources(List<Object> destination) { foreach (Island value in islands.Values) { if (Object.op_Implicit((Object)(object)value.material) && !destination.Contains((Object)(object)value.material)) { destination.Add((Object)(object)value.material); } if (Object.op_Implicit((Object)(object)value.texture) && !destination.Contains((Object)(object)value.texture)) { destination.Add((Object)(object)value.texture); } } } private unsafe void Prepare(DraftZone zone, MeshCollider collider, Material cliff, Color[][] capBases) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01b9: 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_01ca: 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_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_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_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0318: 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_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: 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_0252: 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_0267: 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_0282: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029b: 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_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0592: 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_0652: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_052c: 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_03ce: 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) //IL_03d8: 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_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: 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_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: 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_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) Stopwatch stopwatch = Stopwatch.StartNew(); Island island = new Island { id = zone.id, centerHeight = zone.center.y, source = collider.sharedMesh }; islands.Add(zone.id, island); Vector3[] vertices = island.source.vertices; int[] triangles = island.source.triangles; Vector3[] array = (Vector3[])(object)new Vector3[vertices.Length]; for (int i = 0; i < vertices.Length; i++) { array[i] = ((Component)collider).transform.TransformPoint(vertices[i]); } Dictionary<ulong, Edge> dictionary = new Dictionary<ulong, Edge>(); Vector3 val; for (int j = 0; j < triangles.Length; j += 3) { int num = triangles[j]; int num2 = triangles[j + 1]; int num3 = triangles[j + 2]; val = Vector3.Cross(vertices[num2] - vertices[num], vertices[num3] - vertices[num]); bool cap = ((Vector3)(ref val)).normalized.y >= 0.62f; AddEdge(dictionary, num, num2, cap); AddEdge(dictionary, num2, num3, cap); AddEdge(dictionary, num3, num, cap); } List<ulong> list = new List<ulong>(dictionary.Keys); list.Sort(); List<Segment> list2 = new List<Segment>(); Color val2 = Color.clear; float num4 = 0f; foreach (ulong item2 in list) { Edge edge = dict
BepInEx/plugins/Redzergling-Pantheon/Pantheon.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Xml; using System.Xml.Linq; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using Facepunch.Steamworks; using KinematicCharacterController; using LeTai.Asset.TranslucentImage; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using R2API; using Redzergling.Asterius; using Redzergling.Habeas; using Redzergling.Pantheon; using Redzergling.Silvax; using Redzergling.Sjorn; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ConVar; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Networking; using RoR2.Projectile; using RoR2.Skills; using RoR2.SurvivorMannequins; using RoR2.UI; using RoR2.WwiseUtils; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Redzergling.Sjorn { [RegisterAchievement("Redzergling.Sjorn.Skill01", "Redzergling.Sjorn.Skill01", null, 0u, typeof(SjornSkill01Server))] public sealed class SjornSkill01 : SjornSkillAchievement { } public sealed class SjornSkill01Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill02", "Redzergling.Sjorn.Skill02", null, 0u, typeof(SjornSkill02Server))] public sealed class SjornSkill02 : SjornSkillAchievement { } public sealed class SjornSkill02Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill04", "Redzergling.Sjorn.Skill04", null, 0u, typeof(SjornSkill04Server))] public sealed class SjornSkill04 : SjornSkillAchievement { } public sealed class SjornSkill04Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill05", "Redzergling.Sjorn.Skill05", null, 0u, typeof(SjornSkill05Server))] public sealed class SjornSkill05 : SjornSkillAchievement { } public sealed class SjornSkill05Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill07", "Redzergling.Sjorn.Skill07", null, 0u, typeof(SjornSkill07Server))] public sealed class SjornSkill07 : SjornSkillAchievement { } public sealed class SjornSkill07Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill08", "Redzergling.Sjorn.Skill08", null, 0u, typeof(SjornSkill08Server))] public sealed class SjornSkill08 : SjornSkillAchievement { } public sealed class SjornSkill08Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill10", "Redzergling.Sjorn.Skill10", null, 0u, typeof(SjornSkill10Server))] public sealed class SjornSkill10 : SjornSkillAchievement { } public sealed class SjornSkill10Server : SjornSkillServerAchievement { } [RegisterAchievement("Redzergling.Sjorn.Skill11", "Redzergling.Sjorn.Skill11", null, 0u, typeof(SjornSkill11Server))] public sealed class SjornSkill11 : SjornSkillAchievement { } public sealed class SjornSkill11Server : SjornSkillServerAchievement { } public static class SjornCombatEvents { public static event Action<CharacterBody, HealthComponent, int, float> Hit; public static event Action<CharacterBody, HealthComponent, int, float> Kill; public static event Action<CharacterBody, int> Cast; public static event Action<CharacterBody, int> BrewApplied; public static event Action<CharacterBody, float, int> Landing; internal static void OnHit(CharacterBody owner, HealthComponent victim, int id, float damage, bool killed) { SjornCombatEvents.Hit?.Invoke(owner, victim, id, damage); if (killed) { SjornCombatEvents.Kill?.Invoke(owner, victim, id, damage); } } internal static void OnCast(CharacterBody owner, int id) { SjornCombatEvents.Cast?.Invoke(owner, id); } internal static void OnBrewApplied(CharacterBody owner, int id) { SjornCombatEvents.BrewApplied?.Invoke(owner, id); } internal static void OnLanding(CharacterBody owner, float height, int hits) { SjornCombatEvents.Landing?.Invoke(owner, height, hits); } } internal static class Combat { [CompilerGenerated] private static class <>O { public static StatHookEventHandler <0>__Stats; } internal static BuffDef Brew; internal static BuffDef Stout; internal static BuffDef Frenzy; internal static BuffDef Guard; internal static BuffDef Reckless; internal static void Build() { //IL_0015: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00cf: Expected O, but got Unknown Brew = Buff("Hearthbrew", 3, new Color(1f, 0.63f, 0.2f)); Stout = Buff("GraniteStout", 4, new Color(0.65f, 0.8f, 0.9f)); Frenzy = Buff("BerserkerDraught", 5, new Color(0.9f, 0.2f, 0.12f)); Guard = Buff("IronboundRoll", 7, new Color(0.7f, 0.8f, 0.9f)); Reckless = Buff("AvalancheRoll", 8, new Color(0.9f, 0.3f, 0.15f)); object obj = <>O.<0>__Stats; if (obj == null) { StatHookEventHandler val = Stats; <>O.<0>__Stats = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; SjornEffects.Build(); } private static BuffDef Buff(string name, int icon, Color color) { //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) BuffDef obj = ScriptableObject.CreateInstance<BuffDef>(); ((Object)obj).name = "RedzerglingSjorn" + name; obj.buffColor = color; obj.canStack = false; obj.isDebuff = false; obj.iconSprite = SkillIcons.Load("skill-" + icon); ContentAddition.AddBuffDef(obj); return obj; } internal static void Dispose() { //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_001b: Expected O, but got Unknown object obj = <>O.<0>__Stats; if (obj == null) { StatHookEventHandler val = Stats; <>O.<0>__Stats = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj; } private static void Stats(CharacterBody body, StatHookEventArgs args) { if (body.HasBuff(Brew)) { args.moveSpeedMultAdd += 0.3f; args.damageMultAdd += 0.4f; args.armorAdd += 40f; } if (body.HasBuff(Stout)) { args.armorAdd += 100f; } if (body.HasBuff(Frenzy)) { args.attackSpeedMultAdd += 0.6f; args.moveSpeedMultAdd += 0.2f; args.armorAdd -= 20f; } if (body.HasBuff(Guard)) { args.armorAdd += 80f; } if (body.HasBuff(Reckless)) { args.armorAdd -= 30f; } } internal static void Drink(CharacterBody body, int id) { //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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && body.healthComponent.alive && id >= 3 && id <= 5) { BuffDef[] array = (BuffDef[])(object)new BuffDef[3] { Brew, Stout, Frenzy }; foreach (BuffDef val in array) { body.ClearTimedBuffs(val); } body.AddTimedBuff((BuffDef)(id switch { 4 => Stout, 3 => Brew, _ => Frenzy, }), 4f); if (id == 4) { body.healthComponent.Heal(body.maxHealth * 0.12f, default(ProcChainMask), false); } SjornCombatEvents.OnBrewApplied(body, id); SjornEffects.Emit(2, body.corePosition, Vector3.up, 1.2f); } } internal static bool Enemy(CharacterBody owner, HealthComponent victim) { //IL_0042: 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) if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)victim) && victim.alive && Object.op_Implicit((Object)(object)victim.body) && Object.op_Implicit((Object)(object)victim.body.teamComponent) && (int)victim.body.teamComponent.teamIndex != 0) { return victim.body.teamComponent.teamIndex != owner.teamComponent.teamIndex; } return false; } internal static bool Hit(CharacterBody owner, HealthComponent victim, int id, float coefficient, float proc, Vector3 point, bool slow = false) { //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_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_0052: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown if (!NetworkServer.active || !Enemy(owner, victim)) { return false; } float num = victim.combinedHealth + victim.barrier; bool alive = victim.alive; DamageInfo val = new DamageInfo { attacker = ((Component)owner).gameObject, inflictor = ((Component)owner).gameObject, damage = owner.damage * coefficient, crit = owner.RollCrit(), procCoefficient = proc, position = point, damageType = DamageTypeCombo.op_Implicit((DamageType)0), dotIndex = (DotIndex)(-1), damageColorIndex = (DamageColorIndex)0 }; victim.TakeDamage(val); float num2 = Mathf.Max(0f, num - victim.combinedHealth - victim.barrier); if (val.rejected || num2 <= 0f) { return false; } SjornCombatEvents.OnHit(owner, victim, id, num2, alive && !victim.alive); if (slow && victim.alive) { victim.body.AddTimedBuff(Buffs.Slow50, 1f); } GlobalEventManager.instance.OnHitEnemy(val, ((Component)victim).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)victim).gameObject); return true; } internal static int Area(CharacterBody owner, Vector3 center, float radius, int id, float coefficient, float proc, HashSet<HealthComponent> previous = null, Vector3? direction = null, float cone = -1f, bool slow = false) { //IL_0011: 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_001c: 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_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_0091: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_009e: 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_00ea: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return 0; } int num = 0; HashSet<HealthComponent> hashSet = new HashSet<HealthComponent>(); LayerIndex val = LayerIndex.entityPrecise; Collider[] array = Physics.OverlapSphere(center, radius, LayerMask.op_Implicit(((LayerIndex)(ref val)).mask), (QueryTriggerInteraction)2); for (int i = 0; i < array.Length; i++) { HurtBox component = ((Component)array[i]).GetComponent<HurtBox>(); HealthComponent val2 = (Object.op_Implicit((Object)(object)component) ? component.healthComponent : null); if (!Enemy(owner, val2) || !hashSet.Add(val2) || (previous != null && previous.Contains(val2))) { continue; } Vector3 val3 = val2.body.corePosition - center; if (!direction.HasValue || !(Vector3.Dot(((Vector3)(ref val3)).normalized, direction.Value) < cone)) { Vector3 corePosition = val2.body.corePosition; val = LayerIndex.world; if (!Physics.Linecast(center, corePosition, LayerMask.op_Implicit(((LayerIndex)(ref val)).mask), (QueryTriggerInteraction)1) && Hit(owner, val2, id, coefficient, proc, val2.body.corePosition, slow)) { num++; previous?.Add(val2); } } } return num; } internal static float LaunchSpeed(CharacterMotor motor, float height) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs((motor.useCustomGravity ? motor.CustomGravity : Physics.gravity.y) * motor.gravityMultiplier); return Mathf.Sqrt(2f * Mathf.Max(1f, num) * height); } } internal static class Content { internal static GameObject Body; internal static SurvivorDef Survivor; internal static readonly SkillDef[] Skills = (SkillDef[])(object)new SkillDef[12]; internal static readonly Type[] States = new Type[12] { typeof(IronCircle), typeof(GrudgeSplitter), typeof(TempestHew), typeof(Hearthbrew), typeof(GraniteStout), typeof(BerserkerDraught), typeof(CaskRoll), typeof(IronboundRoll), typeof(AvalancheRoll), typeof(Skybreaker), typeof(CometBound), typeof(Faultline) }; internal static readonly string[] Names = new string[12] { "Iron Circle", "Grudge Splitter", "Tempest Hew", "Hearthbrew", "Granite Stout", "Berserker Draught", "Cask Roll", "Ironbound Roll", "Avalanche Roll", "Skybreaker", "Comet Bound", "Faultline" }; internal static readonly float[] Cooldowns = new float[12] { 0f, 0f, 0f, 12f, 16f, 14f, 8f, 10f, 10f, 14f, 18f, 20f }; internal static readonly string[] Descriptions = new string[12] { "Sweep your axe in a full circle for <style=cIsDamage>360% damage</style> within <style=cIsUtility>4.5 m</style>. Hold to swing every <style=cIsUtility>0.9 seconds</style>, scaling with attack speed.", "Commit to a heavy overhead chop for <style=cIsDamage>650% damage</style> in a narrow frontal arc within <style=cIsUtility>5 m</style>. Hold to swing every <style=cIsUtility>1.3 seconds</style>, scaling with attack speed.", "Spin through three circular cuts for <style=cIsDamage>3 x 120% damage</style> within <style=cIsUtility>3.5 m</style>. Each cut has <style=cIsUtility>0.5 proc coefficient</style>. Hold for repeated <style=cIsUtility>1.1-second</style> combinations, scaling with attack speed.", "Drink for <style=cIsUtility>4 seconds</style> of <style=cIsDamage>+40% damage</style>, <style=cIsUtility>+30% movement speed and +40 armor</style>. Replaces other brews; refreshes without stacking.", "Drink to heal <style=cIsHealing>12% maximum health</style> and gain <style=cIsUtility>100 armor for 4 seconds</style>. Healing respects healing modifiers. Replaces other brews; refreshes without stacking.", "Drink for <style=cIsUtility>4 seconds</style> of <style=cIsDamage>+60% attack speed</style>, <style=cIsUtility>+20% movement speed</style> and <style=cDeath>-20 armor</style>. Replaces other brews; refreshes without stacking.", "Roll <style=cIsUtility>14 m</style> in your movement direction, dealing <style=cIsDamage>400% damage</style> once to each enemy crossed. Stops at terrain. Uses facing direction while stationary.", "Brace and roll <style=cIsUtility>10 m</style>, dealing <style=cIsDamage>250% damage</style> once per enemy and gaining <style=cIsUtility>80 armor during the roll</style>. Stops at terrain.", "Risk a fast <style=cIsUtility>18 m</style> roll for <style=cIsDamage>600% damage</style> once per enemy, with <style=cDeath>-30 armor during the roll</style>. Stops at terrain.", "Launch upward toward a <style=cIsUtility>10 m apex</style>, striking enemies within <style=cIsUtility>5 m</style> for <style=cIsDamage>300% damage</style>. Your landing triggers Stonefall if the actual fall exceeds 6 m. Ceilings can shorten the jump.", "Leap toward a <style=cIsUtility>12 m apex</style> with forward momentum, dealing <style=cIsDamage>250% damage</style> within <style=cIsUtility>4 m</style> at takeoff. Your landing triggers Stonefall after an actual fall over 6 m. Ceilings can shorten the leap.", "Plant your feet and fracture the ground within <style=cIsUtility>10 m</style> with <style=cIsDamage>six pulses of 180% damage over 3 seconds</style>. Each pulse slows enemies by <style=cIsUtility>50% for 1 second</style> and has <style=cIsUtility>0.3 proc coefficient</style>. Requires grounded activation; interruption ends remaining pulses. No launch." }; internal static T Load<T>(string address) where T : Object { //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) T val = Addressables.LoadAssetAsync<T>((object)address).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { throw new InvalidOperationException("Missing Sjorn asset " + address); } return val; } internal static void Build() { //IL_0013: 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_0121: 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_0128: 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_01f8: 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_01fe: 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_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_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_035e: Unknown result type (might be due to invalid IL or missing references) Type[] states = States; bool flag = default(bool); for (int i = 0; i < states.Length; i++) { ContentAddition.AddEntityState(states[i], ref flag); } Combat.Build(); SjornProgression.Build(); Body = PrefabAPI.InstantiateClone(Content.Load<GameObject>("RoR2/Base/Merc/MercBody.prefab"), "RedzerglingSjornBody", true); ExpansionRequirementComponent component = Body.GetComponent<ExpansionRequirementComponent>(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)component); } GenericSkill[] components = Body.GetComponents<GenericSkill>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } CharacterBody component2 = Body.GetComponent<CharacterBody>(); component2.baseNameToken = "REDZERGLING_SJORN_NAME"; component2.subtitleNameToken = "REDZERGLING_SJORN_SUBTITLE"; component2.bodyColor = new Color(0.85f, 0.48f, 0.16f); component2.baseMaxHealth = 120f; component2.levelMaxHealth = 36f; component2.baseArmor = 20f; component2.baseMoveSpeed = 7f; component2.baseDamage = 12f; component2.levelDamage = 2.4f; component2.baseJumpCount = 1; component2.dontCull = true; component2.skinIndex = 0u; component2.bodyFlags = (BodyFlags)(component2.bodyFlags | 1); component2.portraitIcon = (Texture)(object)SkillIcons.Load("portrait").texture; Body.AddComponent<SjornController>(); CapsuleCollider component3 = Body.GetComponent<CapsuleCollider>(); if (Object.op_Implicit((Object)(object)component3)) { component3.height = 2.5f; component3.center = Vector3.zero; component3.radius = 0.55f; } CharacterMotor component4 = Body.GetComponent<CharacterMotor>(); if (Object.op_Implicit((Object)(object)component4) && Object.op_Implicit((Object)(object)((BaseCharacterController)component4).Motor)) { ((BaseCharacterController)component4).Motor.SetCapsuleDimensions(0.55f, 2.5f, 0f); } EntityStateMachine[] components2 = Body.GetComponents<EntityStateMachine>(); foreach (EntityStateMachine val in components2) { if (val.customName != "Body") { val.initialStateType = (val.mainStateType = new SerializableEntityStateType(typeof(Idle))); } } for (int j = 0; j < 12; j++) { SkillDef val2 = (SkillDef)(object)((j == 11) ? ScriptableObject.CreateInstance<GroundedSjornSkillDef>() : ((GroundedSjornSkillDef)(object)ScriptableObject.CreateInstance<SkillDef>())); ((Object)val2).name = (val2.skillName = "RedzerglingSjornSkill" + j); val2.skillNameToken = "REDZERGLING_SJORN_SKILL_" + j; val2.skillDescriptionToken = val2.skillNameToken + "_DESC"; LanguageAPI.Add(val2.skillNameToken, Names[j]); LanguageAPI.Add(val2.skillDescriptionToken, Descriptions[j]); val2.activationState = new SerializableEntityStateType(States[j]); val2.activationStateMachineName = ((j >= 6) ? "Body" : "Weapon"); val2.baseRechargeInterval = Cooldowns[j]; val2.baseMaxStock = (val2.rechargeStock = (val2.requiredStock = (val2.stockToConsume = 1))); val2.fullRestockOnAssign = (val2.resetCooldownTimerOnUse = true); val2.beginSkillCooldownOnSkillEnd = j >= 6; val2.mustKeyPress = j >= 3; val2.interruptPriority = (InterruptPriority)((j >= 3) ? ((j < 6) ? 1 : 2) : 0); val2.cancelSprintingOnActivation = true; val2.isCombatSkill = true; val2.icon = SkillIcons.Load("skill-" + j); ContentAddition.AddSkillDef(val2); Skills[j] = val2; } SkillLocator component5 = Body.GetComponent<SkillLocator>(); component5.primary = Family(0, "Primary"); component5.secondary = Family(1, "Secondary"); component5.utility = Family(2, "Utility"); component5.special = Family(3, "Special"); component5.passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "REDZERGLING_SJORN_PASSIVE", skillDescriptionToken = "REDZERGLING_SJORN_PASSIVE_DESC", icon = SkillIcons.Load("passive") }; LanguageAPI.Add(component5.passiveSkill.skillNameToken, "Stonefall"); LanguageAPI.Add(component5.passiveSkill.skillDescriptionToken, "Take <style=cIsUtility>no fall damage</style>. After falling <style=cIsUtility>more than 6 m from your actual airborne apex</style>, land with a <style=cIsDamage>600% damage</style> shockwave within <style=cIsUtility>12 m</style> (0.5 proc coefficient). Once per landing. Teleports and spawning do not count."); SjornModel.Apply(((Component)Body.GetComponent<ModelLocator>().modelTransform).gameObject); ContentAddition.AddBody(Body); Survivor = ScriptableObject.CreateInstance<SurvivorDef>(); ((Object)Survivor).name = "RedzerglingSjorn"; Survivor.bodyPrefab = Body; Survivor.primaryColor = component2.bodyColor; Survivor.displayNameToken = component2.baseNameToken; Survivor.descriptionToken = "REDZERGLING_SJORN_DESCRIPTION"; Survivor.outroFlavorToken = "REDZERGLING_SJORN_OUTRO"; Survivor.mainEndingEscapeFailureFlavorToken = "REDZERGLING_SJORN_FAILURE"; Survivor.desiredSortPosition = 30f; Survivor.hidden = false; BuildDisplay(); ContentAddition.AddSurvivorDef(Survivor); LanguageAPI.Add(component2.baseNameToken, "Sjorn Halbrek"); LanguageAPI.Add(component2.subtitleNameToken, "The Unbroken Cask"); LanguageAPI.Add(Survivor.descriptionToken, "A dwarven barbarian whose axe clears a circle and whose landings shatter stone. Choose a brew for offense, defense or reckless speed; roll through enemies and launch above them to turn height into a shockwave.\n\nBy Redzergling."); LanguageAPI.Add(Survivor.outroFlavorToken, "...and so he left, with a thirst no world could quench."); LanguageAPI.Add(Survivor.mainEndingEscapeFailureFlavorToken, "...and so he vanished, a final thunder beneath the stone."); } private static GenericSkill Family(int slot, string name) { //IL_003b: 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_007c: Expected O, but got Unknown //IL_007c: 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) SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = "RedzerglingSjorn" + name + "Family"; val.variants = (Variant[])(object)new Variant[3]; for (int i = 0; i < 3; i++) { int num = slot * 3 + i; Variant[] variants = val.variants; int num2 = i; Variant val2 = new Variant { skillDef = Skills[num], unlockableDef = ((i == 0) ? null : SjornProgression.GetUnlock(num)) }; ((Variant)(ref val2)).viewableNode = new Node(Skills[num].skillNameToken, false, (Node)null); variants[num2] = val2; } ContentAddition.AddSkillFamily(val); GenericSkill val3 = Body.AddComponent<GenericSkill>(); val3.skillName = name; typeof(GenericSkill).GetField("_skillFamily", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(val3, val); return val3; } private static void BuildDisplay() { //IL_0089: 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_00b8: 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) Survivor.displayPrefab = PrefabAPI.InstantiateClone(Content.Load<GameObject>("RoR2/Base/Merc/MercDisplay.prefab"), "RedzerglingSjornDisplay", false); Object.DestroyImmediate((Object)(object)((Component)Survivor.displayPrefab.GetComponentInChildren<CharacterModel>(true)).gameObject); GameObject val = PrefabAPI.InstantiateClone(((Component)Body.GetComponent<ModelLocator>().modelTransform).gameObject, "SjornSelectionModel", false); val.transform.SetParent(Survivor.displayPrefab.transform, false); val.transform.localPosition = new Vector3(-0.22f, 0f, 0f); val.transform.localRotation = Quaternion.Euler(0f, 22f, 0f); val.transform.localScale = Vector3.one * 0.9f; val.GetComponent<CharacterModel>().body = null; Collider[] componentsInChildren = val.GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } Joint[] componentsInChildren2 = val.GetComponentsInChildren<Joint>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } Rigidbody[] componentsInChildren3 = val.GetComponentsInChildren<Rigidbody>(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren3[i]); } SjornModel.SetDisplay(val); } } public sealed class Plugin : MonoBehaviour { public const string Guid = "com.Redzergling.Sjorn"; public const string Version = "0.1.0"; internal static ManualLogSource Log; internal void Initialize(ManualLogSource logger) { Log = logger; Content.Build(); SjornProgression.Install(); logger.LogInfo((object)"Sjorn Halbrek: twelve skills, native landing shockwave and source-preserving dwarf rig."); } private void OnDestroy() { SjornProgression.Dispose(); Combat.Dispose(); } } public interface ISjornPose { int ActionKind { get; } float Progress { get; } float ContactFraction { get; } int Variant { get; } } internal sealed class SjornRunProgress { internal sealed class BossCredit { internal TeleporterInteraction Teleporter; internal CharacterBody Body; } internal uint PrimaryHits; internal uint PrimaryKills; internal uint SecondaryCasts; internal uint BrewKills; internal uint UtilityCasts; internal uint AirKills; internal uint SpecialKills; internal uint Completed; internal readonly Dictionary<HealthComponent, BossCredit> Bosses = new Dictionary<HealthComponent, BossCredit>(); internal CharacterBody PendingBody; internal TeleporterInteraction PendingTeleporter; internal void Evaluate() { if (PrimaryHits >= 100) { Completed |= 1u; } if (PrimaryKills >= 20) { Completed |= 2u; } if (SecondaryCasts >= 30) { Completed |= 4u; } if (BrewKills >= 20) { Completed |= 8u; } if (UtilityCasts >= 20) { Completed |= 16u; } if (AirKills >= 10) { Completed |= 32u; } if (SpecialKills >= 20) { Completed |= 64u; } } } internal static class SjornProgression { internal sealed class Rule { internal int Skill; internal int Bit; internal string Identity; internal string Description; internal UnlockableDef Unlock; } internal static readonly List<Rule> Rules = new List<Rule>(); private static readonly Dictionary<CharacterMaster, SjornRunProgress> records = new Dictionary<CharacterMaster, SjornRunProgress>(); private static Run run; private static float nextPoll; internal static bool SuppressGrants => Redzergling.Pantheon.Validation.Requested; internal static event Action<CharacterMaster> Changed; internal static void Build() { if (Rules.Count > 0) { return; } string[] array = new string[8] { "land 100 direct primary hits in one run", "defeat 20 enemies directly with primary attacks in one run", "drink 30 brews in one run", "defeat 20 enemies while a brew is active in one run", "use roll skills 20 times in one run", "defeat 10 enemies directly while airborne in one run", "defeat 20 enemies directly with special skills in one run", "damage a teleporter boss before its death, then remain alive until that teleporter finishes charging" }; int num = 0; int[] array2 = new int[8] { 1, 2, 4, 5, 7, 8, 10, 11 }; for (int i = 0; i < array2.Length; i++) { int num2 = array2[i]; string text = "Redzergling.Sjorn.Skill" + num2.ToString("D2"); string title = "Sjorn: " + Content.Names[num2]; string description = "As Sjorn Halbrek, " + array[num] + "."; UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>(); val.cachedName = text; val.nameToken = "ACHIEVEMENT_" + text.ToUpperInvariant() + "_NAME"; val.achievementIcon = SkillIcons.Load("skill-" + num2); val.getHowToUnlockString = () => description; val.getUnlockedString = () => title; ContentAddition.AddUnlockableDef(val); LanguageAPI.Add(val.nameToken, title); LanguageAPI.Add("ACHIEVEMENT_" + text.ToUpperInvariant() + "_DESCRIPTION", description); Rules.Add(new Rule { Skill = num2, Bit = num++, Identity = text, Description = description, Unlock = val }); } } internal static UnlockableDef GetUnlock(int id) { if (!Redzergling.Pantheon.Plugin.RequireAchievements.Value) { return null; } return Rules.First((Rule r) => r.Skill == id).Unlock; } internal static SjornRunProgress Record(CharacterMaster master) { if (!Object.op_Implicit((Object)(object)master)) { return null; } if ((Object)(object)run != (Object)(object)Run.instance) { records.Clear(); run = Run.instance; } if (!records.TryGetValue(master, out var value)) { records.Add(master, value = new SjornRunProgress()); } return value; } internal static bool Complete(CharacterMaster master, string identity) { Rule rule = Rules.FirstOrDefault((Rule r) => r.Identity == identity); if (rule != null && Object.op_Implicit((Object)(object)master) && (Object)(object)run == (Object)(object)Run.instance && records.TryGetValue(master, out var value)) { return (value.Completed & (uint)(1 << rule.Bit)) != 0; } return false; } private static SjornRunProgress Owner(CharacterBody body) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.master) || !Object.op_Implicit((Object)(object)((Component)body).GetComponent<SjornController>())) { return null; } return Record(body.master); } private static void Notify(CharacterBody body, SjornRunProgress record) { record.Evaluate(); if (!SuppressGrants) { SjornProgression.Changed?.Invoke(body.master); } } private static void Hit(CharacterBody body, HealthComponent target, int skill, float damage) { SjornRunProgress sjornRunProgress = Owner(body); if (sjornRunProgress != null && Object.op_Implicit((Object)(object)target) && !(damage <= 0f) && skill >= 0 && skill < 3) { sjornRunProgress.PrimaryHits++; Notify(body, sjornRunProgress); } } private static void Kill(CharacterBody body, HealthComponent target, int skill, float damage) { SjornRunProgress sjornRunProgress = Owner(body); if (sjornRunProgress != null && Object.op_Implicit((Object)(object)target) && !(damage <= 0f)) { switch (skill) { default: return; case 0: case 1: case 2: sjornRunProgress.PrimaryKills++; break; case -1: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: break; } if (skill >= 9) { sjornRunProgress.SpecialKills++; } if (((Component)body).GetComponent<SjornController>().BrewActive) { sjornRunProgress.BrewKills++; } if (skill >= 0 && Object.op_Implicit((Object)(object)body.characterMotor) && !body.characterMotor.isGrounded) { sjornRunProgress.AirKills++; } Notify(body, sjornRunProgress); } } private static void Cast(CharacterBody body, int skill) { SjornRunProgress sjornRunProgress = Owner(body); if (sjornRunProgress != null) { switch (skill) { default: return; case 6: case 7: case 8: sjornRunProgress.UtilityCasts++; break; case 0: case 1: case 2: case 3: case 4: case 5: case 9: case 10: case 11: break; } Notify(body, sjornRunProgress); } } private static void BrewApplied(CharacterBody body, int skill) { SjornRunProgress sjornRunProgress = Owner(body); if (sjornRunProgress != null && skill >= 3 && skill <= 5 && body.healthComponent.alive && body.HasBuff((BuffDef)(skill switch { 4 => Combat.Stout, 3 => Combat.Brew, _ => Combat.Frenzy, }))) { sjornRunProgress.SecondaryCasts++; Notify(body, sjornRunProgress); } } private static void Damage(DamageReport report) { if (report == null || report.isFriendlyFire || report.damageDealt <= 0f || !Object.op_Implicit((Object)(object)report.victimBody) || !Object.op_Implicit((Object)(object)report.victimMaster)) { return; } SjornRunProgress sjornRunProgress = Owner(report.attackerBody); if (sjornRunProgress != null) { TeleporterInteraction instance = TeleporterInteraction.instance; if (Object.op_Implicit((Object)(object)instance) && !instance.isIdle && Object.op_Implicit((Object)(object)instance.bossGroup) && Object.op_Implicit((Object)(object)instance.bossGroup.combatSquad) && instance.bossGroup.combatSquad.ContainsMember(report.victimMaster)) { sjornRunProgress.Bosses[report.victimBody.healthComponent] = new SjornRunProgress.BossCredit { Teleporter = instance, Body = report.attackerBody }; } } } private static void Death(DamageReport report) { if (!NetworkServer.active || report == null || !Object.op_Implicit((Object)(object)report.victimBody)) { return; } KeyValuePair<CharacterMaster, SjornRunProgress>[] array = records.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair<CharacterMaster, SjornRunProgress> keyValuePair = array[i]; if (!Object.op_Implicit((Object)(object)keyValuePair.Key)) { records.Remove(keyValuePair.Key); continue; } SjornRunProgress value = keyValuePair.Value; CharacterBody body = keyValuePair.Key.GetBody(); if (value.Bosses.TryGetValue(report.victimBody.healthComponent, out var value2)) { value.Bosses.Remove(report.victimBody.healthComponent); if (Object.op_Implicit((Object)(object)value2.Teleporter) && (Object)(object)value2.Teleporter == (Object)(object)TeleporterInteraction.instance && Object.op_Implicit((Object)(object)body) && (Object)(object)body == (Object)(object)value2.Body && body.healthComponent.alive && Object.op_Implicit((Object)(object)((Component)body).GetComponent<SjornController>())) { value.PendingBody = body; value.PendingTeleporter = value2.Teleporter; } } if ((Object)(object)body == (Object)(object)report.victimBody || (Object)(object)value.PendingBody == (Object)(object)report.victimBody) { value.PendingBody = null; value.PendingTeleporter = null; value.Bosses.Clear(); } } } private static void Charged(TeleporterInteraction t) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)t) || !t.isCharged || (Object.op_Implicit((Object)(object)t.bossGroup) && Object.op_Implicit((Object)(object)t.bossGroup.combatSquad) && t.bossGroup.combatSquad.memberCount > 0)) { return; } KeyValuePair<CharacterMaster, SjornRunProgress>[] array = records.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair<CharacterMaster, SjornRunProgress> keyValuePair = array[i]; if (Object.op_Implicit((Object)(object)keyValuePair.Key)) { SjornRunProgress value = keyValuePair.Value; CharacterBody body = keyValuePair.Key.GetBody(); if (CompleteTeleporter(value, t, body, charged: true, Object.op_Implicit((Object)(object)body) && body.healthComponent.alive)) { Notify(body, value); } } } } private static bool CompleteTeleporter(SjornRunProgress r, TeleporterInteraction t, CharacterBody b, bool charged, bool alive) { if (!charged || !alive || !Object.op_Implicit((Object)(object)t) || !Object.op_Implicit((Object)(object)b) || (Object)(object)b != (Object)(object)r.PendingBody || (Object)(object)r.PendingTeleporter != (Object)(object)t || !Object.op_Implicit((Object)(object)((Component)b).GetComponent<SjornController>())) { return false; } r.Completed |= 128u; r.PendingBody = null; r.PendingTeleporter = null; return true; } private static void Reset(Run value) { records.Clear(); run = Run.instance; } private static void Poll() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance) || Time.unscaledTime < nextPoll) { return; } nextPoll = Time.unscaledTime + 0.25f; KeyValuePair<CharacterMaster, SjornRunProgress>[] array = records.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair<CharacterMaster, SjornRunProgress> keyValuePair = array[i]; if (Object.op_Implicit((Object)(object)keyValuePair.Key)) { SjornRunProgress value = keyValuePair.Value; CharacterBody body = keyValuePair.Key.GetBody(); if (Object.op_Implicit((Object)(object)value.PendingBody) && (!Object.op_Implicit((Object)(object)body) || (Object)(object)body != (Object)(object)value.PendingBody || !body.healthComponent.alive)) { value.PendingBody = null; value.PendingTeleporter = null; } } } Charged(TeleporterInteraction.instance); } internal static void Install() { SjornCombatEvents.Hit += Hit; SjornCombatEvents.Kill += Kill; SjornCombatEvents.Cast += Cast; SjornCombatEvents.BrewApplied += BrewApplied; GlobalEventManager.onServerDamageDealt += Damage; GlobalEventManager.onCharacterDeathServer += Death; TeleporterInteraction.onTeleporterChargedGlobal += Charged; Run.onRunStartGlobal += Reset; Run.onRunDestroyGlobal += Reset; RoR2Application.onUpdate += Poll; } internal static void Dispose() { SjornCombatEvents.Hit -= Hit; SjornCombatEvents.Kill -= Kill; SjornCombatEvents.Cast -= Cast; SjornCombatEvents.BrewApplied -= BrewApplied; GlobalEventManager.onServerDamageDealt -= Damage; GlobalEventManager.onCharacterDeathServer -= Death; TeleporterInteraction.onTeleporterChargedGlobal -= Charged; Run.onRunStartGlobal -= Reset; Run.onRunDestroyGlobal -= Reset; RoR2Application.onUpdate -= Poll; records.Clear(); } internal static IEnumerator ValidateNative(CharacterBody owner, CharacterBody enemy, Action<bool, string> check) { SjornRunProgress saved = Record(owner.master); Vector3 position = owner.footPosition; SjornRunProgress fixture = new SjornRunProgress { PrimaryHits = 99u, PrimaryKills = 19u, SecondaryCasts = 29u, BrewKills = 19u, UtilityCasts = 19u, AirKills = 9u, SpecialKills = 19u }; fixture.Evaluate(); check(fixture.Completed == 0, "Sjorn progression: incomplete thresholds reject grants"); try { records[owner.master] = fixture; SjornCombatEvents.OnHit(owner, enemy.healthComponent, 0, 1f, killed: false); check((fixture.Completed & 1) != 0, "Sjorn progression: native hit event completes100primaryhits"); SjornCombatEvents.OnHit(owner, enemy.healthComponent, 1, 1f, killed: true); check((fixture.Completed & 2) != 0, "Sjorn progression: native primary kill event completes20kills"); SjornCombatEvents.OnCast(owner, 3); check(fixture.SecondaryCasts == 29 && (fixture.Completed & 4) == 0, "Sjorn progression: starting/interrupted drink animation cannot farm completed brews"); owner.AddBuff(Combat.Brew); try { SjornCombatEvents.OnBrewApplied(owner, 3); SjornCombatEvents.OnHit(owner, enemy.healthComponent, 0, 1f, killed: true); } finally { owner.RemoveBuff(Combat.Brew); } check((fixture.Completed & 4) != 0, "Sjorn progression: successfully applied brew event completes30drinks"); check((fixture.Completed & 8) != 0, "Sjorn progression: native brew status plus kill event completes20brewkills"); SjornCombatEvents.OnCast(owner, 6); check((fixture.Completed & 0x10) != 0, "Sjorn progression: utility cast event completes20rolls"); ((BaseCharacterController)owner.characterMotor).Motor.ForceUnground(0.1f); owner.characterMotor.velocity = Vector3.up * 4f; yield return (object)new WaitForFixedUpdate(); yield return (object)new WaitForFixedUpdate(); SjornCombatEvents.OnHit(owner, enemy.healthComponent, 0, 1f, killed: true); check(!owner.characterMotor.isGrounded && (fixture.Completed & 0x20) != 0, "Sjorn progression: actual airborne motor plus kill event completes10airkills"); SjornCombatEvents.OnHit(owner, enemy.healthComponent, 9, 1f, killed: true); check((fixture.Completed & 0x40) != 0 && fixture.Completed == 127, "Sjorn progression: special event completes20specialkills; all7countmilestones live"); TeleporterInteraction instance = TeleporterInteraction.instance; if (Object.op_Implicit((Object)(object)instance)) { fixture.Completed = 0u; fixture.Bosses[enemy.healthComponent] = new SjornRunProgress.BossCredit { Body = owner, Teleporter = instance }; Death(new DamageReport(new DamageInfo { attacker = ((Component)owner).gameObject, damage = 1f }, enemy.healthComponent, 1f, 1f)); check((Object)(object)fixture.PendingBody == (Object)(object)owner && (Object)(object)fixture.PendingTeleporter == (Object)(object)instance && fixture.Completed == 0, "Sjorn progression: contributed boss death qualifies without premature unlock"); check(!CompleteTeleporter(fixture, instance, owner, charged: false, alive: true) && !CompleteTeleporter(fixture, instance, owner, charged: true, alive: false) && !CompleteTeleporter(fixture, instance, enemy, charged: true, alive: true), "Sjorn progression: unfinished/dead/wrong-owner teleporter fixtures reject reward"); check(CompleteTeleporter(fixture, instance, owner, charged: true, alive: true) && fixture.Completed == 128, "Sjorn progression: same-owner completed living teleporter awards eighth milestone"); fixture.PendingBody = owner; fixture.PendingTeleporter = instance; Death(new DamageReport(new DamageInfo { attacker = ((Component)enemy).gameObject, damage = 1f }, owner.healthComponent, 1f, 1f)); check(!Object.op_Implicit((Object)(object)fixture.PendingBody) && !Object.op_Implicit((Object)(object)fixture.PendingTeleporter), "Sjorn progression: death clears pending boss qualification"); fixture.Bosses[enemy.healthComponent] = new SjornRunProgress.BossCredit { Body = enemy, Teleporter = instance }; Death(new DamageReport(new DamageInfo { attacker = ((Component)owner).gameObject, damage = 1f }, enemy.healthComponent, 1f, 1f)); check(!Object.op_Implicit((Object)(object)fixture.PendingBody), "Sjorn progression: replaced contributing body cannot inherit qualification"); } else { check(arg1: false, "Sjorn progression: real stage teleporter available for boss fixtures"); } bool flag = true; foreach (Rule rule in Rules) { fixture.Completed = (uint)(1 << rule.Bit); flag &= Complete(owner.master, rule.Identity) && Rules.Where((Rule r) => r != rule).All((Rule r) => !Complete(owner.master, r.Identity)); } check(flag, "Sjorn progression: all8 native unlock identities isolated"); fixture.Completed = 0u; uint primaryHits = fixture.PrimaryHits; Hit(owner, enemy.healthComponent, -1, 1f); Hit(owner, enemy.healthComponent, 0, 0f); check(fixture.PrimaryHits == primaryHits, "Sjorn progression: passive/zero damage cannot count as primary hits"); check(SuppressGrants, "Sjorn progression: validation grants suppressed"); } finally { records[owner.master] = saved; TeleportHelper.TeleportBody(owner, position); owner.characterMotor.velocity = Vector3.zero; } } } public abstract class SjornSkillAchievement : BaseAchievement { public override void OnInstall() { ((BaseAchievement)this).OnInstall(); if (!SjornProgression.SuppressGrants) { ((BaseAchievement)this).SetServerTracked(true); } } public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public abstract class SjornSkillServerAchievement : BaseServerAchievement { private bool granted; private float next; public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); RoR2Application.onUpdate += Check; SjornProgression.Changed += Changed; } public override void OnUninstall() { RoR2Application.onUpdate -= Check; SjornProgression.Changed -= Changed; ((BaseServerAchievement)this).OnUninstall(); } private void Changed(CharacterMaster master) { if (Object.op_Implicit((Object)(object)((BaseServerAchievement)this).networkUser) && (Object)(object)((BaseServerAchievement)this).networkUser.master == (Object)(object)master) { next = 0f; Check(); } } private void Check() { if (!granted && !SjornProgression.SuppressGrants && NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((BaseServerAchievement)this).networkUser) && !(Time.unscaledTime < next)) { next = Time.unscaledTime + 0.2f; if (SjornProgression.Complete(((BaseServerAchievement)this).networkUser.master, base.achievementDef.identifier)) { granted = true; ((BaseServerAchievement)this).Grant(); } } } } internal sealed class SjornFallTracker { internal bool Armed; internal bool Airborne; internal float Apex; internal float AirTime; internal void Reset() { Armed = false; Airborne = false; Apex = (AirTime = 0f); } internal float Observe(float height, bool grounded, bool alive, float delta) { if (!alive) { Reset(); return 0f; } if (grounded) { float num = ((Armed && Airborne && AirTime >= 0.1f) ? (Apex - height) : 0f); Armed = true; Airborne = false; AirTime = 0f; Apex = height; if (!(num > 6f)) { return 0f; } return num; } if (!Armed) { return 0f; } if (!Airborne) { Airborne = true; Apex = Mathf.Max(Apex, height); AirTime = 0f; } Apex = Mathf.Max(Apex, height); AirTime += delta; return 0f; } } public sealed class SjornController : MonoBehaviour, ITeleportHandler, IEventSystemHandler { internal readonly SjornFallTracker Fall = new SjornFallTracker(); private CharacterBody body; private Vector3 lastPosition; private bool sampled; private GameObject aura; public int Landings { get; private set; } public float LastFall { get; private set; } public int LastLandingHits { get; private set; } public bool BrewActive { get { if (Object.op_Implicit((Object)(object)body)) { if (!body.HasBuff(Combat.Brew) && !body.HasBuff(Combat.Stout)) { return body.HasBuff(Combat.Frenzy); } return true; } return false; } } private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } public void OnTeleport(Vector3 oldPosition, Vector3 newPosition) { ResetFall(); } public void ResetFall() { Fall.Reset(); sampled = false; } private void OnEnable() { ResetFall(); } private void OnDisable() { ResetFall(); if (Object.op_Implicit((Object)(object)aura)) { Object.Destroy((Object)(object)aura); } } private void FixedUpdate() { //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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_011a: 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_0125: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.characterMotor)) { bool alive = Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive; Vector3 footPosition = body.footPosition; float num = Mathf.Max(8f, (((Vector3)(ref body.characterMotor.velocity)).magnitude + body.moveSpeed + 20f) * Time.fixedDeltaTime * 3f); if (sampled && Vector3.Distance(lastPosition, footPosition) > num) { Fall.Reset(); } lastPosition = footPosition; sampled = true; float num2 = Fall.Observe(footPosition.y, body.characterMotor.isGrounded, alive, Time.fixedDeltaTime); if (num2 > 0f) { LastFall = num2; Landings++; LastLandingHits = Combat.Area(body, footPosition + Vector3.up * 0.5f, 12f, -1, 6f, 0.5f); SjornEffects.Emit(3, footPosition + Vector3.up * 0.12f, Vector3.up, 12f); SjornCombatEvents.OnLanding(body, num2, LastLandingHits); } } } private void LateUpdate() { //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_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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //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_00e1: 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) int num; if (BrewActive && Object.op_Implicit((Object)(object)body.healthComponent)) { num = (body.healthComponent.alive ? 1 : 0); if (num != 0 && !Object.op_Implicit((Object)(object)aura)) { aura = new GameObject("SjornBrewAura"); aura.AddComponent<SjornBrewVisual>(); } } else { num = 0; } if (num != 0) { aura.transform.position = body.footPosition + Vector3.up * 0.1f; aura.GetComponent<SjornBrewVisual>().Tint = (body.HasBuff(Combat.Stout) ? new Color(0.6f, 0.8f, 1f) : (body.HasBuff(Combat.Frenzy) ? new Color(1f, 0.2f, 0.1f) : new Color(1f, 0.65f, 0.2f))); } else if (Object.op_Implicit((Object)(object)aura)) { Object.Destroy((Object)(object)aura); aura = null; } } } internal static class SjornEffects { internal static readonly GameObject[] Prefabs = (GameObject[])(object)new GameObject[6]; internal static Material Gold; internal static Material Stone; internal static Material Red; internal static Material Rock; internal static void Build() { //IL_000f: 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_004b: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown Gold = Material(new Color(1f, 0.68f, 0.25f)); Stone = Material(new Color(0.7f, 0.8f, 0.9f)); Red = Material(new Color(1f, 0.32f, 0.1f)); Rock = Material(new Color(0.42f, 0.36f, 0.28f)); Rock.SetFloat("_EmPower", 0.08f); for (int i = 0; i < 6; i++) { GameObject val = new GameObject("SjornEffect" + i); val.AddComponent<EffectComponent>().applyScale = false; val.AddComponent<VFXAttributes>().DoNotPool = true; val.AddComponent<DestroyOnTimer>().duration = ((i == 2) ? 0.7f : 0.45f); val.AddComponent<SjornImpactVisual>().Kind = i; Prefabs[i] = PrefabAPI.InstantiateClone(val, "SjornEffectPrefab" + i, false); Object.DestroyImmediate((Object)(object)val); ContentAddition.AddEffect(Prefabs[i]); } } internal static Material Material(Color color) { //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_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_002b: 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_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_0057: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown Material val = new Material(Content.Load<Shader>("RoR2/Base/Shaders/HGStandard.shader")); val.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); val.SetColor("_Color", color); val.SetTexture("_EmTex", (Texture)(object)Texture2D.whiteTexture); val.SetColor("_EmColor", color); val.SetFloat("_EmPower", 0.65f); val.SetFloat("_NormalStrength", 0f); val.SetFloat("_Smoothness", 0.3f); val.SetFloat("_Cull", 0f); return val; } internal static void Emit(int kind, Vector3 point, Vector3 direction, float radius) { //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_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_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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (NetworkServer.active) { EffectManager.SpawnEffect(Prefabs[kind], new EffectData { origin = point, rotation = Util.QuaternionSafeLookRotation(direction), scale = radius }, true); } } internal static LineRenderer Line(Transform parent, string name, Material material, int count, float width) { //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_0013: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.layer = ((Component)parent).gameObject.layer; LineRenderer obj = val.AddComponent<LineRenderer>(); obj.useWorldSpace = false; obj.positionCount = count; ((Renderer)obj).sharedMaterial = material; float startWidth = (obj.endWidth = width); obj.startWidth = startWidth; obj.numCornerVertices = 2; obj.numCapVertices = 2; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } } public sealed class SjornImpactVisual : MonoBehaviour { internal static readonly HashSet<SjornImpactVisual> Active = new HashSet<SjornImpactVisual>(); public int Kind; private void OnEnable() { Active.Add(this); } private void OnDisable() { Active.Remove(this); } private void Start() { //IL_0043: 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) EffectComponent component = ((Component)this).GetComponent<EffectComponent>(); float radius = ((Object.op_Implicit((Object)(object)component) && component.effectData != null) ? Mathf.Max(0.1f, component.effectData.scale) : 1f); if (Kind >= 2) { ((Component)this).transform.rotation = Quaternion.identity; } string family = ((Kind == 0) ? "axe-circle" : ((Kind == 1) ? "heavy-sword" : ((Kind == 2) ? "drink" : ((Kind == 3 || Kind == 4) ? "quake" : "roll")))); LegacyNativeVisual legacyNativeVisual = LegacyNativeVisual.Add(((Component)this).transform, family, radius, new Color(1f, 0.86f, 0.63f)); if (Kind == 4) { legacyNativeVisual.SlamIntensity = 0.18f; } if (Kind == 3) { FeedbackAudio.Play(((Component)this).gameObject, "Play_loader_R_variant_slam", 0.3f, "landing"); } } } internal sealed class SjornBrewVisual : MonoBehaviour { internal Color Tint; private LegacyNativeVisual native; private void Start() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) native = LegacyNativeVisual.Add(((Component)this).transform, "brew", 1f, Tint); } private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)native)) { native.Tint = Tint; } } } internal static class SjornModel { private sealed class Joint { internal string Name; internal Vector3 Head; internal Vector3 Tail; internal int Parent; } private sealed class Source { internal Joint[] Joints; internal Vector3[] Vertices; internal Vector3[] Normals; internal Vector2[] UV; internal BoneWeight[] Weights; internal int[] Triangles; } internal const string Prefix = "SjornAuthored"; private static Source cached; private static Material material; private static Vector3 ReadVector(BinaryReader r) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(r.ReadSingle(), r.ReadSingle(), r.ReadSingle()); } private static Source Read() { //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_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_0126: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) if (cached != null) { return cached; } using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Redzergling.Sjorn.Mesh"); using GZipStream input = new GZipStream(stream, CompressionMode.Decompress); using BinaryReader binaryReader = new BinaryReader(input); if (Encoding.ASCII.GetString(binaryReader.ReadBytes(4)) != "HA01" || binaryReader.ReadInt32() != 1) { throw new InvalidDataException("Sjorn mesh format"); } Source source = new Source { Joints = new Joint[binaryReader.ReadInt32()] }; for (int i = 0; i < source.Joints.Length; i++) { source.Joints[i] = new Joint { Name = Encoding.UTF8.GetString(binaryReader.ReadBytes(binaryReader.ReadInt32())), Head = ReadVector(binaryReader), Tail = ReadVector(binaryReader), Parent = binaryReader.ReadInt32() }; } int num = binaryReader.ReadInt32(); source.Vertices = (Vector3[])(object)new Vector3[num]; source.Normals = (Vector3[])(object)new Vector3[num]; source.UV = (Vector2[])(object)new Vector2[num]; source.Weights = (BoneWeight[])(object)new BoneWeight[num]; for (int j = 0; j < num; j++) { source.Vertices[j] = ReadVector(binaryReader); source.Normals[j] = ReadVector(binaryReader); source.UV[j] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); BoneWeight[] weights = source.Weights; int num2 = j; BoneWeight val = default(BoneWeight); ((BoneWeight)(ref val)).boneIndex0 = binaryReader.ReadInt32(); ((BoneWeight)(ref val)).boneIndex1 = binaryReader.ReadInt32(); ((BoneWeight)(ref val)).boneIndex2 = binaryReader.ReadInt32(); ((BoneWeight)(ref val)).boneIndex3 = binaryReader.ReadInt32(); ((BoneWeight)(ref val)).weight0 = binaryReader.ReadSingle(); ((BoneWeight)(ref val)).weight1 = binaryReader.ReadSingle(); ((BoneWeight)(ref val)).weight2 = binaryReader.ReadSingle(); ((BoneWeight)(ref val)).weight3 = binaryReader.ReadSingle(); weights[num2] = val; } source.Triangles = new int[binaryReader.ReadInt32()]; for (int k = 0; k < source.Triangles.Length; k++) { source.Triangles[k] = binaryReader.ReadInt32(); } return cached = source; } private static Texture2D Texture(string name) { //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_004c: Expected O, but got Unknown //IL_0055: 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_0075: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Redzergling.Sjorn." + name); using MemoryStream memoryStream = new MemoryStream(); if (stream == null) { throw new InvalidDataException("Sjorn texture missing " + name); } stream.CopyTo(memoryStream); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true); if (!ImageConversion.LoadImage(val, memoryStream.ToArray())) { throw new InvalidDataException(name); } ((Object)val).name = "SjornAuthored" + name; ((Texture)val).wrapMode = (TextureWrapMode)0; ((Texture)val).anisoLevel = 4; return val; } private static Material Material() { //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_0031: Expected O, but got Unknown //IL_0054: 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) if (Object.op_Implicit((Object)(object)material)) { return material; } material = new Material(Content.Load<Shader>("RoR2/Base/Shaders/HGStandard.shader")) { name = "SjornSuppliedMaterial" }; material.SetTexture("_MainTex", (Texture)(object)Texture("diffuse")); material.SetColor("_Color", Color.white); material.SetTexture("_EmTex", (Texture)(object)Texture("emissive")); material.SetColor("_EmColor", Color.white); material.SetFloat("_EmPower", 0.45f); material.SetFloat("_Smoothness", 0.24f); material.SetFloat("_SpecularStrength", 0.18f); material.SetFloat("_NormalStrength", 0f); material.SetFloat("_Cull", 2f); material.SetFloat("_DitherOn", 1f); material.EnableKeyword("DITHER"); return material; } internal static void Apply(GameObject modelObject) { //IL_005e: 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_0078: 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_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_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0308: 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_0320: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_035c: 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_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_0206: 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_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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_02ab: 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_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_062a: 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_0633: 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_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_065b: 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_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: 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_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) Source source = Read(); Transform root = modelObject.transform; CharacterModel component = modelObject.GetComponent<CharacterModel>(); Transform parent = root.parent; if (!Object.op_Implicit((Object)(object)parent) || Object.op_Implicit((Object)(object)((Component)parent).GetComponent<CharacterBody>())) { throw new InvalidOperationException("Sjorn requires a separate native presentation origin"); } parent.localPosition = new Vector3(parent.localPosition.x, -0.923f, parent.localPosition.z); RagdollController[] componentsInChildren = ((Component)root).GetComponentsInChildren<RagdollController>(true); foreach (RagdollController val in componentsInChildren) { Transform[] bones = val.bones; foreach (Transform obj in bones) { Collider component2 = ((Component)obj).GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component2)) { component2.enabled = false; } Rigidbody component3 = ((Component)obj).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component3)) { component3.isKinematic = true; } } Object.DestroyImmediate((Object)(object)val); } Renderer[] componentsInChildren2 = ((Component)root).GetComponentsInChildren<Renderer>(true); Renderer[] array = componentsInChildren2; foreach (Renderer val2 in array) { val2.forceRenderingOff = true; val2.enabled = false; if (val2 is SkinnedMeshRenderer) { ((SkinnedMeshRenderer)val2).sharedMesh = null; } if (((Component)val2).transform.childCount == 0) { ((Component)val2).gameObject.SetActive(false); } } Transform[] componentsInChildren3 = ((Component)root).GetComponentsInChildren<Transform>(true); Transform[] array2 = (Transform[])(object)new Transform[source.Joints.Length]; Transform[] bones2 = (Transform[])(object)new Transform[source.Joints.Length]; Quaternion[] array3 = (Quaternion[])(object)new Quaternion[source.Joints.Length]; Vector3[] array4 = (Vector3[])(object)new Vector3[source.Joints.Length]; for (int k = 0; k < bones2.Length; k++) { Joint j2 = source.Joints[k]; array2[k] = ((IEnumerable<Transform>)componentsInChildren3).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == j2.Name)); array3[k] = (Object.op_Implicit((Object)(object)array2[k]) ? (Quaternion.Inverse(root.rotation) * array2[k].rotation) : Quaternion.identity); Transform transform = new GameObject("SjornAuthored" + j2.Name).transform; transform.SetParent((j2.Parent < 0) ? root : bones2[j2.Parent], false); transform.position = root.TransformPoint(j2.Head); transform.rotation = root.rotation; bones2[k] = transform; array4[k] = transform.localPosition; } Mesh val3 = new Mesh { name = "SjornExactSourceMesh", indexFormat = (IndexFormat)1, vertices = source.Vertices, normals = source.Normals, uv = source.UV, boneWeights = source.Weights, bindposes = bones2.Select((Transform t) => t.worldToLocalMatrix * root.localToWorldMatrix).ToArray(), triangles = source.Triangles }; val3.RecalculateBounds(); val3.RecalculateTangents(); int num = Array.FindIndex(source.Joints, (Joint joint) => joint.Name == "axe"); int num2 = Array.FindIndex(source.Joints, (Joint joint) => joint.Name == "bottle"); List<int> list = new List<int>(); List<int> list2 = new List<int>(); List<int> list3 = new List<int>(); for (int num3 = 0; num3 < source.Triangles.Length; num3 += 3) { ((((BoneWeight)(ref source.Weights[source.Triangles[num3]])).boneIndex0 == num) ? list2 : ((((BoneWeight)(ref source.Weights[source.Triangles[num3]])).boneIndex0 == num2) ? list3 : list)).AddRange(new int[3] { source.Triangles[num3], source.Triangles[num3 + 1], source.Triangles[num3 + 2] }); } Mesh val4 = Object.Instantiate<Mesh>(val3); ((Object)val4).name = "SjornBodyMesh"; val4.triangles = list.ToArray(); Mesh val5 = Object.Instantiate<Mesh>(val3); ((Object)val5).name = "SjornAxeMesh"; val5.triangles = list2.ToArray(); Mesh val6 = Object.Instantiate<Mesh>(val3); ((Object)val6).name = "SjornBottleMesh"; val6.triangles = list3.ToArray(); Func<string, Mesh, SkinnedMeshRenderer> func = delegate(string name, Mesh m) { //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_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_0087: 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) GameObject val9 = new GameObject(name) { layer = modelObject.layer }; val9.transform.SetParent(root, false); SkinnedMeshRenderer obj2 = val9.AddComponent<SkinnedMeshRenderer>(); obj2.sharedMesh = m; obj2.bones = bones2; obj2.rootBone = bones2[0]; ((Renderer)obj2).sharedMaterial = Material(); obj2.quality = (SkinQuality)4; obj2.updateWhenOffscreen = true; ((Renderer)obj2).localBounds = new Bounds(new Vector3(0f, 1.2f, 0f), Vector3.one * 60f); ((Renderer)obj2).shadowCastingMode = (ShadowCastingMode)1; return obj2; }; SjornModelIdentity sjornModelIdentity = modelObject.AddComponent<SjornModelIdentity>(); sjornModelIdentity.BodyRenderer = func("SjornBodyRenderer", val4); sjornModelIdentity.AxeRenderer = func("SjornAxeRenderer", val5); sjornModelIdentity.BottleRenderer = func("SjornBottleRenderer", val6); sjornModelIdentity.Bones = bones2; sjornModelIdentity.BoneNames = source.Joints.Select((Joint joint) => joint.Name).ToArray(); sjornModelIdentity.LegacyRenderers = componentsInChildren2; sjornModelIdentity.AxeHand = bones2[Array.FindIndex(source.Joints, (Joint joint) => joint.Name == "hand.r")]; sjornModelIdentity.BottleHand = bones2[Array.FindIndex(source.Joints, (Joint joint) => joint.Name == "hand.l")]; sjornModelIdentity.AxeBone = bones2[num]; sjornModelIdentity.BottleBone = bones2[num2]; Vector3 val7 = source.Joints[num].Tail - source.Joints[num].Head; sjornModelIdentity.AxeDirection = ((Vector3)(ref val7)).normalized; val7 = source.Joints[num2].Tail - source.Joints[num2].Head; sjornModelIdentity.BottleDirection = ((Vector3)(ref val7)).normalized; sjornModelIdentity.AxeTip = Tip(bones2[num], root.TransformPoint(source.Joints[num].Tail)); sjornModelIdentity.BottleTip = Tip(bones2[num2], root.TransformPoint(source.Joints[num2].Tail)); sjornModelIdentity.AxeGripOffset = sjornModelIdentity.AxeBone.localPosition; sjornModelIdentity.BottleGripOffset = sjornModelIdentity.BottleBone.localPosition; sjornModelIdentity.Mouth = Tip(sjornModelIdentity.Bone("head"), root.TransformPoint(new Vector3(0.0436099f, 2.1522577f, 0.220809f))); sjornModelIdentity.BottleMouth = Tip(sjornModelIdentity.BottleBone, root.TransformPoint(new Vector3(-0.6782274f, 1.4644156f, 0.1750159f))); SjornProportions sjornProportions = modelObject.AddComponent<SjornProportions>(); sjornProportions.Native = array2; sjornProportions.Bones = bones2; sjornProportions.Names = sjornModelIdentity.BoneNames; sjornProportions.NativeRest = array3; sjornProportions.LocalRest = array4; MonoBehaviour[] componentsInChildren4 = ((Component)root).GetComponentsInChildren<MonoBehaviour>(true); foreach (MonoBehaviour val8 in componentsInChildren4) { if (((object)val8).GetType().Name == "InverseKinematics") { ((Behaviour)val8).enabled = false; } } RendererInfo[] baseRendererInfos = ((IEnumerable<SkinnedMeshRenderer>)(object)new SkinnedMeshRenderer[3] { sjornModelIdentity.BodyRenderer, sjornModelIdentity.AxeRenderer, sjornModelIdentity.BottleRenderer }).Select((Func<SkinnedMeshRenderer, RendererInfo>)((SkinnedMeshRenderer r) => new RendererInfo { renderer = (Renderer)(object)r, defaultMaterial = material, defaultShadowCastingMode = (ShadowCastingMode)1 })).ToArray(); component.baseRendererInfos = baseRendererInfos; modelObject.GetComponent<ModelSkinController>().skins = (SkinDef[])(object)new SkinDef[1] { NewSkin(modelObject, "Default", "REDZERGLING_SJORN_SKIN", material, "portrait") }; LanguageAPI.Add("REDZERGLING_SJORN_SKIN", "Sjorn"); modelObject.GetComponent<Animator>().cullingMode = (AnimatorCullingMode)0; modelObject.AddComponent<SjornPose>(); } private static Transform Tip(Transform parent, Vector3 point) { //IL_0005: 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) Transform transform = new GameObject("SjornWeaponTip").transform; transform.SetParent(parent, false); transform.position = point; return transform; } private static SkinDef NewSkin(GameObject root, string name, string token, Material mat, string icon) { //IL_0031: 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) RendererInfo[] array = ((IEnumerable<RendererInfo>)root.GetComponent<CharacterModel>().baseRendererInfos).Select((Func<RendererInfo, RendererInfo>)((RendererInfo r) => new RendererInfo { renderer = r.renderer, defaultMaterial = mat, defaultShadowCastingMode = r.defaultShadowCastingMode })).ToArray(); return Skins.CreateNewSkinDef(new SkinDefParamsInfo { Name = "RedzerglingSjorn" + name + ((Object)root).name, NameToken = token, RootObject = root, Icon = SkillIcons.Load(icon), BaseSkins = Array.Empty<SkinDef>(), RendererInfos = array, MeshReplacements = array.Where((RendererInfo i) => i.renderer is SkinnedMeshRenderer).Select((Func<RendererInfo, MeshReplacement>)((RendererInfo i) => new MeshReplacement { renderer = i.renderer, mesh = ((SkinnedMeshRenderer)i.renderer).sharedMesh })).ToArray(), GameObjectActivations = Array.Empty<GameObjectActivation>(), ProjectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(), MinionSkinReplacements = Array.Empty<MinionSkinReplacement>() }); } internal static void SetDisplay(GameObject root) { SjornModelIdentity component = root.GetComponent<SjornModelIdentity>(); if (Object.op_Implicit((Object)(object)component)) { component.IsDisplay = true; } SjornPose component2 = root.GetComponent<SjornPose>(); if (Object.op_Implicit((Object)(object)component2)) { component2.IsDisplay = true; } CharacterModel component3 = root.GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component3)) { component3.body = null; } } } internal sealed class SjornModelIdentity : MonoBehaviour { public SkinnedMeshRenderer BodyRenderer; public SkinnedMeshRenderer AxeRenderer; public SkinnedMeshRenderer BottleRenderer; public Renderer[] LegacyRenderers; public Transform[] Bones; public string[] BoneNames; public Transform AxeHand; public Transform BottleHand; public Transform AxeBone; public Transform BottleBone; public Transform AxeTip; public Transform BottleTip; public Transform Mouth; public Transform BottleMouth; public Vector3 AxeDirection; public Vector3 BottleDirection; public Vector3 AxeGripOffset; public Vector3 BottleGripOffset; public bool AxeVisualReleased; public bool BottleVisualReleased; public bool IsDisplay; internal Transform Bone(string name) { return Bones[Array.IndexOf(BoneNames, name)]; } private void Awake() { Suppress(); } private void OnEnable() { Suppress(); } private void Suppress() { if (LegacyRenderers == null) { return; } Renderer[] legacyRenderers = LegacyRenderers; foreach (Renderer val in legacyRenderers) { if (Object.op_Implicit((Object)(object)val)) { val.forceRenderingOff = true; } } } } [DefaultExecutionOrder(9000)] internal sealed class SjornPose : MonoBehaviour { public bool IsDisplay; private readonly LegacyMotionClock locomotion = new LegacyMotionClock(); private readonly ObservedMotion observedMotion = new ObservedMotion(); private SjornModelIdentity id; private CharacterBody body; private EntityStateMachine[] machines; private Vector3 bottleMouthFromHand; private Quaternion[] previous; private Quaternion[] returnFrom; private bool acting; private float returnAt = -10f; private float deathAt = -1f; internal int ActiveKind; internal float ActiveProgress; internal int ActiveVariant; private static readonly string[] MovementClips = new string[8] { "idle", "walk", "run", "sprint", "rise", "fall", "land", "death" }; private static readonly Vector3 SelectionGripShift = new Vector3(0.0055173f, 0.25482482f, -1.3562573f); private static readonly Vector3 SelectionWrist = new Vector3(0.77f, 1.1198655f, 0.19f); private static readonly Quaternion SelectionFist = new Quaternion(0.5268012f, 0.02960471f, 0.00770542f, 0.84943783f); private readonly RetargetClip[] clips = new RetargetClip[20]; private RetargetPosePlayer player; private Vector3[] priorPositions; private Vector3[] transitionPositions; private Quaternion[] priorRotations; private Quaternion[] transitionRotations; private float transitionAt = -10f; private float transitionDuration; private float airAt; private float landAt = -10f; private float gaitPhase; private float airWeight; private float gaitSpeed; private float gaitSprint; private bool wasGrounded = true; private bool wasDead; private bool havePose; private SjornState lastSkill; internal bool RetargetActive { get; private set; } internal string ActiveRetargetClip { get; private set; } internal float RetargetPhase { get; private set; } private void Start() { //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_0070: Unknown result type (might be due to invalid IL or missing references) id = ((Component)this).GetComponent<SjornModelIdentity>(); CharacterModel component = ((Component)this).GetComponent<CharacterModel>(); body = (Object.op_Implicit((Object)(object)component) ? component.body : null); machines = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponents<EntityStateMachine>() : Array.Empty<EntityStateMachine>()); bottleMouthFromHand = id.BottleHand.InverseTransformPoint(id.BottleMouth.position); previous = id.Bones.Select((Transform b) => b.localRotation).ToArray(); returnFrom = (Quaternion[])(object)new Quaternion[previous.Length]; for (int num = 0; num < clips.Length; num++) { string name = ((num < MovementClips.Length) ? MovementClips[num] : ("skill" + (num - MovementClips.Length).ToString("D2"))); clips[num] = RetargetLibrary.Load("sjorn", name); } RetargetActive = clips.All((RetargetClip clip) => clip != null && id.BoneNames.All((string name2) => clip.BoneIndex(name2) >= 0)); if (RetargetActive) { player = new RetargetPosePlayer(id.Bones, id.BoneNames); priorPositions = (Vector3[])(object)new Vector3[id.Bones.Length]; transitionPositions = (Vector3[])(object)new Vector3[id.Bones.Length]; priorRotations = (Quaternion[])(object)new Quaternion[id.Bones.Length]; transitionRotations = (Quaternion[])(object)new Quaternion[id.Bones.Length]; SjornProportions component2 = ((Component)this).GetComponent<SjornProportions>(); if (Object.op_Implicit((Object)(object)component2)) { component2.RetargetOwnsPose = true; } } if (!IsDisplay) { return; } id.IsDisplay = true; Animator component3 = ((Component)this).GetComponent<Animator>(); if (!Object.op_Implicit((Object)(object)component3)) { return; } component3.SetBool("isGrounded", true); component3.SetBool("isMoving", false); string[] array = new string[2] { "AimPitch", "AimYaw" }; foreach (string text in array) { int layerIndex = component3.GetLayerIndex(text); if (layerIndex >= 0) { component3.SetLayerWeight(layerIndex, 0f); } } } private void LateUpdate() { //IL_0143: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: 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_03e9: 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_0420: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0468: 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_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)id) || id.Bones == null) { return; } if (RetargetActive) { ApplyRetarget(); return; } if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && !body.healthComponent.alive) { if (deathAt < 0f) { deathAt = Time.time; } id.Bone("ROOT").localRotation = Quaternion.Euler(70f * Mathf.SmoothStep(0f, 1f, (Time.time - deathAt) / 0.7f), 0f, 0f); return; } deathAt = -1f; ISjornPose sjornPose = null; if (machines != null) { EntityStateMachine[] array = machines; foreach (EntityStateMachine val in array) { if (Object.op_Implicit((Object)(object)val) && val.state is ISjornPose) { sjornPose = (ISjornPose)val.state; } } } locomotion.Tick(body); float move = locomotion.Move; Transform obj = id.Bone("chest"); obj.localRotation *= Quaternion.Euler(Mathf.Sin(Time.time * 1.5f) * 0.6f, 0f, 0f); Transform obj2 = id.Bone("lower_arm.r"); obj2.localRotation *= Quaternion.Euler(Mathf.Sin(Time.time * 4f) * move * 3f, 0f, 0f); Transform obj3 = id.Bone("lower_arm.l"); obj3.localRotation *= Quaternion.Euler((0f - Mathf.Sin(Time.time * 4f)) * move * 2f, 0f, 0f); Transform obj4 = id.Bone("chest"); obj4.localRotation *= Quaternion.Euler(2f * locomotion.Sprint - locomotion.Rise + 1.2f * locomotion.Fall + 2f * locomotion.Land, 0f, locomotion.Stride * 0.4f); Transform obj5 = id.Bone("head"); obj5.localRotation *= Quaternion.Euler(0f - locomotion.Rise + locomotion.Land, 0f, 0f); ActiveKind = sjornPose?.ActionKind ?? 0; ActiveProgress = sjornPose?.Progress ?? 0f; ActiveVariant = sjornPose?.Variant ?? 0; if (sjornPose != null) { Apply(sjornPose); } if (acting && sjornPose == null) { returnAt = Time.time; Array.Copy(previous, returnFrom, previous.Length); } if (sjornPose == null && Time.time - returnAt < 0.16f) { float num = Mathf.SmoothStep(0f, 1f, (Time.time - returnAt) / 0.16f); for (int j = 0; j < id.Bones.Length; j++) { id.Bones[j].localRotation = Quaternion.Slerp(returnFrom[j], id.Bones[j].localRotation, num); } } for (int k = 0; k < previous.Length; k++) { previous[k] = id.Bones[k].localRotation; } acting = sjornPose != null; id.AxeBone.localPosition = id.AxeGripOffset; id.BottleBone.localPosition = id.BottleGripOffset; Transform axeBone = id.AxeBone; Quaternion localRotation = (id.BottleBone.localRotation = Quaternion.identity); axeBone.localRotation = localRotation; } private void ApplyRetarget() { //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_00fa: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: 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_0804: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) player.BeginFrame(); if (IsDisplay) { ApplySelection(); return; } SjornState sjornState = null; if (machines != null) { EntityStateMachine[] array = machines; foreach (EntityStateMachine val in array) { if (Object.op_Implicit((Object)(object)val) && val.state is SjornState sjornState2) { sjornState = sjornState2; } } } CharacterMotor val2 = (Object.op_Implicit((Object)(object)body) ? body.characterMotor : null); bool flag = !Object.op_Implicit((Object)(object)val2) || val2.isGrounded; Vector3 val3 = observedMotion.Sample(body); if (observedMotion.ResetThisFrame) { wasGrounded = flag; airAt = Time.time; landAt = -10f; gaitSpeed = (gaitSprint = (airWeight = (gaitPhase = 0f))); } Vector3 val4 = Vector3.ProjectOnPlane(val3, Vector3.up); float magnitude = ((Vector3)(ref val4)).magnitude; if (!flag && wasGrounded) { airAt = Time.time; } if (flag && !wasGrounded) { landAt = Time.time; } wasGrounded = flag; bool flag2 = Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && !body.healthComponent.alive; if (flag2 && deathAt < 0f) { deathAt = Time.time; } if (!flag2) { deathAt = -1f; } if (sjornState != lastSkill || flag2 != wasDead) { if (havePose) { Array.Copy(priorPositions, transitionPositions, priorPositions.Length); Array.Copy(priorRotations, transitionRotations, priorRotations.Length); transitionAt = Time.time; transitionDuration = (flag2 ? 0.1f : ((sjornState == null) ? 0.15f : ((sjornState.ActionKind == 3) ? 0.055f : Mathf.Min(0.09f, Mathf.Max(0.01f, sjornState.PresentationDuration * sjornState.ContactFraction * 0.7f))))); } lastSkill = sjornState; } wasDead = flag2; ActiveKind = sjornState?.ActionKind ?? 0; ActiveProgress = sjornState?.Progress ?? 0f; ActiveVariant = sjornState?.Variant ?? 0; gaitSpeed = Mathf.MoveTowards(gaitSpeed, flag ? magnitude : 0f, Time.deltaTime * ((magnitude > gaitSpeed) ? 23f : 31f)); gaitSprint = Mathf.MoveTowards(gaitSprint, (float)((flag && Object.op_Implicit((Object)(object)body) && body.isSprinting) ? 1 : 0), Time.deltaTime * 5f); float num = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.2f, 2.35f, gaitSpeed)); float num2 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(2.1f, 4.6f, gaitSpeed)); float num3 = gaitSprint; float num4 = Mathf.Lerp(Mathf.Lerp(2.3f, 4.6f, num2), 6.7f, num3); float num5 = Mathf.Lerp(Mathf.Lerp(clips[1].Duration, clips[2].Duration, num2), clips[3].Duration, num3); gaitPhase = Mathf.Repeat(gaitPhase + Time.deltaTime * Mathf.Clamp(gaitSpeed / num4, 0f, 1.8f) / num5, 1f); float num6 = Mathf.Repeat(Time.time / clips[0].Duration, 1f); player.Apply(clips[0], num6); player.Apply(clips[1], gaitPhase, num); player.Apply(clips[2], gaitPhase, num * num2); player.Apply(clips[3], gaitPhase, num * num3); string text = ((num < 0.15f) ? "idle" : ((num3 > 0.5f) ? "sprint" : ((num2 > 0.5f) ? "run" : "walk"))); float num7 = ((text == "idle") ? num6 : gaitPhase); airWeight = Mathf.MoveTowards(airWeight, (float)((!flag) ? 1 : 0), Time.deltaTime * 11f); if (airWeight > 0f) { int num8 = ((val3.y > 0.5f) ? 4 : 5); float num9 = Time.time - airAt; float num10 = ((num8 == 4) ? Mathf.Clamp01(num9 / 0.38f) : Mathf.Clamp01(num9 / clips[5].Duration)); player.Apply(clips[num8], num10, airWeight); if (airWeight > 0.45f) { text = MovementClips[num8]; num7 = num10; } } float num11 = Time.time - landAt; if (flag && num11 >= 0f && num11 < 0.31f) { float num12 = (1f - Mathf.SmoothStep(0f, 1f, num11 / 0.31f)) * (1f - 0.65f * num); player.Ap