using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization.Json; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using ExtraSkillSlots; using KinematicCharacterController; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired; using RoR2; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.SurvivorMannequins; using RoR2.UI; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("TobiramaSenju")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+eb2256b72ec6875df56e4b80aa5379592b1c13a2")] [assembly: AssemblyProduct("TobiramaSenju")] [assembly: AssemblyTitle("TobiramaSenju")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace TobiramaSenju; public static class DefaultAppearance { public static void Build(GameObject model) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00e0: 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) string[] array = new string[2] { "HENRY_TOBIRAMA_ENGLISH", "HENRY_TOBIRAMA_STORM" }; string[] array2 = new string[2] { "skin i paid a guy for", "Storm 4" }; string[] array3 = new string[2] { "Skin-Purchased.png", "Skin-Storm.png" }; string[] array4 = new string[2] { "HenryTobiramaVoiceSkin0", "HenryTobiramaStormSkin" }; SkinDef[] array5 = (SkinDef[])(object)new SkinDef[2]; for (int i = 0; i < 2; i++) { SkinDef val = ScriptableObject.CreateInstance(); ((Object)val).name = array4[i]; val.nameToken = array[i]; LanguageAPI.Add(val.nameToken, array2[i]); Texture2D val2 = new Texture2D(2, 2); ImageConversion.LoadImage(val2, File.ReadAllBytes(Path.Combine(Visual.Assets, "Icons", array3[i]))); val.icon = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); val.rootObject = model; val.baseSkins = Array.Empty(); val.rendererInfos = model.GetComponent().baseRendererInfos; val.gameObjectActivations = Array.Empty(); val.meshReplacements = Array.Empty(); val.projectileGhostReplacements = Array.Empty(); val.minionSkinReplacements = Array.Empty(); MethodInfo methodInfo = typeof(SkinDef).Assembly.GetType("RoR2.SkinDefParams")?.GetMethod("FromSkinDef", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo != null) { typeof(SkinDef).GetField("skinDefParams").SetValue(val, methodInfo.Invoke(null, new object[1] { val })); } array5[i] = val; } (model.GetComponent() ?? model.AddComponent()).skins = array5; } public static void BuildDisplay(GameObject display, GameObject body) { CharacterModel componentInChildren = display.GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)componentInChildren)) { throw new InvalidOperationException("Survivor display is missing its CharacterModel."); } ModelSkinController componentInChildren2 = body.GetComponentInChildren(true); ModelSkinController val = ((Component)componentInChildren).GetComponent() ?? ((Component)componentInChildren).gameObject.AddComponent(); SkinDef[] array = (SkinDef[])(object)new SkinDef[componentInChildren2.skins.Length]; for (int i = 0; i < array.Length; i++) { SkinDef val2 = componentInChildren2.skins[i]; SkinDef val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = ((Object)val2).name; val3.nameToken = val2.nameToken; val3.icon = val2.icon; val3.unlockableDef = val2.unlockableDef; val3.rootObject = ((Component)componentInChildren).gameObject; val3.baseSkins = Array.Empty(); val3.rendererInfos = Array.Empty(); val3.gameObjectActivations = Array.Empty(); val3.meshReplacements = Array.Empty(); val3.projectileGhostReplacements = Array.Empty(); val3.minionSkinReplacements = Array.Empty(); MethodInfo methodInfo = typeof(SkinDef).Assembly.GetType("RoR2.SkinDefParams")?.GetMethod("FromSkinDef", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo != null) { typeof(SkinDef).GetField("skinDefParams").SetValue(val3, methodInfo.Invoke(null, new object[1] { val3 })); } array[i] = val3; } val.skins = array; } } public static class DragonRig { public class Built { public Transform[] whiskers; public Quaternion trallRest; public Vector3 trallRestPos; public Vector3 headRestPos; public SkinnedMeshRenderer headR; public SkinnedMeshRenderer beardR; public Transform root; public Transform[] bones; public Animation anim; public SkinnedMeshRenderer[] renderers; public Quaternion[] restRot; public int[] chain; public int trall; public int head; } private static ModelData data; private static Mesh[] meshes; private static Material[] mats; private static AnimationClip[] clips; private static Matrix4x4[] restRel; private static Quaternion[] restRot; public static Material tubeBody; public static Material tubeRim; public static Material eye; public static Mesh headMesh; public static Mesh beardMesh; public static float[] headTip; public static float[] beardTip; public static Vector3[] headSmooth; public static Vector3[] beardSmooth; public static int SnoutTipIndex = -1; public static int SkullBackIndex = -1; public static float[] headManeW; public static Vector3[] headManeBase; public static Vector3[] headManeTip; public const float HeadScale = 4.4f; public const float BodyLength = 21f; public const float BodyBoneScale = 0.94838095f; private static Vector3 V(float[] a) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return new Vector3(a[0], a[1], a[2]); } private static Quaternion Q(float[] a) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(a[0], a[1], a[2], a[3]); } public static void Prepare() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_0214: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0363: 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_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: 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_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_089c: 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_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0598: 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_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0635: 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) data = TobiramaPack.Model("DragonRig.json"); Material val = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd00.png", (TextureWrapMode)1), additive: false, new Color(0.5f, 0.78f, 1f, 0.96f), 1.05f, 3004); Material val2 = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd01.png", (TextureWrapMode)0), additive: false, new Color(0.92f, 0.98f, 1f, 0.75f), 1.3f, 3005); Material val3 = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd00.png", (TextureWrapMode)1), additive: false, new Color(0.45f, 0.74f, 1f, 0.38f), 1f, 3003); eye = StormFx.Mat((Texture)(object)StormFx.soft, additive: true, new Color(0.85f, 1f, 1f, 1f), 3f, 3006); tubeBody = StormFx.Mat((Texture)(object)DragonWaterLook.Soft(StormFx.Tex("Water/srd07.png", (TextureWrapMode)0), 0.4f), additive: false, new Color(0.55f, 0.83f, 1f, 1f), 1.15f, 3002); tubeRim = StormFx.Mat((Texture)(object)DragonWaterLook.FoamTex(StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0)), additive: true, new Color(0.95f, 0.99f, 1f, 1f), 1.4f, 3003); int n = data.bones.Length; Matrix4x4[] array = (Matrix4x4[])(object)new Matrix4x4[n]; restRel = (Matrix4x4[])(object)new Matrix4x4[n]; restRot = (Quaternion[])(object)new Quaternion[n]; for (int i = 0; i < n; i++) { BoneData boneData = data.bones[i]; Matrix4x4 val4 = Matrix4x4.TRS(V(boneData.rest.p), Q(boneData.rest.q), V(boneData.rest.s)); array[i] = ((boneData.parent < 0) ? val4 : (array[boneData.parent] * val4)); restRel[i] = array[i]; restRot[i] = ((Matrix4x4)(ref array[i])).rotation; } meshes = (Mesh[])(object)new Mesh[data.meshes.Length]; mats = (Material[])(object)new Material[data.meshes.Length]; for (int j = 0; j < data.meshes.Length; j++) { MeshData meshData = data.meshes[j]; Mesh val5 = new Mesh(); ((Object)val5).name = "Storm srd00 " + meshData.name; int num = meshData.v.Length / 3; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector3[] array3 = (Vector3[])(object)new Vector3[num]; Vector2[] array4 = (Vector2[])(object)new Vector2[num]; BoneWeight[] array5 = (BoneWeight[])(object)new BoneWeight[num]; for (int k = 0; k < num; k++) { array2[k] = new Vector3(meshData.v[k * 3], meshData.v[k * 3 + 1], meshData.v[k * 3 + 2]); array3[k] = new Vector3(meshData.n[k * 3], meshData.n[k * 3 + 1], meshData.n[k * 3 + 2]); array4[k] = new Vector2(meshData.uv[k * 2], meshData.uv[k * 2 + 1]); int num2 = k; BoneWeight val6 = default(BoneWeight); ((BoneWeight)(ref val6)).boneIndex0 = meshData.bi[k * 4]; ((BoneWeight)(ref val6)).boneIndex1 = meshData.bi[k * 4 + 1]; ((BoneWeight)(ref val6)).boneIndex2 = meshData.bi[k * 4 + 2]; ((BoneWeight)(ref val6)).boneIndex3 = meshData.bi[k * 4 + 3]; ((BoneWeight)(ref val6)).weight0 = meshData.bw[k * 4]; ((BoneWeight)(ref val6)).weight1 = meshData.bw[k * 4 + 1]; ((BoneWeight)(ref val6)).weight2 = meshData.bw[k * 4 + 2]; ((BoneWeight)(ref val6)).weight3 = meshData.bw[k * 4 + 3]; array5[num2] = val6; } val5.vertices = array2; val5.normals = array3; val5.uv = array4; val5.triangles = meshData.tri; val5.boneWeights = array5; val5.bindposes = array.Select((Matrix4x4 x) => ((Matrix4x4)(ref x)).inverse).ToArray(); StormFx.White(val5); if (meshData.name == "body01") { Vector3 ctr = Vector3.zero; Vector3[] array6 = array2; foreach (Vector3 val7 in array6) { ctr += val7; } ctr /= (float)Mathf.Max(1, num); float num4 = array2.Max(delegate(Vector3 p) { //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_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) Vector3 val12 = p - ctr; return ((Vector3)(ref val12)).magnitude; }); headManeW = new float[num]; headManeBase = (Vector3[])(object)new Vector3[num]; headManeTip = (Vector3[])(object)new Vector3[num]; Color32[] array7 = (Color32[])(object)new Color32[num]; for (int num5 = 0; num5 < num; num5++) { Vector3 val8 = array2[num5] - ctr; float magnitude = ((Vector3)(ref val8)).magnitude; float num6 = ((magnitude > 0.4f * num4) ? Mathf.SmoothStep(0f, 1f, (magnitude / num4 - 0.4f) / 0.5f) : 0f); headManeW[num5] = num6; if (num6 > 0f) { Vector3 val9 = val8 / magnitude; headManeBase[num5] = ctr + val9 * (0.4f * num4); headManeTip[num5] = ctr + val9 * (0.4f * num4 + (magnitude - 0.4f * num4) * 0.3f); } array7[num5] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(255f * (1f - 0.92f * Mathf.SmoothStep(0f, 1f, (num6 - 0.1f) / 0.6f)))); } val5.colors32 = array7; } val5.RecalculateBounds(); meshes[j] = val5; if (meshData.name == "body01" || meshData.name == "beard") { Vector3[] array8 = SmoothNormals(array2); float[] array9 = new float[num]; if (meshData.name == "body01") { Color32[] colors = val5.colors32; for (int num7 = 0; num7 < num; num7++) { array9[num7] = (float)(int)colors[num7].a / 255f; } headMesh = val5; headTip = array9; headSmooth = array8; int num8 = Array.FindIndex(data.bones, (BoneData b) => b.name.EndsWith("_head00")); float num9 = -99f; float num10 = 99f; for (int num11 = 0; num11 < num; num11++) { if (((BoneWeight)(ref array5[num11])).boneIndex0 == num8 && !(((BoneWeight)(ref array5[num11])).weight0 < 0.9f)) { if (array2[num11].y > num9) { num9 = array2[num11].y; SnoutTipIndex = num11; } if (array2[num11].y < num10) { num10 = array2[num11].y; SkullBackIndex = num11; } } } } else { Vector3 ctr2 = Vector3.zero; Vector3[] array6 = array2; foreach (Vector3 val10 in array6) { ctr2 += val10; } ctr2 /= (float)Mathf.Max(1, num); float num12 = array2.Max(delegate(Vector3 p) { //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_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) Vector3 val12 = p - ctr2; return ((Vector3)(ref val12)).magnitude; }); for (int num13 = 0; num13 < num; num13++) { int num14 = num13; Vector3 val11 = array2[num13] - ctr2; array9[num14] = 1f - 0.95f * Mathf.SmoothStep(0f, 1f, (((Vector3)(ref val11)).magnitude / num12 - 0.3f) / 0.6f); } beardMesh = val5; beardTip = array9; beardSmooth = array8; } } mats[j] = (meshData.name.EndsWith("_eye") ? eye : ((meshData.name == "body01" || meshData.name == "beard") ? val : ((meshData.name == "body03") ? val3 : val2))); } clips = data.clips.Select(delegate(ClipData c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown AnimationClip val12 = new AnimationClip { legacy = true, frameRate = 30f, wrapMode = (WrapMode)2 }; for (int l = 0; l < n; l++) { string text = data.bones[l].name; for (int parent = data.bones[l].parent; parent >= 0; parent = data.bones[parent].parent) { text = data.bones[parent].name + "/" + text; } for (int m = 0; m < 7; m++) { Keyframe[] array10 = (Keyframe[])(object)new Keyframe[c.frames.Length]; for (int num15 = 0; num15 < array10.Length; num15++) { PoseData poseData = c.frames[num15].bones[l]; array10[num15] = new Keyframe((float)num15 / 30f, (m < 3) ? poseData.p[m] : poseData.q[m - 3]); } val12.SetCurve(text, typeof(Transform), (m < 3) ? ("localPosition." + "xyz"[m]) : ("localRotation." + "xyzw"[m - 3]), new AnimationCurve(array10)); } } val12.EnsureQuaternionContinuity(); ((Object)val12).name = c.name; return val12; }).ToArray(); } private static Vector3[] SmoothNormals(Vector3[] v) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fb: 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_0119: 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) Dictionary dictionary = new Dictionary(); Vector3Int[] array = (Vector3Int[])(object)new Vector3Int[v.Length]; Vector3Int val2 = default(Vector3Int); for (int i = 0; i + 2 < v.Length; i += 3) { Vector3 val = Vector3.Cross(v[i + 1] - v[i], v[i + 2] - v[i]); for (int j = 0; j < 3; j++) { ((Vector3Int)(ref val2))..ctor(Mathf.RoundToInt(v[i + j].x * 500f), Mathf.RoundToInt(v[i + j].y * 500f), Mathf.RoundToInt(v[i + j].z * 500f)); array[i + j] = val2; dictionary.TryGetValue(val2, out var value); dictionary[val2] = value + val; } } Vector3[] array2 = (Vector3[])(object)new Vector3[v.Length]; for (int k = 0; k < v.Length; k++) { dictionary.TryGetValue(array[k], out var value2); array2[k] = ((((Vector3)(ref value2)).sqrMagnitude > 1E-12f) ? ((Vector3)(ref value2)).normalized : Vector3.up); } return array2; } public static Built Build(Transform parent) { //IL_0011: 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_002f: 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_0102: 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_014a: 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_0189: Expected O, but got Unknown //IL_03a8: 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) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) Built r = new Built(); Transform transform = new GameObject("StormWaterDragonRig").transform; transform.SetParent(parent, false); transform.localScale = Vector3.one * 4.4f; r.root = transform; int num = data.bones.Length; r.bones = (Transform[])(object)new Transform[num]; for (int i = 0; i < num; i++) { r.bones[i] = new GameObject(data.bones[i].name).transform; } for (int j = 0; j < num; j++) { BoneData boneData = data.bones[j]; r.bones[j].SetParent((boneData.parent < 0) ? transform : r.bones[boneData.parent], false); r.bones[j].localPosition = V(boneData.rest.p); r.bones[j].localRotation = Q(boneData.rest.q); r.bones[j].localScale = V(boneData.rest.s); } List list = new List(); for (int k = 0; k < meshes.Length; k++) { GameObject val = new GameObject(data.meshes[k].name); val.transform.SetParent(transform, false); SkinnedMeshRenderer val2 = val.AddComponent(); val2.sharedMesh = meshes[k]; val2.bones = r.bones; val2.rootBone = r.bones[0]; ((Renderer)val2).sharedMaterial = mats[k]; val2.updateWhenOffscreen = true; if (data.meshes[k].name == "body02" || data.meshes[k].name == "body03" || data.meshes[k].name == "body04") { val.SetActive(false); } ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; list.Add(val2); if (data.meshes[k].name == "body01") { r.headR = val2; } if (data.meshes[k].name == "beard") { r.beardR = val2; } } r.renderers = list.ToArray(); r.anim = ((Component)transform).gameObject.AddComponent(); r.anim.cullingType = (AnimationCullingType)0; AnimationClip[] array = clips; foreach (AnimationClip val3 in array) { r.anim.AddClip(val3, ((Object)val3).name); } r.restRot = restRot; r.trall = Array.FindIndex(data.bones, (BoneData b) => b.name.EndsWith("_trall")); r.trallRest = r.bones[r.trall].localRotation; r.trallRestPos = r.bones[r.trall].localPosition; r.whiskers = (Transform[])(object)new Transform[4] { B("_beard_l01"), B("_beard_l03"), B("_beard_r01"), B("_beard_r03") }; r.head = Array.FindIndex(data.bones, (BoneData b) => b.name.EndsWith("_head00")); if (r.head >= 0) { r.headRestPos = r.bones[r.head].localPosition; } r.chain = (from num2 in Enumerable.Range(1, 12) select Array.FindIndex(data.bones, (BoneData b) => b.name.EndsWith("_bone" + num2.ToString("00")))).ToArray(); return r; Transform B(string s) { int num2 = Array.FindIndex(data.bones, (BoneData b) => b.name.EndsWith(s)); if (num2 < 0) { return null; } return r.bones[num2]; } } } public class WaterSkin { private readonly SkinnedMeshRenderer src; private readonly Mesh body; private readonly Mesh rim; private readonly MeshRenderer bodyR; private readonly MeshRenderer rimR; private readonly Vector3[] restV; private readonly Vector3[] restN; private readonly Vector3[] outV; private readonly Vector3[] outN; private readonly Color[] bc; private readonly Color[] rc; private readonly float[] tip; private readonly BoneWeight[] w; private readonly Matrix4x4[] bind; private readonly Matrix4x4[] skin; private readonly float baseAlpha; private readonly float[] maneW; private readonly Vector3[] maneBase; private readonly Vector3[] maneTip; private bool valid; public WaterSkin(Transform parent, string name, SkinnedMeshRenderer s, Mesh m, Vector3[] smooth, float[] tips, float alpha, float[] mW = null, Vector3[] mBase = null, Vector3[] mTip = null) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown src = s; tip = tips; baseAlpha = alpha; maneW = mW; maneBase = mBase; maneTip = mTip; if (Object.op_Implicit((Object)(object)s) && Object.op_Implicit((Object)(object)m)) { ((Renderer)s).forceRenderingOff = true; restV = m.vertices; restN = smooth; w = m.boneWeights; bind = m.bindposes; skin = (Matrix4x4[])(object)new Matrix4x4[bind.Length]; outV = (Vector3[])(object)new Vector3[restV.Length]; outN = (Vector3[])(object)new Vector3[restV.Length]; bc = (Color[])(object)new Color[restV.Length]; rc = (Color[])(object)new Color[restV.Length]; body = new Mesh(); body.vertices = restV; body.uv = m.uv; body.triangles = m.triangles; body.colors = bc; body.MarkDynamic(); rim = new Mesh(); rim.vertices = restV; rim.uv = m.uv; rim.triangles = m.triangles; rim.colors = rc; rim.MarkDynamic(); GameObject val = new GameObject(name); val.transform.SetParent(parent, false); bodyR = StormFx.Part(val, "Water", body, DragonRig.tubeBody); rimR = StormFx.Part(val, "Rim", rim, DragonRig.tubeRim); } } public bool Centroid(out Vector3 c) { //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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) c = Vector3.zero; if (outV == null || !valid) { return false; } for (int i = 0; i < outV.Length; i++) { c += outV[i]; } c /= (float)outV.Length; return true; } public bool Point(int index, out Vector3 p) { //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_0034: 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) p = Vector3.zero; if (outV == null || !valid || index < 0 || index >= outV.Length) { return false; } p = outV[index]; return true; } private Vector3 Skin(Vector3 p, BoneWeight bw) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_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_0086: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Matrix4x4)(ref skin[((BoneWeight)(ref bw)).boneIndex0])).MultiplyPoint3x4(p) * ((BoneWeight)(ref bw)).weight0 + ((Matrix4x4)(ref skin[((BoneWeight)(ref bw)).boneIndex1])).MultiplyPoint3x4(p) * ((BoneWeight)(ref bw)).weight1; if (((BoneWeight)(ref bw)).weight2 > 0f) { val += ((Matrix4x4)(ref skin[((BoneWeight)(ref bw)).boneIndex2])).MultiplyPoint3x4(p) * ((BoneWeight)(ref bw)).weight2; } return val; } public void Update(Vector3 cam, float time, float tipPow = 1f, float mul = 1f, Vector3? comb = null, Vector3 axisO = default(Vector3), Vector3 axisD = default(Vector3), float maxR = 0f) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: 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_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0324: 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_032b: 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_0344: 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_0350: 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_03d5: 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_03dc: 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_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: 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_04ec: 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_0247: 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_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_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_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_028d: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: 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_02df: 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_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: 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) if (!Object.op_Implicit((Object)(object)src) || restV == null) { return; } Transform[] bones = src.bones; for (int i = 0; i < skin.Length; i++) { skin[i] = (Object.op_Implicit((Object)(object)bones[i]) ? (bones[i].localToWorldMatrix * bind[i]) : Matrix4x4.identity); } valid = true; MeshRenderer obj = bodyR; bool enabled = (((Renderer)rimR).enabled = mul > 0.01f); ((Renderer)obj).enabled = enabled; for (int j = 0; j < restV.Length; j++) { BoneWeight bw = w[j]; Matrix4x4 val = skin[((BoneWeight)(ref bw)).boneIndex0]; Matrix4x4 val2 = skin[((BoneWeight)(ref bw)).boneIndex1]; Vector3 val3 = ((Matrix4x4)(ref val)).MultiplyPoint3x4(restV[j]) * ((BoneWeight)(ref bw)).weight0 + ((Matrix4x4)(ref val2)).MultiplyPoint3x4(restV[j]) * ((BoneWeight)(ref bw)).weight1; Vector3 val4 = ((Matrix4x4)(ref val)).MultiplyVector(restN[j]) * ((BoneWeight)(ref bw)).weight0 + ((Matrix4x4)(ref val2)).MultiplyVector(restN[j]) * ((BoneWeight)(ref bw)).weight1; if (((BoneWeight)(ref bw)).weight2 > 0f) { val3 += ((Matrix4x4)(ref skin[((BoneWeight)(ref bw)).boneIndex2])).MultiplyPoint3x4(restV[j]) * ((BoneWeight)(ref bw)).weight2; val4 += ((Matrix4x4)(ref skin[((BoneWeight)(ref bw)).boneIndex2])).MultiplyVector(restN[j]) * ((BoneWeight)(ref bw)).weight2; } if (maneW != null && comb.HasValue && maneW[j] > 0f) { Vector3 val5 = Skin(maneBase[j], bw); Vector3 val6 = Skin(maneTip[j], bw) - val5; float magnitude = ((Vector3)(ref val6)).magnitude; if (magnitude > 0.0001f) { val3 = val5 + Vector3.Slerp(val6 / magnitude, comb.Value, 0.95f * maneW[j]) * magnitude; } if (maxR > 0f) { Vector3 val7 = val3 - axisO; float num = Vector3.Dot(val7, axisD); Vector3 val8 = val7 - axisD * num; float magnitude2 = ((Vector3)(ref val8)).magnitude; float num2 = Mathf.Lerp(magnitude2, Mathf.Min(magnitude2, maxR), Mathf.Clamp01(maneW[j] * 2.5f)); if (magnitude2 > 0.0001f) { val3 = axisO + axisD * num + val8 * (num2 / magnitude2); } } } ((Vector3)(ref val4)).Normalize(); outV[j] = val3; outN[j] = val4; Vector3 val9 = cam - val3; float magnitude3 = ((Vector3)(ref val9)).magnitude; val9 /= Mathf.Max(0.001f, magnitude3); float fres = 1f - Mathf.Abs(Vector3.Dot(val4, val9)); float num3 = Mathf.SmoothStep(0f, 1f, (magnitude3 - 3f) / 4f); float num4 = Mathf.SmoothStep(0f, 1f, (Mathf.Pow(tip[j], tipPow) - 0.1f) / 0.45f) * num3; num4 *= mul; float num5 = ((maneW != null) ? maneW[j] : 0f); Vector3 val10 = restV[j]; DragonWaterLook.Shade(val4, val9, fres, baseAlpha, num4, num5 * 0.55f, val10.x * 3f + val10.z * 2f, val10.y * 3f + val10.z, time, out bc[j], out rc[j]); if (num5 > 0.25f) { float num6 = Mathf.Clamp01((num5 - 0.25f) * 2f) * num3 * mul * 0.6f; rc[j] = Color.Lerp(rc[j], new Color(1f, 1f, 1f, 1f) * num6 * Mathf.SmoothStep(0f, 1f, (Mathf.PerlinNoise(val10.x * 4f, val10.y * 4f - time * 2f) - 0.35f) / 0.2f), 0.7f); } } body.vertices = outV; body.normals = outN; body.colors = bc; body.RecalculateBounds(); rim.vertices = outV; rim.normals = outN; rim.colors = rc; rim.bounds = body.bounds; StormFx.Scroll((Renderer)(object)bodyR, new Vector2(time * 0.07f, (0f - time) * 1.3f), Vector2.one * 2f); StormFx.Scroll((Renderer)(object)rimR, new Vector2((0f - time) * 0.1f, (0f - time) * 2f), Vector2.one * 2f); } } public class DragonFlight : MonoBehaviour { private DragonBody body; public static int Built; private void OnEnable() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { body = new GameObject("TobiramaDragonBody").AddComponent(); Built++; } body.Feed(((Component)this).transform.position, ((Component)this).transform.forward); } private void LateUpdate() { //IL_0019: 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 (Object.op_Implicit((Object)(object)body)) { body.Feed(((Component)this).transform.position, ((Component)this).transform.forward); } } private void OnDisable() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { body.Crash(((Component)this).transform.position); body = null; } } } public class DragonBody : MonoBehaviour { private WaterSkin headSkin; private WaterSkin beardSkin; private DragonRig.Built rig; private Transform tubeT; private Mesh bodyMesh; private Mesh rimMesh; private MeshRenderer bodyR; private MeshRenderer rimR; private ParticleSystem spray; private const int Rings = 32; private const int Sides = 14; private Vector3[] bv; private Vector3[] bn; private Color[] bc; private Color[] rc; private readonly List path = new List(); private readonly List arc = new List(); private Vector3 origin; private Vector3 forward; private Vector3 right; private Vector3 source; private Vector3 sourceTop; private Vector3 shoulder; private Vector3 lastHead; private Vector3 headDir; private Vector3 proj; private Vector3 projFwd; private float born; private float sprayAcc; private float grow = 1f; private float emerge = 1f; private bool begun; private bool fed; private bool crashed; private bool done; private string clipName; private Vector3 crashFrom; private Vector3 crashPoint; private Vector3 comb; private float crashAt; private float advance; private float lastSpeed = 34f; private float pourAcc; private float diveTime = 0.12f; public const float SwayA = 1.5f; public const float SwayW = 8.5f; public const float SwayV = 0.5f; public const float SwayFade = 0.5f; public const float Rise = 0.4f; public const float MinCamDist = 6.5f; public const float NoseDown = 0f; public const float HuntA1 = 0.9f; public const float HuntW1 = 2.1f; public const float HuntA2 = 0.35f; public const float HuntW2 = 3.7f; public const float HuntV = 0.35f; public const float HuntWV = 1.7f; public const float MaxPitch = 50f; public const float ThrashA = 2.4f; private float ph1; private float ph2; private float ph3; private float ph4; private float seed; private float nextLash; private const int MaxLash = 4; private readonly float[] lashT0 = new float[4]; private readonly float[] lashAmp = new float[4]; private readonly Vector2[] lashDir = (Vector2[])(object)new Vector2[4]; private Vector3[] ringP; private Vector3[] ringT; private float[] ringS; private float prevYaw = float.NaN; private float yawRate; private float prevYawRate; private float logRoll; private float logPitch; private int yawFlips; private Vector3 feedRaw; private Vector3 feedVel; private float feedAt = -1f; private static readonly Quaternion RigToForward = Quaternion.LookRotation(Vector3.down, Vector3.forward); private int clamps; private float minCam; private float latMax; public const float SwayAmp = 0.6f; public const float SwayPeriodMin = 0.75f; public const float SwayPeriodMax = 0.9f; public const float LungeMul = 1.4f; public const float LungeDur = 0.15f; public const float HoverAboveProj = 1.6f; private Vector2 dashFrom; private Vector2 dashTo; private Vector2 dashH; private float snapT0 = -1f; private float offL; private float offV; private float fwdOff; private float lungeT0 = -9f; private float lastLunge = -9f; private float nextLunge = -1f; private float nextBite = -1f; private float swayPh; private float swayW = 8f; private float prevOffL; private int snapCount; private int lungeCount; private float snapSum; private float snapMaxDeg; private float snapMinDeg = 999f; private bool commit; private float commitT0; private float commitDur; private Vector3 commitFrom; private Vector3 commitPoint; private string commitWhy; private Vector3 logPrev; private bool logHas; private int jaw = -1; private Quaternion jawRest = Quaternion.identity; private Vector3 jawAxis = Vector3.right; private float jawClipMax; private float logJaw; public const float JawRest = 8f; public const float JawBite = 25f; public const float JawImpact = 30f; private float jawRestOpen; private float logJawMeasured = -1f; private int jawTipI = -1; private int jawChecks; private bool jawFlipped; public const float NeckR = 0.6f; public const float PeakR = 0.72f; public const float PeakU = 0.06f; private int lashCount; private float logNeckR; private float logMaxR; private float logMaxU; private float logThrashTail; private static readonly MaterialPropertyBlock block = new MaterialPropertyBlock(); private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: 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_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: 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) rig = DragonRig.Build(((Component)this).transform); GameObject val = new GameObject("WaterBody"); val.transform.SetParent(((Component)this).transform, false); tubeT = val.transform; bodyMesh = TubeMesh(); rimMesh = TubeMesh(); bodyMesh.MarkDynamic(); rimMesh.MarkDynamic(); bodyR = StormFx.Part(val, "Body", bodyMesh, DragonRig.tubeBody); rimR = StormFx.Part(val, "Rim", rimMesh, DragonRig.tubeRim); headSkin = new WaterSkin(val.transform, "WaterHead", rig.headR, DragonRig.headMesh, DragonRig.headSmooth, DragonRig.headTip, 0.85f, DragonRig.headManeW, DragonRig.headManeBase, DragonRig.headManeTip); beardSkin = new WaterSkin(val.transform, "WaterWhiskers", rig.beardR, DragonRig.beardMesh, DragonRig.beardSmooth, DragonRig.beardTip, 0.7f); spray = StormFx.System(((Component)this).gameObject, "Spray", Water03.droplet, 220, 1.4f, stretch: true); StormFx.Fade(spray, new Color(0.8f, 0.92f, 1f), new Color(0.65f, 0.88f, 1f), 0.6f, 0.45f, 0.5f); ParticleSystemRenderer component = ((Component)spray).GetComponent(); component.renderMode = (ParticleSystemRenderMode)1; component.velocityScale = 0.05f; component.lengthScale = 1.3f; component.maxParticleSize = 0.018f; ph1 = Random.Range(0f, 6.28f); ph2 = Random.Range(0f, 6.28f); ph3 = Random.Range(0f, 6.28f); ph4 = Random.Range(0f, 6.28f); seed = Random.Range(0f, 100f); nextLash = Random.Range(0.35f, 0.6f); born = Time.time; clipName = ((Random.value < 0.5f) ? "blt01" : "blt02"); jaw = ((rig.bones == null) ? (-1) : Array.FindIndex(rig.bones, (Transform b) => Object.op_Implicit((Object)(object)b) && ((Object)b).name.EndsWith("_joe00"))); if (jaw >= 0) { jawRest = rig.bones[jaw].localRotation; } if (Object.op_Implicit((Object)(object)rig.anim) && TrackedReference.op_Implicit((TrackedReference)(object)rig.anim[clipName])) { rig.anim[clipName].speed = 1.2f; rig.anim.Play(clipName); if (jaw >= 0) { AnimationState val2 = rig.anim[clipName]; float num = 0f; float num3 = default(float); Vector3 val4 = default(Vector3); for (int num2 = 0; num2 < 16; num2++) { val2.time = (float)num2 / 16f * val2.length; rig.anim.Sample(); Quaternion val3 = Quaternion.Inverse(jawRest) * rig.bones[jaw].localRotation; ((Quaternion)(ref val3)).ToAngleAxis(ref num3, ref val4); if (num3 > 180f) { num3 -= 360f; } if (Mathf.Abs(num3) > Mathf.Abs(num) && ((Vector3)(ref val4)).sqrMagnitude > 0.5f) { num = num3; jawAxis = val4 * Mathf.Sign(num3); } } val2.time = 0f; jawClipMax = Mathf.Abs(num); } } jawRestOpen = JawRestOpening(); if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { Kit.Log("DRAGON_JAW bone=" + jaw + " clipMax=" + jawClipMax.ToString("0") + " restOpen=" + jawRestOpen.ToString("0.0") + " axis=" + ((Vector3)(ref jawAxis)).ToString("F2")); } spray.Clear(); spray.Play(); } private void Spray(Vector3 p, Vector3 v, float size, float life, Color ignored) { //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_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_006a: Unknown result type (might be due to invalid IL or missing references) Camera val = Cam(); float num = (Object.op_Implicit((Object)(object)val) ? Vector3.Distance(((Component)val).transform.position, p) : 99f); if (!(num < 4f)) { float num2 = Mathf.Clamp01((num - 4f) / 4f); StormFx.Emit(spray, p, v, size * 0.6f, life, new Color(0.78f, 0.9f, 1f, 0.5f * num2)); } } private Mesh TubeMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) Mesh val = new Mesh(); int num = 480; val.vertices = (Vector3[])(object)new Vector3[num]; val.colors = (Color[])(object)new Color[num]; Vector2[] array = (Vector2[])(object)new Vector2[num]; for (int i = 0; i < 32; i++) { for (int j = 0; j <= 14; j++) { array[i * 15 + j] = new Vector2((float)j / 14f * 2f, (float)i / 31f * 4.5f); } } val.uv = array; List list = new List(); for (int k = 0; k < 31; k++) { for (int l = 0; l < 14; l++) { int num2 = k * 15 + l; int num3 = num2 + 14 + 1; list.AddRange(new int[6] { num2, num3, num2 + 1, num2 + 1, num3, num3 + 1 }); } } val.triangles = list.ToArray(); val.bounds = new Bounds(Vector3.zero, Vector3.one * 200f); return val; } public void Feed(Vector3 pos, Vector3 fwd) { //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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) projFwd = fwd; fed = true; if (feedAt < 0f) { feedRaw = pos; feedAt = Time.time; proj = pos; return; } Vector3 val = pos - feedRaw; if (((Vector3)(ref val)).sqrMagnitude > 1E-06f) { float num = Mathf.Max(Time.time - feedAt, Time.fixedDeltaTime * 0.5f); Vector3 val2 = (pos - feedRaw) / num; feedVel = ((((Vector3)(ref val2)).magnitude < 120f) ? val2 : feedVel); feedRaw = pos; feedAt = Time.time; } Vector3 val3 = feedRaw + feedVel * Mathf.Min(Time.time - feedAt, Time.fixedDeltaTime * 1.2f); float deltaTime = Time.deltaTime; proj += feedVel * deltaTime; proj = Vector3.Lerp(proj, val3, 1f - Mathf.Exp((0f - deltaTime) * 18f)); val = proj - val3; if (((Vector3)(ref val)).sqrMagnitude > 9f) { proj = val3; } } public void Crash(Vector3 at) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_005a: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_03a7: 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_03e4: 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_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025f: 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_01a5: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_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_034b: 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_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) if (crashed || done) { return; } crashed = true; crashAt = Time.time; crashFrom = lastHead; advance = 0f; Vector3 val = ((((Vector3)(ref headDir)).sqrMagnitude > 0.01f) ? headDir : forward); Vector3 val2 = at + val * 1.2f; Vector3 val3 = Vector3.ProjectOnPlane(val, Vector3.up); Vector3 val4 = ((((Vector3)(ref val3)).sqrMagnitude > 0.01f) ? val : forward); RaycastHit val5 = default(RaycastHit); RaycastHit val6 = default(RaycastHit); if (Physics.SphereCast(at, 0.4f, val4, ref val5, 3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val5)).normal.y <= 0.55f) { val2 = ((RaycastHit)(ref val5)).point + ((RaycastHit)(ref val5)).normal * 0.4f; } else if (Physics.Raycast(at + Vector3.up * 0.5f, Vector3.down, ref val6, 41f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { Vector3 val7 = ((RaycastHit)(ref val6)).point + Vector3.up * 0.35f; val3 = Vector3.ProjectOnPlane(val, Vector3.up); val2 = val7 + ((Vector3)(ref val3)).normalized * 0.8f; } string text = "local"; if (ReliableWaterFlight.RecentSlam(at, 25f, out var r) && !r.reason.StartsWith("wall")) { Vector3 normalized; if (!(((Vector3)(ref r.dir)).sqrMagnitude > 0.01f)) { val3 = Vector3.ProjectOnPlane(val, Vector3.up); normalized = ((Vector3)(ref val3)).normalized; } else { normalized = ((Vector3)(ref r.dir)).normalized; } Vector3 val8 = normalized; val2 = (r.reason.StartsWith("large") ? (r.point + Vector3.up * 0.35f) : (r.point + Vector3.up * 0.35f + val8 * 1.2f)); text = r.reason; } if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { RaycastHit val9 = default(RaycastHit); float num = (Physics.Raycast(lastHead, Vector3.down, ref val9, 60f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? (lastHead.y - ((RaycastHit)(ref val9)).point.y) : (-1f)); Kit.Log("DRAGON_SLAM id=" + ((Object)this).GetInstanceID() + " reason=" + text + " head=" + ((Vector3)(ref lastHead)).ToString("F1") + " headHeight=" + num.ToString("0.00") + " point=" + ((Vector3)(ref val2)).ToString("F1") + " headToPoint=" + Vector3.Distance(lastHead, val2).ToString("0.0") + " pointToBurst=" + ((text == "local") ? (-1f) : Vector3.Distance(val2, r.center)).ToString("0.0") + " diveDown=" + (lastHead.y - val2.y).ToString("0.0")); } crashPoint = val2; diveTime = (commit ? Mathf.Clamp(Vector3.Distance(crashFrom, crashPoint) / 70f, 0.04f, 0.12f) : Mathf.Clamp(Vector3.Distance(crashFrom, crashPoint) / 50f, 0.16f, 0.4f)); Kit.Log("DRAGON_CRASH id=" + ((Object)this).GetInstanceID() + " at=" + ((Vector3)(ref at)).ToString("F1") + " point=" + ((Vector3)(ref val2)).ToString("F1") + " clamps=" + clamps + " minCamDist=" + minCam.ToString("0.0") + " lateralMax=" + latMax.ToString("0.00") + " snaps=" + snapCount + " snapMean=" + ((snapCount > 0) ? (snapSum / (float)snapCount) : 0f).ToString("0.0") + " snapMin=" + ((snapCount > 0) ? snapMinDeg : 0f).ToString("0.0") + " snapMax=" + snapMaxDeg.ToString("0.0") + " lunges=" + lungeCount + " cracks=" + lashCount); } private void Begin() { //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00fa: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0190: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) begun = true; origin = proj; forward = projFwd; Vector3 val = Vector3.ProjectOnPlane(forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); right = Vector3.Cross(Vector3.up, val); Vector3 val2 = origin - Vector3.up * 1.1f; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(origin + Vector3.up * 0.5f, Vector3.down, ref val3, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val3)).point; } source = WaterDragonCast.SourcePoint(origin, val2, val); sourceTop = source + Vector3.up * 2.4f + val * 2.6f; shoulder = val2 + Vector3.up * 3.6f + val * 4f + right * 1.2f; path.Add(source - Vector3.up * 0.6f); path.Add(source + Vector3.up * 0.8f); path.Add(sourceTop); arc.Add(0f); arc.Add(1.4f); arc.Add(1.4f + Vector3.Distance(path[1], path[2])); lastHead = sourceTop; Vector3 val4 = shoulder - sourceTop; headDir = ((Vector3)(ref val4)).normalized; clamps = 0; minCam = 999f; latMax = 0f; born = Time.time; } private static Vector3 Bezier(Vector3 a, Vector3 b, Vector3 c, float u) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) float num = 1f - u; return num * num * a + 2f * num * u * b + u * u * c; } private Vector3 ProjDir() { //IL_003d: 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_0025: Unknown result type (might be due to invalid IL or missing references) if (!(((Vector3)(ref feedVel)).sqrMagnitude > 1f)) { if (!(((Vector3)(ref projFwd)).sqrMagnitude > 0.01f)) { return forward; } return ((Vector3)(ref projFwd)).normalized; } return ((Vector3)(ref feedVel)).normalized; } private Vector3 ProjFlat() { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) Vector3 val = Vector3.ProjectOnPlane(ProjDir(), Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f)) { return forward; } return ((Vector3)(ref val)).normalized; } private Vector3 ProjSlope() { //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_0009: 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) Vector3 val = ProjDir(); val.y = Mathf.Clamp(val.y, -0.6f, 0.6f); return ((Vector3)(ref val)).normalized; } private float ProjSpeed() { return Mathf.Clamp(((Vector3)(ref feedVel)).magnitude, 20f, 80f); } private void UpdateDash(float t, float dt) { if (crashed || t < 0.4f) { return; } float num = ProjSpeed(); float num2 = Mathf.SmoothStep(0f, 1f, (t - 0.4f) / 0.3f); if (nextLunge < 0f) { nextLunge = t + Random.Range(0.15f, 0.3f); nextBite = t + Random.Range(0.4f, 0.6f); swayPh = Random.Range(0f, 6.28f); } swayPh += swayW * dt; if (swayPh > MathF.PI * 2f) { swayPh -= MathF.PI * 2f; swayW = MathF.PI * 2f / Random.Range(0.75f, 0.9f); } float num3 = 0.6f * (0.75f + 0.25f * Mathf.Sin(t * 1.3f + seed)); prevOffL = offL; offL = num3 * Mathf.Sin(swayPh) * num2; offV = 0f; if (t >= nextLunge) { lungeT0 = t; lastLunge = t; lungeCount++; nextLunge = t + Random.Range(0.55f, 1.1f); snapT0 = t; nextBite = t + Random.Range(0.3f, 0.45f); LungeSpray(); if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { Kit.Log("DRAGON_LUNGE id=" + ((Object)this).GetInstanceID() + " t=" + t.ToString("0.000") + " n=" + lungeCount); } } else if (t >= nextBite) { snapT0 = t; snapCount++; nextBite = t + Random.Range(0.45f, 0.8f); } if (t >= lungeT0 && t < lungeT0 + 0.15f) { fwdOff += 0.39999998f * num * dt; } else { fwdOff = Mathf.MoveTowards(fwdOff, 0f, 0.14f * num * dt); } } private void TryCommit(float t) { //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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01e7: 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_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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_024c: 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_025a: 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_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0268: 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_0277: 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_028d: 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_0094: 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_009f: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_029f: 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_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_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) float num = ProjSpeed(); Vector3 val = ProjFlat(); float num2 = num * 0.22f; RaycastHit val5 = default(RaycastHit); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.healthComponent) && readOnlyInstances.healthComponent.alive && (!Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) || (int)readOnlyInstances.teamComponent.teamIndex != 1) && ReliableWaterFlight.IsLarge(readOnlyInstances, out var _)) { Vector3 val2 = readOnlyInstances.corePosition - proj; float num3 = Vector3.Dot(val2, val); Vector3 val3 = val2 - val * num3; val3.y = 0f; float num4 = num3 - readOnlyInstances.radius - 1.7f; if (!(num3 < 0f) && !(num4 > num2) && !(((Vector3)(ref val3)).magnitude > 1.7f + readOnlyInstances.radius)) { Vector3 footPosition = readOnlyInstances.footPosition; Vector3 val4 = (Physics.Raycast(footPosition + Vector3.up * 1.5f, Vector3.down, ref val5, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val5)).point : footPosition); Commit(t, val4 + Vector3.up * 0.35f, Mathf.Clamp(num4 / num + 0.03f, 0.15f, 0.22f), "large"); return; } } } RaycastHit val6 = default(RaycastHit); if (Physics.SphereCast(proj, 0.45f, val, ref val6, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val6)).normal.y <= 0.55f) { Commit(t, ((RaycastHit)(ref val6)).point + ((RaycastHit)(ref val6)).normal * 0.4f, Mathf.Clamp(((RaycastHit)(ref val6)).distance / num, 0.12f, 0.22f), "wall"); return; } float num5 = KitTuning.WaterLife.Value - t; if (num5 <= 0.2f && num5 > 0.05f) { Vector3 val7 = proj + val * num * num5; Vector3 val8 = (Physics.Raycast(val7 + Vector3.up * 2f, Vector3.down, ref val5, 40f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val5)).point : (val7 - Vector3.up * 1.1f)); Commit(t, val8 + Vector3.up * 0.35f + val * 1.2f, Mathf.Max(0.15f, num5), "range"); } } private void Commit(float t, Vector3 point, float dur, string why) { //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_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_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) commit = true; commitT0 = t; commitDur = dur; commitFrom = lastHead; commitPoint = point; commitWhy = why; if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { Kit.Log("DRAGON_COMMIT id=" + ((Object)this).GetInstanceID() + " why=" + why + " t=" + t.ToString("0.000") + " dur=" + dur.ToString("0.000") + " from=" + ((Vector3)(ref lastHead)).ToString("F1") + " point=" + ((Vector3)(ref point)).ToString("F1") + " dist=" + Vector3.Distance(lastHead, point).ToString("0.0")); } } private void LungeSpray() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) SnapSpray(new Vector2((offL > 0f) ? (-20f) : 20f, 0f)); } private void SnapSpray(Vector2 d) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if (ringP != null) { Vector3 val = ProjDir(); Vector3 val2 = right * (0f - d.x) + Vector3.up * (0f - d.y) * 0.5f; Vector3 normalized = ((Vector3)(ref val2)).normalized; for (int i = 0; i < 10; i++) { Spray(lastHead + normalized * Random.Range(0.6f, 1.4f) * grow + Random.insideUnitSphere * 0.5f, normalized * Random.Range(8f, 15f) + val * Random.Range(-6f, 2f) + Vector3.up * Random.Range(1f, 4f), Random.Range(0.07f, 0.14f), Random.Range(0.3f, 0.55f), Color.white); } } } private Vector3 HeadAt(float t) { //IL_0001: 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_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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_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_0082: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = right * offL + Vector3.up * 1.6f + ProjSlope() * fwdOff; if (t >= 0.4f) { return proj + val; } float num = t / 0.4f; num = 1f - (1f - num) * (1f - num); return Bezier(sourceTop, shoulder, proj + val, num); } private void LateUpdate() { //IL_01b3: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0214: 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_01fa: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_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_0317: 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_0330: 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_02ce: 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_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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_038a: 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_025f: 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_0283: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0459: 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_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: 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_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: 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_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: 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_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0847: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08fe: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_091a: Unknown result type (might be due to invalid IL or missing references) //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0959: 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) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09d1: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_0a08: Unknown result type (might be due to invalid IL or missing references) //IL_0b86: Unknown result type (might be due to invalid IL or missing references) //IL_0b88: Unknown result type (might be due to invalid IL or missing references) //IL_0b8d: Unknown result type (might be due to invalid IL or missing references) //IL_0b92: Unknown result type (might be due to invalid IL or missing references) //IL_0b96: Unknown result type (might be due to invalid IL or missing references) //IL_0b9b: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a9d: Unknown result type (might be due to invalid IL or missing references) //IL_0a9f: Unknown result type (might be due to invalid IL or missing references) //IL_0aa4: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0aab: Unknown result type (might be due to invalid IL or missing references) //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0ab7: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0ac0: Unknown result type (might be due to invalid IL or missing references) //IL_0ac3: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Unknown result type (might be due to invalid IL or missing references) //IL_0ad4: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0af9: Unknown result type (might be due to invalid IL or missing references) //IL_0afe: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b0a: Unknown result type (might be due to invalid IL or missing references) //IL_0b0f: Unknown result type (might be due to invalid IL or missing references) //IL_0b19: Unknown result type (might be due to invalid IL or missing references) //IL_0b1e: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Unknown result type (might be due to invalid IL or missing references) //IL_0bc3: Unknown result type (might be due to invalid IL or missing references) //IL_0bc8: Unknown result type (might be due to invalid IL or missing references) //IL_0bcd: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0bd4: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Unknown result type (might be due to invalid IL or missing references) //IL_0be7: Unknown result type (might be due to invalid IL or missing references) //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0bf1: Unknown result type (might be due to invalid IL or missing references) //IL_0c02: Unknown result type (might be due to invalid IL or missing references) //IL_0c07: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0c20: Unknown result type (might be due to invalid IL or missing references) //IL_0c43: Unknown result type (might be due to invalid IL or missing references) if (done) { return; } if (!begun) { if (!fed) { return; } Begin(); } float num = Time.time - born; float deltaTime = Time.deltaTime; float num2 = 99f; Camera val = Cam(); Vector3 val2; if (!crashed) { UpdateDash(num, deltaTime); val2 = HeadAt(num); if (!commit && num >= 0.4f) { TryCommit(num); } if (commit) { float num3 = Mathf.Clamp01((num - commitT0) / commitDur); val2 = Vector3.Lerp(commitFrom, commitPoint, Mathf.Pow(num3, 1.6f)); if (num - commitT0 > commitDur + 0.35f) { commit = false; Kit.Log("DRAGON_COMMIT_CANCEL id=" + ((Object)this).GetInstanceID()); } } if (Object.op_Implicit((Object)(object)val)) { Vector3 val3 = val2 - ((Component)val).transform.position; num2 = ((Vector3)(ref val3)).magnitude; minCam = Mathf.Min(minCam, num2); if (num2 < 6.5f && num >= 0.4f) { clamps++; val2 = ((Component)val).transform.position + val3 / Mathf.Max(0.01f, num2) * 6.5f; num2 = 6.5f; } } latMax = Mathf.Max(latMax, Mathf.Abs(Vector3.Dot(val2 - origin, right))); } else { float num4 = Time.time - crashAt; val2 = Vector3.Lerp(crashFrom, crashPoint, Mathf.SmoothStep(0f, 1f, num4 / diveTime)); advance += lastSpeed * deltaTime; if (Object.op_Implicit((Object)(object)val)) { num2 = Vector3.Distance(val2, ((Component)val).transform.position); } } Vector3 val4 = val2 - lastHead; float num5 = ((Vector3)(ref val4)).magnitude / Mathf.Max(0.0001f, deltaTime); if (!crashed && num >= 0.45000002f) { if (((Vector3)(ref val4)).sqrMagnitude > 0.0004f) { Vector3 normalized = ((Vector3)(ref val4)).normalized; normalized.y = Mathf.Clamp(normalized.y, -0.35f, 0.35f); headDir = Vector3.Slerp(headDir, ((Vector3)(ref normalized)).normalized, 1f - Mathf.Exp((0f - deltaTime) * 14f)); lastSpeed = Mathf.Clamp(num5, 20f, 60f); } } else if (((Vector3)(ref val4)).sqrMagnitude > 0.0004f) { headDir = Vector3.Slerp(headDir, ((Vector3)(ref val4)).normalized, 1f - Mathf.Exp((0f - deltaTime) * 16f)); if (!crashed) { lastSpeed = Mathf.Clamp(num5, 20f, 60f); } } lastHead = val2; if (Vector3.Distance(path[path.Count - 1], val2) > 0.25f) { arc.Add(arc[arc.Count - 1] + Vector3.Distance(path[path.Count - 1], val2)); path.Add(val2); } float num6 = arc[arc.Count - 1] + Vector3.Distance(path[path.Count - 1], val2); float num7 = num6 + advance; Vector3 val5 = ((((Vector3)(ref headDir)).sqrMagnitude > 0.01f) ? headDir : forward); Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(val5.x, val5.z); float num8 = ((((Vector2)(ref val6)).sqrMagnitude > 0.0001f) ? (Mathf.Atan2(val5.x, val5.z) * 57.29578f) : ((prevYaw == prevYaw) ? prevYaw : (Mathf.Atan2(forward.x, forward.z) * 57.29578f))); float num9 = Mathf.Clamp(Mathf.Asin(Mathf.Clamp(val5.y, -1f, 1f)) * 57.29578f, -50f, 50f); Quaternion val7 = Quaternion.Euler(0f - num9, num8, 0f); Vector3 val8 = val7 * Vector3.forward; Quaternion val9 = Quaternion.Euler(0f - num9 + 0f, num8, 0f); if (prevYaw == prevYaw && deltaTime > 0.0001f) { float num10 = Mathf.DeltaAngle(prevYaw, num8) / deltaTime; if (!crashed && num > 0.45000002f && Mathf.Abs(num10) > 3f && Mathf.Abs(prevYawRate) > 3f && Mathf.Sign(num10) != Mathf.Sign(prevYawRate)) { yawFlips++; } prevYawRate = num10; yawRate = num10; } prevYaw = num8; logPitch = num9; if (rig.trall >= 0) { rig.bones[rig.trall].localRotation = rig.trallRest; rig.bones[rig.trall].localPosition = rig.trallRestPos; } if (rig.head >= 0) { rig.bones[rig.head].localRotation = Quaternion.identity; rig.bones[rig.head].localPosition = rig.headRestPos; } emerge = Mathf.SmoothStep(0f, 1f, num / 0.2f); grow = (Mathf.Clamp(num2 / 14f, 1f, 2.2f) + 0.8f * Mathf.Clamp01((num2 - 31f) / 50f)) * Mathf.Lerp(0.6f, 1f, emerge); UpdateLashes(num, deltaTime); float num11 = (crashed ? (1f - Mathf.Clamp01((Time.time - crashAt - 0.04f) / 0.16f)) : 1f); float num12 = 4.4f * grow * Mathf.Lerp(0.7f, 1f, num11); rig.root.position = val2 - val8 * (0.68f * num12); rig.root.rotation = val9 * RigToForward; rig.root.localScale = Vector3.one * num12; for (int i = 0; i < rig.chain.Length; i++) { Transform val10 = rig.bones[rig.chain[i]]; float num13 = (float)i * 21f / (float)(rig.chain.Length - 1); Sample(num7 - num13, val2, out var p, out var tan); p = (val10.position = p + Thrash(num13, num, tan)); val10.rotation = Quaternion.LookRotation(tan, Vector3.up) * RigToForward * rig.restRot[rig.chain[i]]; if (i == 0) { val10.localScale = Vector3.one * (0.94838095f / (4.4f * grow)); } } DriveJaw(num); SweepWhiskers(val7, num); HeadLog(num, val2, deltaTime); Vector3 val12 = -val8 + Vector3.down * 0.8f; _ = ((Vector3)(ref val12)).normalized; BuildTube(num7, num6, val2, num); LashSpray(num); val12 = Thrash(21f, num, ringT[31]); logThrashTail = ((Vector3)(ref val12)).magnitude; Vector3 cam = (Object.op_Implicit((Object)(object)val) ? ((Component)val).transform.position : (val2 - headDir * 10f)); WaterSkin waterSkin = headSkin; float time = Time.time; float tipPow = 1f + 3f * (1f - emerge); Vector3? val13 = comb; val12 = default(Vector3); Vector3 axisO = val12; val12 = default(Vector3); waterSkin.Update(cam, time, tipPow, num11, val13, axisO, val12); WaterSkin waterSkin2 = beardSkin; float time2 = Time.time; float tipPow2 = 1f + 3f * (1f - emerge); val12 = default(Vector3); Vector3 axisO2 = val12; val12 = default(Vector3); waterSkin2.Update(cam, time2, tipPow2, num11, null, axisO2, val12); MeasureJaw(); SkinnedMeshRenderer[] renderers = rig.renderers; for (int j = 0; j < renderers.Length; j++) { FadeRenderer((Renderer)(object)renderers[j]); } StormFx.Scroll((Renderer)(object)bodyR, new Vector2(Time.time * 0.06f, (0f - Time.time) * 1.6f), new Vector2(1f, 1f)); StormFx.Scroll((Renderer)(object)rimR, new Vector2((0f - Time.time) * 0.1f, (0f - Time.time) * 2.3f), new Vector2(1f, 1f)); float num14 = (crashed ? Mathf.Clamp(21f - advance, 0f, 21f) : 21f); if (num14 > 1f) { sprayAcc += deltaTime * 70f; while (sprayAcc >= 1f) { sprayAcc -= 1f; float num15 = Random.Range(advance, 21f); Sample(num7 - num15, val2, out var p2, out var tan2); p2 += Thrash(num15, num, tan2); val12 = Vector3.Cross(tan2, Random.onUnitSphere); Vector3 normalized2 = ((Vector3)(ref val12)).normalized; Spray(p2 + normalized2 * Radius(num15 / 21f) * 0.9f, normalized2 * Random.Range(1.5f, 4f) - tan2 * 6f + Vector3.up * 1.5f, Random.Range(0.05f, 0.11f), Random.Range(0.35f, 0.7f), Color.white); } } if (crashed && num14 > 0f) { pourAcc += deltaTime * 90f; val12 = Vector3.ProjectOnPlane(val8, Vector3.up); Vector3 normalized3 = ((Vector3)(ref val12)).normalized; while (pourAcc >= 1f) { pourAcc -= 1f; Vector3 val14 = Quaternion.AngleAxis(Random.Range(-70f, 70f), Vector3.up) * normalized3; Spray(crashPoint + Random.insideUnitSphere * 0.8f, val14 * Random.Range(3f, 9f) + Vector3.up * Random.Range(2f, 6f), Random.Range(0.08f, 0.18f), Random.Range(0.5f, 0.9f), Color.white); } } if (crashed && advance > 25f) { done = true; Object.Destroy((Object)(object)((Component)this).gameObject, 1.2f); MeshRenderer obj = bodyR; bool enabled = (((Renderer)rimR).enabled = false); ((Renderer)obj).enabled = enabled; } } private void HeadLog(float t, Vector3 head, float dt) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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_0160: 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_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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: 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_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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: 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_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02da: 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_02df: 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_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: 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_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_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0604: 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_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) if (KitTuning.Verbose == null || !KitTuning.Verbose.Value) { return; } if (!logHas) { logHas = true; logPrev = head; return; } Vector3 val = (head - logPrev) / Mathf.Max(0.0001f, dt); logPrev = head; if (!(((Vector3)(ref val)).magnitude < 1f)) { RaycastHit val2 = default(RaycastHit); float num = (Physics.Raycast(head + Vector3.up * 0.2f, Vector3.down, ref val2, 60f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? (head.y - ((RaycastHit)(ref val2)).point.y) : (-1f)); string[] obj = new string[17] { "DRAGON_FLY id=", ((Object)this).GetInstanceID().ToString(), " t=", t.ToString("0.000"), crashed ? " CRASH" : "", " h=", num.ToString("0.00"), " yawV=", (Mathf.Atan2(val.x, val.z) * 57.29578f).ToString("0.00"), " pitchV=", null, null, null, null, null, null, null }; float y = val.y; Vector2 val3 = new Vector2(val.x, val.z); obj[10] = (Mathf.Atan2(y, ((Vector2)(ref val3)).magnitude) * 57.29578f).ToString("0.0"); obj[11] = " lat="; obj[12] = offL.ToString("0.00"); obj[13] = " fwdOff="; obj[14] = fwdOff.ToString("0.00"); obj[15] = " speed="; obj[16] = ((Vector3)(ref val)).magnitude.ToString("0.0"); Kit.Log(string.Concat(obj)); Vector3 val4 = ((rig.head >= 0) ? (rig.bones[rig.head].rotation * Vector3.up) : (rig.root.rotation * Vector3.up)); Vector3 val5 = rig.root.rotation * Vector3.up; Vector3 p = Vector3.zero; Vector3 p2 = Vector3.zero; bool flag = headSkin.Point(DragonRig.SnoutTipIndex, out p) & headSkin.Point(DragonRig.SkullBackIndex, out p2); Vector3 val6 = (flag ? (p - p2) : val4); Vector3 val7; if (rig.trall < 0) { val7 = Vector3.zero; } else { Quaternion localRotation = rig.bones[rig.trall].localRotation; val7 = ((Quaternion)(ref localRotation)).eulerAngles; } Vector3 val8 = val7; Vector3 val9 = ((rig.head >= 0) ? (rig.bones[rig.head].rotation * Vector3.back) : (rig.root.rotation * Vector3.back)); float num2 = Vector3.SignedAngle(Vector3.ProjectOnPlane(Vector3.up, val4), Vector3.ProjectOnPlane(val9, val4), val4); float x = rig.root.localScale.x; Kit.Log("DRAGON_SHAPE id=" + ((Object)this).GetInstanceID() + " t=" + t.ToString("0.000") + " roll=" + num2.ToString("0.0") + " pitch=" + logPitch.ToString("0.0") + " yaw=" + prevYaw.ToString("0.0") + " yawRate=" + yawRate.ToString("0.0") + " yawFlips=" + yawFlips + " headScale=" + x.ToString("0.00") + " skullWidth=" + (0.55f * x).ToString("0.00") + " maneSpan=" + (0.97f * x).ToString("0.00") + " neckRadius=" + logNeckR.ToString("0.00") + " bodyMaxRadius=" + logMaxR.ToString("0.00") + " bodyMaxAt=" + logMaxU.ToString("0.00") + " thrashTail=" + logThrashTail.ToString("0.00") + " lashes=" + lashCount + " jaw=" + logJaw.ToString("0.0") + " jawMeasured=" + logJawMeasured.ToString("0.0") + " jawClipMax=" + jawClipMax.ToString("0") + " grow=" + grow.ToString("0.00")); Kit.Log("DRAGON_HEAD id=" + ((Object)this).GetInstanceID() + " t=" + t.ToString("0.000") + (crashed ? " CRASH" : "") + " speed=" + ((Vector3)(ref val)).magnitude.ToString("0.0") + " snoutVel=" + Vector3.Angle(val6, val).ToString("0.0") + " boneVel=" + Vector3.Angle(val4, val).ToString("0.0") + " rootVel=" + Vector3.Angle(val5, val).ToString("0.0") + " meshSnout=" + (flag ? 1 : 0) + " trall=(" + W(val8.x).ToString("0") + "," + W(val8.y).ToString("0") + "," + W(val8.z).ToString("0") + ") clip=" + ((Object.op_Implicit((Object)(object)rig.anim) && rig.anim.IsPlaying(clipName)) ? rig.anim[clipName].time.ToString("0.00") : "off") + " lat=" + Vector3.Dot(head - origin, right).ToString("0.00") + " camDist=" + Vector3.Distance(head, Object.op_Implicit((Object)(object)Cam()) ? ((Component)Cam()).transform.position : head).ToString("0.0") + " pos=" + ((Vector3)(ref head)).ToString("F1")); } static float W(float a) { if (!(a > 180f)) { return a; } return a - 360f; } } private void Sample(float s, Vector3 head, out Vector3 p, out Vector3 tan) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00ff: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_012c: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_01f9: 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) int count = path.Count; float num = arc[count - 1]; if (s >= num) { float num2 = Vector3.Distance(path[count - 1], head); float num3 = ((num2 > 0.001f) ? Mathf.Clamp01((s - num) / num2) : 1f); p = Vector3.Lerp(path[count - 1], head, num3); tan = head - path[count - 1]; if (((Vector3)(ref tan)).sqrMagnitude < 0.0001f) { tan = headDir; } ((Vector3)(ref tan)).Normalize(); return; } if (s <= 0f) { Vector3 val = path[0]; Vector3 val2 = path[1] - path[0]; p = val + ((Vector3)(ref val2)).normalized * s * 0.15f; val2 = path[1] - path[0]; tan = ((Vector3)(ref val2)).normalized; return; } int num4 = arc.BinarySearch(s); if (num4 < 0) { num4 = ~num4 - 1; } num4 = Mathf.Clamp(num4, 0, count - 2); float num5 = arc[num4 + 1] - arc[num4]; float num6 = ((num5 > 0.0001f) ? ((s - arc[num4]) / num5) : 0f); p = Vector3.Lerp(path[num4], path[num4 + 1], num6); Vector3 val3 = path[Mathf.Min(num4 + 1, count - 1)] - path[Mathf.Max(num4 - 1, 0)]; tan = ((((Vector3)(ref val3)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val3)).normalized : headDir); } private void MeasureJaw() { //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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00da: Unknown result type (might be due to invalid IL or missing references) if (jaw < 0 || jawTipI < 0 || !headSkin.Point(jawTipI, out var p) || !headSkin.Point(DragonRig.SnoutTipIndex, out var p2)) { return; } Vector3 val = rig.root.rotation * Vector3.right; Vector3 position = rig.bones[jaw].position; logJawMeasured = Vector3.Angle(Vector3.ProjectOnPlane(p - position, val), Vector3.ProjectOnPlane(p2 - position, val)); if (!jawFlipped && jawChecks < 3 && logJaw <= 8.1f) { jawChecks++; if (logJawMeasured > 33f) { jawAxis = -jawAxis; jawFlipped = true; Kit.Log("DRAGON_JAW flipped hinge (measured " + logJawMeasured.ToString("0") + " deg at rest)"); } } } private float JawRestOpening() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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) Mesh headMesh = DragonRig.headMesh; if (!Object.op_Implicit((Object)(object)headMesh) || jaw < 0) { return 0f; } Vector3[] vertices = headMesh.vertices; BoneWeight[] boneWeights = headMesh.boneWeights; Matrix4x4[] bindposes = headMesh.bindposes; if (jaw >= bindposes.Length) { return 0f; } Matrix4x4 inverse = ((Matrix4x4)(ref bindposes[jaw])).inverse; Vector4 column = ((Matrix4x4)(ref inverse)).GetColumn(3); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(column.x, column.y, column.z); int num = -1; float num2 = -1E+09f; for (int i = 0; i < vertices.Length; i++) { if (((BoneWeight)(ref boneWeights[i])).boneIndex0 == jaw && ((BoneWeight)(ref boneWeights[i])).weight0 > 0.85f && vertices[i].y > num2) { num2 = vertices[i].y; num = i; } } jawTipI = num; if (num < 0 || DragonRig.SnoutTipIndex < 0) { return 0f; } Vector3 val2 = vertices[num] - val; Vector3 val3 = vertices[DragonRig.SnoutTipIndex] - val; float num3 = Mathf.Atan2(val2.z, val2.y) * 57.29578f; return Mathf.Clamp(Mathf.DeltaAngle(Mathf.Atan2(val3.z, val3.y) * 57.29578f, num3), 0f, 80f); } private void DriveJaw(float t) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (jaw < 0 || !Object.op_Implicit((Object)(object)rig.bones[jaw])) { return; } float num = 8f; if (crashed) { num = Mathf.Lerp(8f, 30f, Mathf.Clamp01((Time.time - crashAt) / 0.06f)); } else if (snapT0 >= 0f) { float num2 = t - snapT0; if (num2 >= 0f && num2 < 0.06f) { num = Mathf.Lerp(8f, 25f, num2 / 0.06f); } else if (num2 >= 0.06f && num2 < 0.1f) { num = Mathf.Lerp(25f, 8f, (num2 - 0.06f) / 0.04f); } } rig.bones[jaw].localRotation = jawRest * Quaternion.AngleAxis(num - jawRestOpen, jawAxis); logJaw = num; } private void SweepWhiskers(Quaternion look, float t) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0087: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (rig.whiskers == null) { return; } Vector3 val = look * Vector3.forward; Vector3 val2 = look * Vector3.up; for (int i = 0; i < rig.whiskers.Length; i += 2) { Transform val3 = rig.whiskers[i]; Transform val4 = rig.whiskers[i + 1]; if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val4)) { Vector3 val5 = val4.position - val3.position; if (!(((Vector3)(ref val5)).sqrMagnitude < 1E-06f)) { Vector3 val6 = Vector3.Slerp(((Vector3)(ref val5)).normalized, -val, 0.72f); val3.rotation = Quaternion.AngleAxis(8f * Mathf.Sin(t * 11f + (float)i), val2) * Quaternion.FromToRotation(val5, val6) * val3.rotation; } } } } private static float Radius(float u) { if (u < 0.06f) { return Mathf.Lerp(0.6f, 0.72f, Mathf.SmoothStep(0f, 1f, u / 0.06f)); } float num = (u - 0.06f) / 0.94f; return 0.72f * (1f - 0.88f * Mathf.Pow(num, 1.15f)) * (1f - Mathf.SmoothStep(0f, 1f, (u - 0.9f) / 0.1f)); } private Vector3 Thrash(float s, float t, Vector3 tan) { //IL_003e: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) float num = s / 21f; if (Mathf.SmoothStep(0f, 1f, (num - 0.05f) / 0.45f) * (0.45f + 0.55f * Mathf.Clamp01(num)) <= 0f) { return Vector3.zero; } float num2 = Mathf.SmoothStep(0f, 1f, (t - 0.15f) / 0.3f) * (crashed ? Mathf.Clamp01(1f - (Time.time - crashAt) / 0.35f) : 1f); if (num2 <= 0f) { return Vector3.zero; } Vector3 val = Vector3.Cross(Vector3.up, tan); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = right; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(tan, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num3 = 0f; float num4 = 0f; float num5 = Mathf.Pow(Mathf.SmoothStep(0f, 1f, (num - 0.45f) / 0.55f), 1.4f); if (num5 <= 0f) { return Vector3.zero; } for (int i = 0; i < 4; i++) { if (!(lashAmp[i] <= 0f)) { float num6 = t - lashT0[i] - (1f - num) * 0.04f; if (!(num6 < 0f) && !(num6 > 0.34f)) { float num7 = ((num6 < 0.035f) ? (num6 / 0.035f) : (Mathf.Exp((0f - (num6 - 0.035f)) / 0.075f) * Mathf.Cos((num6 - 0.035f) * 24f))) * lashAmp[i]; num3 += num7 * lashDir[i].x; num4 += num7 * lashDir[i].y; } } } return (val * num3 + normalized * num4) * (2.4f * num5 * num2 * Mathf.Sqrt(Mathf.Max(1f, grow))); } private void UpdateLashes(float t, float dt) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { if (lashAmp[i] > 0f && t - lashT0[i] > 0.45f) { lashAmp[i] = 0f; } } if (crashed || t < 0.5f || t < nextLash) { return; } Vector2 val = default(Vector2); for (int j = 0; j < 4; j++) { if (lashAmp[j] <= 0f) { lashT0[j] = t; lashAmp[j] = Random.Range(1.9f, 2.6f); ((Vector2)(ref val))..ctor((float)((!(Random.value < 0.5f)) ? 1 : (-1)) * Random.Range(0.5f, 1f), Random.Range(-0.85f, 0.85f)); lashDir[j] = ((Vector2)(ref val)).normalized; lashCount++; if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { Kit.Log("DRAGON_CRACK id=" + ((Object)this).GetInstanceID() + " t=" + t.ToString("0.000") + " amp=" + lashAmp[j].ToString("0.00")); } break; } } nextLash = t + Random.Range(0.22f, 0.85f); } private void LashSpray(float t) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0128: 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_0152: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) if (ringP == null || crashed) { return; } for (int i = 0; i < 4; i++) { if (lashAmp[i] <= 0f) { continue; } float num = t - lashT0[i]; if (!(num < 0.02f) && !(num > 0.12f)) { float num2 = 18.9f; int num3 = Mathf.Clamp(Mathf.RoundToInt(num2 / 23.5f * 31f), 1, 30); Vector3 val = ringT[num3]; Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.Cross(val, normalized); val2 = normalized * lashDir[i].x + val3 * lashDir[i].y; Vector3 normalized2 = ((Vector3)(ref val2)).normalized; for (int j = 0; j < 3; j++) { Spray(ringP[num3] + normalized2 * Radius(num2 / 21f) * grow + Random.insideUnitSphere * 0.4f, normalized2 * Random.Range(7f, 13f) + Vector3.up * Random.Range(1f, 3.5f) - val * 4f, Random.Range(0.06f, 0.13f), Random.Range(0.35f, 0.6f), Color.white); } } } } private static Camera Cam() { foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.sceneCam)) { return readOnlyInstances.sceneCam; } } return Camera.main; } private void BuildTube(float total, float pathEnd, Vector3 head, float t) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_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_0120: 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_012c: 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_0162: 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_0173: 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_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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: 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_0293: 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_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_035b: 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_0616: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: 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_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: 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_04dd: Unknown result type (might be due to invalid IL or missing references) if (bv == null) { int num = 480; bv = (Vector3[])(object)new Vector3[num]; bn = (Vector3[])(object)new Vector3[num]; bc = (Color[])(object)new Color[num]; rc = (Color[])(object)new Color[num]; ringP = (Vector3[])(object)new Vector3[32]; ringT = (Vector3[])(object)new Vector3[32]; ringS = new float[32]; } Camera val = Cam(); Vector3 val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).transform.position : (head - headDir * 10f)); tubeT.position = Vector3.zero; tubeT.rotation = Quaternion.identity; tubeT.localScale = Vector3.one; Matrix4x4 worldToLocalMatrix = tubeT.worldToLocalMatrix; Vector3 val3 = Vector3.up; Vector3 val4 = rig.root.rotation * Vector3.up; for (int i = 0; i < 32; i++) { float num2 = (float)i / 31f; float num3 = num2 * 23.5f; float num4 = total - num3; Sample(num4, head, out var p, out var tan); p += val4 * (1f * grow * (1f - Mathf.SmoothStep(0f, 1f, num2 / 0.12f))); ringP[i] = p + Thrash(num3, t, tan); ringT[i] = tan; ringS[i] = num4; } for (int j = 0; j < 32; j++) { Vector3 val5 = ringP[Mathf.Max(0, j - 1)] - ringP[Mathf.Min(31, j + 1)]; if (((Vector3)(ref val5)).sqrMagnitude > 0.0001f) { ringT[j] = ((Vector3)(ref val5)).normalized; } } logMaxR = 0f; logThrashTail = 0f; for (int k = 0; k < 32; k++) { float num5 = (float)k / 31f; float num6 = ringS[k]; Vector3 val6 = ringP[k]; Vector3 val7 = ringT[k]; Vector3 val8 = Vector3.ProjectOnPlane(val3, val7); if (((Vector3)(ref val8)).sqrMagnitude < 0.001f) { val8 = Vector3.ProjectOnPlane(Vector3.forward, val7); } ((Vector3)(ref val8)).Normalize(); val3 = val8; Vector3 val9 = Vector3.Cross(val7, val8); float num7 = Radius(num5) * grow * (1f + 0.05f * Mathf.Sin(t * 13f - num5 * 18f)); if (k == 1) { logNeckR = num7; } if (num7 > logMaxR) { logMaxR = num7; logMaxU = num5; } float num8 = Mathf.Clamp01(num6 / 1.2f); num7 *= Mathf.Lerp(0.55f, 1f, num8); float num9 = (crashed ? Mathf.Clamp01((num6 - pathEnd) / 2.5f) : 0f); num7 *= 1f - 0.6f * num9; float num10 = 1f - num9; float num11 = Vector3.Distance(val2, val6); num7 *= Mathf.Lerp(0.5f, 1f, Mathf.SmoothStep(0f, 1f, (num11 - 4f) / 4f)); for (int l = 0; l <= 14; l++) { float num12 = (float)l / 14f * MathF.PI * 2f; Vector3 val10 = val8 * Mathf.Cos(num12) + val9 * Mathf.Sin(num12); Vector3 val11 = val6 + val10 * num7; int num13 = k * 15 + l; bv[num13] = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(val11); bn[num13] = val10; Vector3 val12 = val2 - val11; float magnitude = ((Vector3)(ref val12)).magnitude; val12 /= Mathf.Max(0.001f, magnitude); float fres = 1f - Mathf.Abs(Vector3.Dot(val10, val12)); float num14 = Mathf.SmoothStep(0f, 1f, (magnitude - 4f) / 5f); float num15 = (1f - Mathf.SmoothStep(0f, 1f, (num5 - 0.8f) / 0.2f)) * (0.75f + 0.25f * Mathf.SmoothStep(0f, 1f, num5 / 0.05f)) * num10; float num16 = Mathf.Clamp01(Vector3.Dot(val10, Vector3.up)) * 0.25f; DragonWaterLook.Shade(val10, val12, fres, 0.42f, num14 * num15, num16 * 1.6f, (float)l * 0.55f + num6 * 0.05f, num6 * 0.45f, t, out bc[num13], out rc[num13]); } } bodyMesh.vertices = bv; bodyMesh.normals = bn; bodyMesh.colors = bc; rimMesh.vertices = bv; rimMesh.normals = bn; rimMesh.colors = rc; bodyMesh.RecalculateBounds(); rimMesh.bounds = bodyMesh.bounds; if (!crashed || KitTuning.Verbose == null || !KitTuning.Verbose.Value) { return; } int num17 = 0; float num18 = 0f; float num19 = 0f; for (int m = 0; m < 32; m++) { int num20 = m * 15; Matrix4x4 inverse = ((Matrix4x4)(ref worldToLocalMatrix)).inverse; if (Vector3.Distance(((Matrix4x4)(ref inverse)).MultiplyPoint3x4(bv[num20]), head) < 0.5f) { num17++; } num18 = Mathf.Max(num18, bc[num20].a); if (m > 12) { num19 = Mathf.Max(num19, bc[num20].a); } } Kit.Log("DRAGON_POUR t=" + t.ToString("0.000") + " tc=" + (Time.time - crashAt).ToString("0.000") + " advance=" + advance.ToString("0.0") + " lastSpeed=" + lastSpeed.ToString("0.0") + " pathEnd=" + pathEnd.ToString("0.0") + " arcEnd=" + arc[arc.Count - 1].ToString("0.0") + " pts=" + path.Count + " ringsAtHead=" + num17 + " maxAlpha=" + num18.ToString("0.00") + " farAlpha=" + num19.ToString("0.00") + " bodyOn=" + ((Renderer)bodyR).enabled + " done=" + done); } private static void FadeRenderer(Renderer r) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) Camera val = Cam(); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)r)) { Vector3 position = ((Component)val).transform.position; Bounds bounds = r.bounds; float num = Mathf.Clamp01((Vector3.Distance(position, ((Bounds)(ref bounds)).ClosestPoint(((Component)val).transform.position)) - 1.5f) / 5f); r.GetPropertyBlock(block); Color color = r.sharedMaterial.GetColor("_TintColor"); color.a *= num; block.SetColor("_TintColor", color); r.SetPropertyBlock(block); } } } public static class DragonWaterLook { public static Texture2D foamTex; private static readonly Vector3 Key; public static Texture2D FoamTex(Texture2D streaks) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)foamTex)) { return foamTex; } Texture2D val = new Texture2D(128, 128, (TextureFormat)4, true); ((Texture)val).wrapMode = (TextureWrapMode)0; Color[] array = (Color[])(object)new Color[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = 0f; float num2 = 1f; float num3 = 0f; for (int k = 0; k < 4; k++) { float f = 4 << k; num += num2 * TileNoise((float)j / 128f, (float)i / 128f, f, (float)k * 17.3f); num3 += num2; num2 *= 0.55f; } num /= num3; float num4 = Mathf.SmoothStep(0f, 1f, (num - 0.5f) / 0.1f); float num5 = Mathf.SmoothStep(0f, 1f, (TileNoise((float)j / 128f, (float)i / 128f, 16f, 91f) - 0.62f) / 0.08f); num4 *= 1f - 0.85f * num5; float num6 = 0f; if (Object.op_Implicit((Object)(object)streaks)) { Color pixelBilinear = streaks.GetPixelBilinear((float)j / 128f, (float)i / 128f); num6 = pixelBilinear.a * (pixelBilinear.r + pixelBilinear.g + pixelBilinear.b) / 3f; } array[i * 128 + j] = new Color(1f, 1f, 1f, Mathf.Clamp01(num4 + 0.28f * num6)); } } val.SetPixels(array); val.Apply(true); foamTex = val; return val; } public static Texture2D Soft(Texture2D src, float k) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005a: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)src) || !((Texture)src).isReadable) { return src; } Color[] pixels = src.GetPixels(); Color val = Color.clear; Color[] array = pixels; foreach (Color val2 in array) { val += val2; } val /= (float)Mathf.Max(1, pixels.Length); for (int j = 0; j < pixels.Length; j++) { pixels[j] = Color.Lerp(val, pixels[j], k); } Texture2D val3 = new Texture2D(((Texture)src).width, ((Texture)src).height, (TextureFormat)4, true) { wrapMode = ((Texture)src).wrapMode }; val3.SetPixels(pixels); val3.Apply(true); return val3; } private static float TileNoise(float u, float v, float f, float seed) { float num = Mathf.PerlinNoise(u * f + seed, v * f + seed); float num2 = Mathf.PerlinNoise((u - 1f) * f + seed, v * f + seed); float num3 = Mathf.PerlinNoise(u * f + seed, (v - 1f) * f + seed); float num4 = Mathf.PerlinNoise((u - 1f) * f + seed, (v - 1f) * f + seed); return Mathf.Lerp(Mathf.Lerp(num, num2, u), Mathf.Lerp(num3, num4, u), v); } public static void Shade(Vector3 n, Vector3 view, float fres, float baseAlpha, float edgeA, float foamBoost, float nu, float nv, float time, out Color body, out Color rim) { //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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = Mathf.SmoothStep(0f, 1f, (fres - 0.5f) / 0.32f); float num2 = Mathf.SmoothStep(0f, 1f, (fres - 0.78f) / 0.17f); body = new Color(Mathf.Lerp(0.05f, 0.62f, num), Mathf.Lerp(0.24f, 0.88f, num), Mathf.Lerp(0.66f, 1f, num), baseAlpha * (0.55f + 0.45f * num) * edgeA); Vector3 val = Quaternion.AngleAxis(time * 40f, Vector3.up) * Key; Vector3 val2 = Vector3.Reflect(-view, n); float num3 = Mathf.Pow(Mathf.Max(0f, Vector3.Dot(val2, val)), 18f); Vector3 val3 = view + Vector3.up; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num4 = Mathf.Pow(Mathf.Max(0f, Vector3.Dot(n, normalized)), 28f); float num5 = Mathf.PerlinNoise(nu * 1.7f + time * 2.1f, nv * 1.7f - time * 1.3f); float num6 = Mathf.SmoothStep(0f, 1f, (fres - 0.6f) / 0.26f); float num7 = (Mathf.Pow(num3, 2f) + Mathf.Pow(num4, 2f) * 0.5f) * Mathf.SmoothStep(0f, 1f, (num5 - 0.5f) / 0.15f) * (0.15f + 0.85f * num6) * 1.4f; float num8 = Mathf.PerlinNoise(nu * 1.1f + 7.1f, nv * 1.1f - time * 2.6f); float num9 = Mathf.Clamp01(Mathf.Clamp01(num6 * (1.15f + foamBoost)) * Mathf.SmoothStep(0f, 1f, (num8 - 0.36f) / 0.12f) * 0.95f + num7 + num2 * 0.35f) * edgeA; rim = new Color(num9, num9, num9, num9); } static DragonWaterLook() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = new Vector3(0.35f, 0.85f, 0.4f); Key = ((Vector3)(ref val)).normalized; } } public static class Kit { public static Action WaterReleased; public static Action WaterImpacted; public static GameObject water; public static GameObject kunai; public static GameObject anchor; public static readonly List projectiles = new List(); public static void Prepare() { KitVfx.Prepare(); water = Projectile("TobiramaWaterDragon", 0); kunai = Projectile("TobiramaKunai", 1); anchor = Projectile("TobiramaRaijinAnchor", 2); } private static GameObject Projectile(string name, int kind) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/CommandoGrenadeProjectile"), name); Component[] components = val.GetComponents(); foreach (Component val2 in components) { if (val2 is ProjectileImpactExplosion || val2 is ProjectileSingleTargetImpact || val2 is ProjectileSimple || val2 is ProjectileOverlapAttack) { Object.DestroyImmediate((Object)(object)val2); } } Renderer[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Collider[] componentsInChildren2 = val.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].enabled = false; } Rigidbody component = val.GetComponent(); component.useGravity = false; component.isKinematic = true; ProjectileController component2 = val.GetComponent(); component2.ghostPrefab = KitVfx.Ghost(kind); typeof(ProjectileController).GetField("ghostPrefabAddress", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(component2, null); component2.procCoefficient = ((kind == 0) ? KitTuning.WaterProc.Value : KitTuning.KunaiProc.Value); component2.allowPrediction = false; if (kind == 0) { val.AddComponent(); } else { val.AddComponent().kind = kind; } projectiles.Add(val); return val; } public static TobiBody Runtime(CharacterBody b) { return ((Component)b).GetComponent() ?? ((Component)b).gameObject.AddComponent(); } public static void Log(string s) { if (KitTuning.Verbose != null && KitTuning.Verbose.Value) { Plugin.instance.Log.LogInfo((object)("KIT " + s)); } } public static bool AttackTarget(CharacterBody owner, HurtBox h) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)owner.teamComponent) && Object.op_Implicit((Object)(object)h) && Object.op_Implicit((Object)(object)h.healthComponent) && h.healthComponent.alive && (Object)(object)h.healthComponent != (Object)(object)owner.healthComponent) { return h.teamIndex != owner.teamComponent.teamIndex; } return false; } public static bool Enemy(CharacterBody owner, HurtBox h) { return AttackTarget(owner, h); } public static bool Combatant(CharacterBody owner, HurtBox h) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 if (AttackTarget(owner, h)) { return (int)h.teamIndex > 0; } return false; } public static void Damage(CharacterBody owner, HealthComponent h, float damage, float proc, Vector3 point, bool crit, string label, Vector3 force = default(Vector3), DamageType type = (DamageType)0u, DamageSource source = (DamageSource)0) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)h)) { float health = h.health; DamageInfo val = new DamageInfo { attacker = ((Component)owner).gameObject, inflictor = ((Component)owner).gameObject, damage = damage, procCoefficient = proc, position = point, crit = crit, force = force, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit(type), (DamageTypeExtended)0, source) }; h.TakeDamage(val); GlobalEventManager.instance.OnHitEnemy(val, ((Component)h).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)h).gameObject); Log("HIT " + label + " victim=" + (Object.op_Implicit((Object)(object)h.body) ? ((Object)h.body).name : ((Object)h).name) + "#" + ((Object)h).GetInstanceID() + " loss=" + (health - h.health).ToString("0.#") + " damage=" + damage.ToString("0.#") + " t=" + FixedTimeStamp.now.t.ToString("0.000")); } } public static void Fire(CharacterBody b, GameObject prefab, Vector3 origin, Vector3 aim, float coefficient) { //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) if (NetworkServer.active) { ProjectileManager.instance.FireProjectile(prefab, origin, Util.QuaternionSafeLookRotation(aim), ((Component)b).gameObject, b.damage * coefficient, 0f, b.RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } } public static bool SpawnPoint(CharacterBody b, Ray aim, float distance, out Vector3 pos, float radius = 0.2f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0058: 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_0090: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Vector3 corePosition = b.corePosition; if (Physics.CheckSphere(corePosition, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { pos = corePosition; return false; } Vector3 val = corePosition + ((Ray)(ref aim)).direction * distance; Vector3 val2 = val - corePosition; RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(corePosition, radius, ((Vector3)(ref val2)).normalized, ref val3, distance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { pos = ((RaycastHit)(ref val3)).point + ((RaycastHit)(ref val3)).normal * 0.23f; return false; } pos = val; return !Physics.CheckSphere(pos, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); } } public class TobiBody : MonoBehaviour { public TobiFlight anchor; public uint tagId; public bool arrival; public bool recastArmed; public bool utilityPressConsumed; public Vector3 arrivalPoint; private CharacterBody body; public readonly List tags = new List(); private void Awake() { body = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_0102: 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.healthComponent) || !body.healthComponent.alive || !Util.HasEffectiveAuthority(((Component)this).gameObject)) { return; } if (!body.inputBank.skill3.down) { recastArmed = true; utilityPressConsumed = false; } EntityStateMachine val = ((IEnumerable)((Component)body).GetComponents()).FirstOrDefault((Func)((EntityStateMachine x) => x.customName == "Weapon")); if (Object.op_Implicit((Object)(object)val) && !(val.state is RaijinBurst) && !(val.state is RaijinResolve) && Object.op_Implicit((Object)(object)anchor) && recastArmed && ((ButtonState)(ref body.inputBank.skill3)).justPressed) { recastArmed = false; utilityPressConsumed = true; CharacterBody val2 = Marks.AimTarget(body, body.inputBank.GetAimRay()); if (Object.op_Implicit((Object)(object)val2)) { val.SetNextState((EntityState)(object)new RaijinSlash { target = ((Component)val2).gameObject }); } else { val.SetNextState((EntityState)(object)new RaijinResolve()); } } } private void Update() { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { Clear(); } } public void Clear() { if (NetworkServer.active) { if (Object.op_Implicit((Object)(object)anchor)) { anchor.Consume(teleport: false); } TagSequence[] array = tags.ToArray(); foreach (TagSequence tagSequence in array) { if (Object.op_Implicit((Object)(object)tagSequence)) { tagSequence.Cancel(); } } } anchor = null; } private void OnDestroy() { Clear(); } public unsafe bool Teleport(Vector3 point, Vector3 direction, HealthComponent enemy) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0276: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0351: 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_0358: 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_0370: 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_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_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_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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01ad: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_01dc: 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_01f0: 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_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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !body.healthComponent.alive) { return false; } Vector3 footPosition = body.footPosition; float num = ((BaseCharacterController)body.characterMotor).Motor.Capsule.radius + 0.08f; float height = ((BaseCharacterController)body.characterMotor).Motor.Capsule.height; Vector3 val = -((Vector3)(ref direction)).normalized; Vector3 val2 = point + val * (Object.op_Implicit((Object)(object)enemy) ? 1.2f : 0.65f); Vector3 val3 = Vector3.zero; bool flag = false; float[] array = new float[3] { 0f, 0.5f, 1f }; foreach (float num2 in array) { for (int j = 0; j < 9; j++) { if (flag) { break; } Vector3 val4 = Quaternion.AngleAxis((float)((j != 0) ? ((j + 1) / 2 * ((j % 2 != 0) ? 1 : (-1)) * 30) : 0) * (MathF.PI / 180f) * 57.29578f, Vector3.up) * val; Vector3 val5 = val2 + val4 * ((j == 0) ? 0f : Mathf.Min(KitTuning.ArrivalRadius.Value, 0.6f + (float)((j + 1) / 2) * 0.4f)) + Vector3.up * num2; Vector3 val6 = val5 + Vector3.up * num; Vector3 val7 = val5 + Vector3.up * Mathf.Max(num, height - num); if (!Physics.CheckCapsule(val6, val7, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.Linecast(footPosition + Vector3.up * 0.8f, val5 + Vector3.up * 0.8f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.OverlapCapsule(val6, val7, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2).Any(delegate(Collider c) { HurtBox component = ((Component)c).GetComponent(); return Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && (Object)(object)component.healthComponent.body != (Object)(object)body; })) { val3 = val5; flag = true; } } if (flag) { break; } } if (!flag) { Kit.Log("RAIJIN_REJECT clearance_or_wall"); return false; } ((Component)body).GetComponent()?.DetachForTeleport(); Marks.Flash(body.corePosition, 1f); Afterimage.Spawn(((Component)body.modelLocator.modelTransform).GetComponentInChildren()); OwnerMove10.Move(body, val3 + (body.transform.position - body.footPosition), pose: true); arrival = true; arrivalPoint = val3; Visual componentInChildren = ((Component)body.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && !componentInChildren.skillOverride) { componentInChildren.Play(body.characterMotor.isGrounded ? "Land_Heavy" : "Air_Apex", 1.2f, 0f, restart: true, 0.03f); componentInChildren.lockUntil = Time.time + 0.25f; } Marks.Flash(val3 + Vector3.up, 1f); TobiAudio.Send(body, 3, val3 + Vector3.up); Vector3 val8 = val3; Kit.Log("RAIJIN_TELEPORT " + ((object)(*(Vector3*)(&val8))/*cast due to .constrained prefix*/).ToString()); return true; } } public class TobiFlight : MonoBehaviour { public int kind; private ProjectileController pc; private ProjectileDamage damage; private CharacterBody owner; private float age; private bool consumed; private Vector3 direction; private void Start() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) pc = ((Component)this).GetComponent(); damage = ((Component)this).GetComponent(); direction = ((Component)this).transform.forward; Bind(); } private void Bind() { if (Object.op_Implicit((Object)(object)pc) && Object.op_Implicit((Object)(object)pc.owner)) { owner = pc.owner.GetComponent(); if (Object.op_Implicit((Object)(object)owner) && kind == 2) { Kit.Runtime(owner).anchor = this; } } } private void FixedUpdate() { //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_0131: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01af: 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_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_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_026d: 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_0287: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)owner)) { Bind(); } if (!NetworkServer.active || consumed) { return; } if (!Object.op_Implicit((Object)(object)owner) || !owner.healthComponent.alive) { Consume(teleport: false); return; } age += Time.fixedDeltaTime; float num = ((kind == 0) ? KitTuning.WaterLife.Value : KitTuning.AnchorLife.Value); if (age > num) { Kit.Log("FLIGHT_EXPIRE kind=" + kind + " pos=" + ((object)((Component)this).transform.position/*cast due to .constrained prefix*/).ToString() + " age=" + age.ToString("0.00")); Consume(teleport: false); return; } float num2 = ((kind == 0) ? KitTuning.WaterSpeed.Value : KitTuning.KunaiSpeed.Value) * Time.fixedDeltaTime; float num3 = ((kind == 0) ? 0.45f : 0.11f); foreach (RaycastHit item in from h in Physics.SphereCastAll(((Component)this).transform.position, num3, direction, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2) orderby ((RaycastHit)(ref h)).distance select h) { RaycastHit current = item; HurtBox component = ((Component)((RaycastHit)(ref current)).collider).GetComponent(); bool flag = (LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) & (1 << ((Component)((RaycastHit)(ref current)).collider).gameObject.layer)) != 0; if (!flag && !Kit.AttackTarget(owner, component)) { continue; } Vector3 val = ((RaycastHit)(ref current)).point + ((RaycastHit)(ref current)).normal * 0.06f; Kit.Log("IMPACT kind=" + kind + " world=" + flag); if (kind == 1) { if (Kit.AttackTarget(owner, component)) { Kit.Damage(owner, component.healthComponent, damage.damage, KitTuning.KunaiProc.Value, val, damage.crit, "KUNAI_DAMAGE", default(Vector3), (DamageType)0, (DamageSource)4); Marks.Apply(component.healthComponent); } KitVfx.Emit(KitVfx.teleport, val, 0.25f); } else { Kit.Runtime(owner).Teleport(val, direction, Object.op_Implicit((Object)(object)component) ? component.healthComponent : null); } Consume(teleport: false); return; } Transform transform = ((Component)this).transform; transform.position += direction * num2; } public void Consume(bool teleport) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (!consumed) { consumed = true; if (teleport && Object.op_Implicit((Object)(object)owner)) { Kit.Runtime(owner).Teleport(((Component)this).transform.position, direction, null); } if (Object.op_Implicit((Object)(object)owner) && (Object)(object)Kit.Runtime(owner).anchor == (Object)(object)this) { Kit.Runtime(owner).anchor = null; } if (NetworkServer.active) { NetworkServer.Destroy(((Component)this).gameObject); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)((Component)owner).GetComponent()) && (Object)(object)((Component)owner).GetComponent().anchor == (Object)(object)this) { ((Component)owner).GetComponent().anchor = null; } } } public abstract class TobiCast : BaseSkillState { protected Visual v; protected float speed; protected bool completed; public override void OnEnter() { ((BaseState)this).OnEnter(); speed = Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); v = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)v)) { v.skillOverride = true; v.combatUntil = Time.time + 3f; } ((EntityState)this).characterBody.SetAimTimer(3f); } protected void Play(string clip, float rate = 0f) { if (Object.op_Implicit((Object)(object)v)) { v.Play(clip, (rate == 0f) ? speed : rate, 0f, restart: true, 0.06f); } } public override void OnExit() { if (!completed && ((EntityState)this).isAuthority) { TobiAudio.Send(((EntityState)this).characterBody, 7); } if (Object.op_Implicit((Object)(object)v)) { v.skillOverride = false; v.lockUntil = 0f; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class WaterDragonCast : TobiCast { public const float Surge = 0.24f; public const float Release = 0.4f; public const float Duration = 0.93f; private uint relayCast; private bool released; private bool surged; private bool castGround; public static float SourceBack = 2.4f; public static float SourceRight = 1.1f; public override void OnEnter() { base.OnEnter(); castGround = ((EntityState)this).characterMotor.isGrounded; Play(castGround ? "Water_Dragon" : "Water_Dragon_Air"); if (Object.op_Implicit((Object)(object)v) && TrackedReference.op_Implicit((TrackedReference)(object)v.player[v.current])) { v.player[v.current].time = 0.04f * speed; } TobiAudio.Send(((EntityState)this).characterBody, 0); relayCast = ((Component)((EntityState)this).characterBody).GetComponent().Begin(speed); } public unsafe override void FixedUpdate() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_033e: 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_0373: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)v) && castGround != ((EntityState)this).characterMotor.isGrounded) { castGround = ((EntityState)this).characterMotor.isGrounded; v.Play(castGround ? "Water_Dragon" : "Water_Dragon_Air", speed, 0f, restart: true); v.player[v.current].time = ((EntityState)this).fixedAge * speed; } if (!surged) { surged = true; if (NetworkServer.active) { CharacterBody characterBody = ((EntityState)this).characterBody; Ray aimRay = ((BaseState)this).GetAimRay(); Source(characterBody, ((Ray)(ref aimRay)).direction, 1f, 0.4f / speed); } } if (!released && ((EntityState)this).fixedAge >= 0.4f / speed) { released = true; if (NetworkServer.active) { Ray aimRay2 = ((BaseState)this).GetAimRay(); Vector3 corePosition = ((EntityState)this).characterBody.corePosition; float num = ((EntityState)this).characterBody.damage * KitTuning.WaterDamage.Value; bool flag = ((EntityState)this).characterBody.RollCrit(); ProjectileManager.instance.FireProjectile(Kit.water, corePosition, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay2)).direction), ((Component)((EntityState)this).characterBody).gameObject, num, 0f, flag, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); ((Component)((EntityState)this).characterBody).GetComponent().Release(relayCast, WaterRelay.Target(((EntityState)this).characterBody, aimRay2), num, flag); Kit.WaterReleased?.Invoke(((EntityState)this).characterBody, corePosition); Vector3 val = corePosition; Kit.Log("WATER_RELEASE " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString() + " age=" + ((EntityState)this).fixedAge); if (Object.op_Implicit((Object)(object)v)) { Transform val2 = ((IEnumerable)v.bones).FirstOrDefault((Func)((Transform x) => ((Object)x).name == "spine")); Kit.Log("CAST_POSE clip=" + v.current + " time=" + (TrackedReference.op_Implicit((TrackedReference)(object)v.player[v.current]) ? v.player[v.current].time : 0f).ToString("0.000") + " weight=" + (TrackedReference.op_Implicit((TrackedReference)(object)v.player[v.current]) ? v.player[v.current].weight : 0f).ToString("0.00") + " hipsAboveFoot=" + (Object.op_Implicit((Object)(object)val2) ? (val2.position.y - ((EntityState)this).characterBody.footPosition.y).ToString("0.000") : "?") + " modelScale=" + ((Component)v).transform.lossyScale.y.ToString("0.00")); } } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.93f / speed) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (!released) { ((Component)((EntityState)this).characterBody).GetComponent().Cancel(relayCast); } base.OnExit(); } public static Vector3 SourcePoint(Vector3 core, Vector3 foot, Vector3 flat) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(Vector3.up, flat); Vector3 val2 = foot - flat * SourceBack + val * SourceRight; RaycastHit val3 = default(RaycastHit); if (Physics.Linecast(core, val2 + Vector3.up, ref val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val3)).point + ((RaycastHit)(ref val3)).normal * 0.3f - Vector3.up; } else if (Physics.Raycast(val2 + Vector3.up * 1.5f, Vector3.down, ref val3, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val3)).point; } return val2; } public static void Source(CharacterBody b, Vector3 aim, float scale, float release) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_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_0094: 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_00a0: 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_00b7: 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) //IL_0034: 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_0039: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(aim, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = (Object.op_Implicit((Object)(object)b.characterDirection) ? b.characterDirection.forward : Vector3.forward); } ((Vector3)(ref val)).Normalize(); Vector3 foot = b.footPosition; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(b.corePosition + Vector3.up * 0.5f, Vector3.down, ref val2, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { foot = ((RaycastHit)(ref val2)).point; } Vector3 p = SourcePoint(b.corePosition, foot, val); KitVfx.Emit(KitVfx.emerge, p, scale, null, null, Util.QuaternionSafeLookRotation(val), release); } } public class RaijinBurst : TobiCast { private int fired; private bool releasedButton; private bool buffered; private float bufferTime; private TobiBody runtime; private static readonly float[] Shots = new float[3] { 0.13f, 0.18f, 0.23f }; public const float Duration = 0.4f; public override void OnEnter() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) base.OnEnter(); runtime = Kit.Runtime(((EntityState)this).characterBody); runtime.recastArmed = false; runtime.utilityPressConsumed = true; if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); CharacterBody val = Marks.AimTarget(((EntityState)this).characterBody, aimRay); if (Object.op_Implicit((Object)(object)val)) { completed = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinSlash { target = ((Component)val).gameObject }); return; } if (RaijinSwap.Aimed(((EntityState)this).characterBody, aimRay)) { completed = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinSwap()); return; } } if (NetworkServer.active && Object.op_Implicit((Object)(object)runtime.anchor)) { runtime.anchor.Consume(teleport: false); } runtime.arrival = false; if (Object.op_Implicit((Object)(object)v)) { v.Play("Raijin_Swipe", speed, 0f, restart: true, 0.03f); } TobiAudio.Send(((EntityState)this).characterBody, 2); } private unsafe void Release() { //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_0027: 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_0121: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00e3: 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_0101: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_01e4: 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_0225: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0231: 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_0236: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_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_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) int num = fired++; if (!NetworkServer.active) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); if (Kit.SpawnPoint(((EntityState)this).characterBody, aimRay, 0.65f, out var pos)) { Transform val = (Object.op_Implicit((Object)(object)v) ? ((IEnumerable)v.bones).FirstOrDefault((Func)((Transform t) => ((Object)t).name == "hand.R")) : null); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = val.position + ((Ray)(ref aimRay)).direction * 0.12f; Vector3 val3 = val2 - ((EntityState)this).characterBody.corePosition; RaycastHit val4 = default(RaycastHit); if (!Physics.SphereCast(((EntityState)this).characterBody.corePosition, 0.11f, ((Vector3)(ref val3)).normalized, ref val4, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.CheckSphere(val2, 0.11f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { pos = val2; } } Vector3 point = ((Ray)(ref aimRay)).GetPoint(80f); RaycastHit val5 = default(RaycastHit); foreach (RaycastHit item in from x in Physics.RaycastAll(aimRay, 80f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2) orderby ((RaycastHit)(ref x)).distance select x) { RaycastHit current = item; if (!(((RaycastHit)(ref current)).distance < 1f) && ((LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) & (1 << ((Component)((RaycastHit)(ref current)).collider).gameObject.layer)) != 0 || Kit.AttackTarget(((EntityState)this).characterBody, ((Component)((RaycastHit)(ref current)).collider).GetComponent()))) { val5 = current; point = ((RaycastHit)(ref current)).point; break; } } Vector3 val6 = point - pos; Vector3 val7; if (!(((Vector3)(ref val6)).sqrMagnitude > 0.25f)) { val7 = ((Ray)(ref aimRay)).direction; } else { val6 = point - pos; val7 = ((Vector3)(ref val6)).normalized; } Vector3 val8 = val7; Kit.Fire(((EntityState)this).characterBody, (num == 2) ? Kit.anchor : Kit.kunai, pos, val8, (num == 2) ? 0f : KitTuning.KunaiDamage.Value); string[] obj = new string[10] { "RAIJIN_AIM shot=", (num + 1).ToString(), " from=", null, null, null, null, null, null, null }; val6 = pos; obj[3] = ((object)(*(Vector3*)(&val6))/*cast due to .constrained prefix*/).ToString(); obj[4] = " aimPoint="; val6 = point; obj[5] = ((object)(*(Vector3*)(&val6))/*cast due to .constrained prefix*/).ToString(); obj[6] = " dir="; val6 = val8; obj[7] = ((object)(*(Vector3*)(&val6))/*cast due to .constrained prefix*/).ToString(); obj[8] = " aimHit="; obj[9] = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val5)).collider) ? ((Object)((RaycastHit)(ref val5)).collider).name : "none"); Kit.Log(string.Concat(obj)); string[] obj2 = new string[8] { "RAIJIN_RELEASE ", (num + 1).ToString(), " age=", ((EntityState)this).fixedAge.ToString(), " time=", FixedTimeStamp.now.t.ToString(), " origin=", null }; val6 = pos; obj2[7] = ((object)(*(Vector3*)(&val6))/*cast due to .constrained prefix*/).ToString(); Kit.Log(string.Concat(obj2)); } else { Kit.Log("RAIJIN_BLOCKED " + (num + 1)); } } public override void FixedUpdate() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!((EntityState)this).inputBank.skill3.down) { releasedButton = true; } if (releasedButton && ((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justPressed) { buffered = true; bufferTime = ((EntityState)this).fixedAge; } while (fired < 3 && ((EntityState)this).fixedAge >= Shots[fired] / speed) { Release(); } if (((EntityState)this).isAuthority && buffered && fired == 3 && ((EntityState)this).fixedAge - bufferTime < 0.35f) { CharacterBody val = Marks.AimTarget(((EntityState)this).characterBody, ((BaseState)this).GetAimRay()); if (Object.op_Implicit((Object)(object)val) || Object.op_Implicit((Object)(object)runtime.anchor)) { runtime.utilityPressConsumed = true; completed = true; if (Object.op_Implicit((Object)(object)val)) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinSlash { target = ((Component)val).gameObject }); } else { ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinResolve()); } return; } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.4f / speed) { completed = true; if (runtime.arrival) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinArrival()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { if (!completed && ((EntityState)this).isAuthority && NetworkServer.active && (Object)(object)runtime != (Object)null && Object.op_Implicit((Object)(object)runtime.anchor)) { runtime.anchor.Consume(teleport: false); } base.OnExit(); } } public class RaijinResolve : TobiCast { public override void OnEnter() { base.OnEnter(); Play("Raijin_Depart", 1f); if (NetworkServer.active) { TobiBody tobiBody = Kit.Runtime(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)tobiBody.anchor)) { tobiBody.anchor.Consume(teleport: true); } Kit.Log("RAIJIN_EARLY_RECAST"); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > 0.1f) { completed = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new RaijinArrival()); } } } public class RaijinArrival : TobiCast { public override void OnEnter() { base.OnEnter(); Play(((EntityState)this).characterMotor.isGrounded ? "Land_Heavy" : "Air_Apex", 1.2f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > 0.18f) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } } public class TandemCast : TobiCast { private bool released; private bool valid; private bool air; private Vector3 target; private TagSequence field; public const float ReleaseAt = 0.47f; public const float Duration = 1.05f; public const float AirDistance = 25f; public const float AirPitchMin = -30f; public const float AirPitchMax = 35f; public unsafe override void OnEnter() { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_0190: 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_01b1: 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) base.OnEnter(); Play("Tandem_Throw"); TobiAudio.Send(((EntityState)this).characterBody, 1); Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val = default(RaycastHit); valid = Physics.Raycast(aimRay, ref val, KitTuning.TagRange.Value, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); if (!valid) { Vector3 point = ((Ray)(ref aimRay)).GetPoint(Mathf.Min(25f, KitTuning.TagRange.Value)); valid = Physics.Raycast(point + Vector3.up * 4f, Vector3.down, ref val, 30f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && Vector3.Distance(((Ray)(ref aimRay)).origin, ((RaycastHit)(ref val)).point) <= KitTuning.TagRange.Value; } if (valid) { target = ((RaycastHit)(ref val)).point + ((RaycastHit)(ref val)).normal * 0.1f; } else { target = AirPoint(aimRay, out air); valid = true; } if (NetworkServer.active) { KitVfx.Emit(KitVfx.indicator, target, KitTuning.TagRadius.Value); } string[] obj = new string[6] { "TAGS_AIM airburst=", air.ToString(), " target=", null, null, null }; Vector3 val2 = target; obj[3] = ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString(); obj[4] = " pitch="; obj[5] = (Mathf.Asin(Mathf.Clamp(((Ray)(ref aimRay)).direction.y, -1f, 1f)) * 57.29578f).ToString("0.0"); Kit.Log(string.Concat(obj)); } public static Vector3 AirPoint(Ray aim, out bool air) { //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_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_002f: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b6: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = Vector3.ProjectOnPlane(((Ray)(ref aim)).direction, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); float num = Mathf.Clamp(Mathf.Asin(Mathf.Clamp(((Ray)(ref aim)).direction.y, -1f, 1f)) * 57.29578f, -30f, 35f); Vector3 val2 = val * Mathf.Cos(num * (MathF.PI / 180f)) + Vector3.up * Mathf.Sin(num * (MathF.PI / 180f)); float num2 = Mathf.Min(25f, KitTuning.TagRange.Value); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aim)).origin, val2, ref val3, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { air = false; return ((RaycastHit)(ref val3)).point + ((RaycastHit)(ref val3)).normal * 0.1f; } air = true; return ((Ray)(ref aim)).origin + val2 * num2; } public unsafe override void FixedUpdate() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) ((EntityState)this).FixedUpdate(); if (!released && ((EntityState)this).fixedAge >= 0.47f / speed) { released = true; if (NetworkServer.active && valid) { Transform val = (Object.op_Implicit((Object)(object)v) ? ((IEnumerable)v.bones).FirstOrDefault((Func)((Transform x) => ((Object)x).name == "hand.R")) : null); field = ((EntityState)this).gameObject.AddComponent(); field.Init(((EntityState)this).characterBody, target, Object.op_Implicit((Object)(object)val) ? val.position : ((EntityState)this).characterBody.corePosition, air); Vector3 val2 = target; Kit.Log("TAGS_RELEASE " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString() + " airburst=" + air); } else if (((EntityState)this).isAuthority && !valid) { ((EntityState)this).skillLocator.special.AddOneStock(); Kit.Log("TAGS_INVALID_SURFACE"); } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 1.05f / speed) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (!completed && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)field)) { field.Cancel(); } base.OnExit(); } public override void OnSerialize(NetworkWriter w) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(w); w.Write(valid); w.Write(target); w.Write(air); } public override void OnDeserialize(NetworkReader r) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(r); valid = r.ReadBoolean(); target = r.ReadVector3(); air = r.ReadBoolean(); } } public class TagSequence : MonoBehaviour { public const float FinalGap = 0.5f; private CharacterBody owner; private Vector3 target; private float start; private int wave; private uint id; private bool active; private bool tagged; private bool final; private bool air; private readonly HashSet stuck = new HashSet(); public static float FinalTime => KitTuning.TagDelay.Value + (float)(KitTuning.Waves - 1) * Mathf.Max(0.05f, KitTuning.TagInterval.Value) + 0.5f; public static float WaveRadius(int w, float radius) { return radius * ((float)w + 1f) / (float)KitTuning.Waves; } public void Init(CharacterBody b, Vector3 p, Vector3 hand, bool airburst = false) { //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_0017: 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_0098: Unknown result type (might be due to invalid IL or missing references) owner = b; target = p; air = airburst; start = FixedTimeStamp.now.t; id = ++Kit.Runtime(b).tagId; while (Kit.Runtime(b).tags.Count >= 3) { Kit.Runtime(b).tags[0].Cancel(); } Kit.Runtime(b).tags.Add(this); active = true; KitVfx.Field(b, target, id, start, hand, air); } private Dictionary> Victims(float radius) { //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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00b2: 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_00cd: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0118: 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_0121: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) Dictionary> dictionary = new Dictionary>(); float num = Mathf.Max(1f, KitTuning.TagHeight.Value); Collider[] array = Physics.OverlapCapsule(target - Vector3.up * (air ? num : 0.5f), target + Vector3.up * num, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); foreach (Collider val in array) { HurtBox component = ((Component)val).GetComponent(); if (!Kit.AttackTarget(owner, component)) { continue; } Vector3 val2; if (!Object.op_Implicit((Object)(object)component.healthComponent.body)) { Bounds bounds = val.bounds; val2 = ((Bounds)(ref bounds)).center; } else { val2 = component.healthComponent.body.corePosition; } Vector3 val3 = val2; Vector3 val4 = target + Vector3.up * Mathf.Clamp(val3.y - target.y, air ? (0f - num) : 0.3f, num); Vector3 val5 = val.ClosestPoint(val4); if (!Physics.Linecast(val4, val5, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) || !Physics.Linecast(val4, val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { Vector3 val6 = val5 - target; val6.y = 0f; float magnitude = ((Vector3)(ref val6)).magnitude; if (!dictionary.TryGetValue(component.healthComponent, out var value) || magnitude < value.Key) { dictionary[component.healthComponent] = new KeyValuePair(magnitude, val5); } } } return dictionary; } private void FixedUpdate() { //IL_0036: 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_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_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_0260: 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_0174: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !active) { return; } if (!Object.op_Implicit((Object)(object)owner) || !owner.healthComponent.alive) { Cancel(); return; } float num = FixedTimeStamp.now.t - start; float value = KitTuning.TagRadius.Value; int waves = KitTuning.Waves; float num2 = Mathf.Max(0.05f, KitTuning.TagInterval.Value); Vector3 val; while (wave < waves && num >= KitTuning.TagDelay.Value + (float)wave * num2) { float num3 = WaveRadius(wave, value); float num4 = ((wave == 0) ? (-1f) : WaveRadius(wave - 1, value)); bool crit = owner.RollCrit(); int num5 = 0; foreach (KeyValuePair> item in Victims(num3 + 0.5f)) { float key = item.Value.Key; bool flag = key > num4 - 0.75f && key <= num3 + 0.5f; if (flag) { stuck.Add(item.Key); } bool flag2 = stuck.Contains(item.Key); float num6 = (flag ? KitTuning.TagDamage.Value : 0f) + (flag2 ? KitTuning.TagBonusDamage.Value : 0f); if (!(num6 <= 0f)) { val = Vector3.ProjectOnPlane(item.Value.Value - target, Vector3.up); Vector3 force = ((Vector3)(ref val)).normalized * 350f + Vector3.up * 250f; Kit.Damage(owner, item.Key, owner.damage * num6, KitTuning.TagProc.Value, item.Value.Value, crit, "TAG_WAVE_" + wave + (flag ? "_RING" : "") + (flag2 ? "_STUCK" : ""), force, (DamageType)0, (DamageSource)8); num5++; } } TobiAudio.Send(owner, 6, target + Vector3.up); Kit.Log("TAG_GENERATION " + wave + " age=" + num.ToString("0.000") + " radius=" + num3.ToString("0.0") + " hits=" + num5 + (air ? " airburst" : "")); wave++; } if (!final && wave >= waves && num >= FinalTime) { final = true; bool crit = owner.RollCrit(); int num7 = 0; foreach (KeyValuePair> item2 in Victims(value + 0.5f)) { val = Vector3.ProjectOnPlane(item2.Value.Value - target, Vector3.up); Vector3 force2 = ((Vector3)(ref val)).normalized * 1500f + Vector3.up * 2200f; float num8 = Marks.Consume(item2.Key, "tandem"); Kit.Damage(owner, item2.Key, owner.damage * KitTuning.TagFinalDamage.Value * num8, KitTuning.TagProc.Value, item2.Value.Value, crit, "TAG_FINAL" + ((num8 > 1f) ? "_MARKED" : ""), force2, (DamageType)0, (DamageSource)8); num7++; } TobiAudio.Send(owner, 6, target + Vector3.up * 2f); TobiAudio.Send(owner, 6, target); Kit.Log("TAG_FINAL age=" + num.ToString("0.000") + " hits=" + num7 + " airburst=" + air + " radius=" + value.ToString("0.0")); } if (final && num > FinalTime + 0.5f) { active = false; if (Object.op_Implicit((Object)(object)owner)) { Kit.Runtime(owner).tags.Remove(this); } Object.Destroy((Object)(object)this); Kit.Log("TAG_DONE"); } } public void Cancel() { if (active) { active = false; if (Object.op_Implicit((Object)(object)owner)) { KitVfx.StopField(owner, id); Kit.Runtime(owner).tags.Remove(this); } Object.Destroy((Object)(object)this); Kit.Log("TAG_CANCEL"); } } } public static class KitTuning { public static ConfigEntry WaterDamage; public static ConfigEntry WaterPathDamage; public static ConfigEntry WaterRadius; public static ConfigEntry WaterSpeed; public static ConfigEntry WaterLife; public static ConfigEntry WaterCooldown; public static ConfigEntry WaterProc; public static ConfigEntry KunaiDamage; public static ConfigEntry KunaiSpeed; public static ConfigEntry AnchorLife; public static ConfigEntry RaijinCooldown; public static ConfigEntry KunaiProc; public static ConfigEntry ArrivalRadius; public static ConfigEntry TagDamage; public static ConfigEntry TagBonusDamage; public static ConfigEntry TagFinalDamage; public static ConfigEntry TagRadius; public static ConfigEntry TagCooldown; public static ConfigEntry TagInterval; public static ConfigEntry TagDelay; public static ConfigEntry TagRange; public static ConfigEntry TagProc; public static ConfigEntry TagHeight; public static ConfigEntry SlashDamage; public static ConfigEntry SlashRange; public static ConfigEntry SlashCone; public static ConfigEntry MarkDuration; public static ConfigEntry MarkBonus; public static ConfigEntry TagPulses; public static ConfigEntry Verbose; public static int Waves => Mathf.Clamp(TagPulses.Value, 1, 6); private static bool Old(ConfigEntry e, float v) { return Math.Abs(e.Value - v) < 0.0005f; } public static void Init(ConfigFile c) { WaterDamage = c.Bind("Water Dragon", "Damage", 16f, "Burst damage coefficient (16 = 1600%) when the dragon bursts at the end of its path, on terrain or on a boss."); WaterPathDamage = c.Bind("Water Dragon", "PathDamage", 6f, "Damage coefficient (6 = 600%) dealt once to each enemy the dragon plows through."); WaterRadius = c.Bind("Water Dragon", "Playable03Radius", 9f, "Burst radius in metres."); WaterSpeed = c.Bind("Water Dragon", "Speed", 52f, "Dragon travel speed in metres per second."); WaterLife = c.Bind("Water Dragon", "Lifetime", 3f, "Seconds of travel before the dragon bursts (range = Speed x Lifetime)."); WaterCooldown = c.Bind("Water Dragon", "Cooldown", 7f, "Seconds; starts when the cast ends."); WaterProc = c.Bind("Water Dragon", "Proc", 1f, "Proc coefficient for path and burst hits."); KunaiDamage = c.Bind("Flying Raijin", "KunaiDamage", 8f, "Each of the first two projectiles. 0.15 default: 800%; the third is a teleport anchor only."); ConfigEntry val = c.Bind("Migration", "Kunai015Applied", false, "One-time migration of the former default 400% kunai; custom values are retained."); if (!val.Value) { if (Math.Abs(KunaiDamage.Value - 4f) < 0.0001f) { KunaiDamage.Value = 8f; } val.Value = true; } KunaiSpeed = c.Bind("Flying Raijin", "Speed", 48f, "Projectile m/s."); AnchorLife = c.Bind("Flying Raijin", "AnchorLifetime", 3f, "Expires without teleport."); RaijinCooldown = c.Bind("Flying Raijin", "Cooldown", 9f, "Two base charges. One consumed per burst; free recast. Sequential recharge begins on state end."); KunaiProc = c.Bind("Flying Raijin", "Proc", 0.8f, "First two kunai."); ArrivalRadius = c.Bind("Flying Raijin", "ArrivalSearchRadius", 3f, "Maximum clearance search around impact, never through a wall."); SlashDamage = c.Bind("Flying Raijin", "SlashDamage", 12f, "Flying Raijin Slash damage coefficient (12 = 1200%) on a marked enemy, times the mark bonus."); SlashRange = c.Bind("Flying Raijin", "SlashRange", 40f, "Maximum distance to a marked enemy for Flying Raijin Slash."); SlashCone = c.Bind("Flying Raijin", "SlashAimCone", 14f, "Half-angle in degrees around the aim within which a marked enemy is chosen for the slash."); MarkDuration = c.Bind("Flying Thunder God Formula", "MarkSeconds", 8f, "How long a kunai or slash brand lasts on an enemy."); MarkBonus = c.Bind("Flying Thunder God Formula", "MarkBonus", 0.25f, "Extra damage fraction (0.25 = +25%) a marked enemy takes from the next Water Dragon burst, Tandem final blast or Raijin slash (consumes the mark)."); TagHeight = c.Bind("Tandem Tags", "FinalPlaytestVerticalSpan", 7f, "Height in metres of the blast area above the target surface."); TagDamage = c.Bind("Tandem Tags", "FinalPlaytestDamagePerPulse", 10f, "Damage coefficient of each detonation wave (10 = 1000%) to enemies in that wave's ring."); TagBonusDamage = c.Bind("Tandem Tags", "StuckTagBonusDamage", 8f, "Extra coefficient (8 = 800%) each wave deals to enemies with tags stuck on them that are inside the wave."); TagFinalDamage = c.Bind("Tandem Tags", "FinalBlastDamage", 40f, "Damage coefficient (40 = 4000%) of the final blast to everything in the area."); TagRadius = c.Bind("Tandem Tags", "Playable03Radius", 28f, "Area radius in metres."); TagCooldown = c.Bind("Tandem Tags", "Cooldown", 28f, "Seconds."); TagPulses = c.Bind("Tandem Tags", "Playable03Pulses", 6, "Number of tag generations before the final blast (1..6)."); TagInterval = c.Bind("Tandem Tags", "Playable03PulseInterval", 0.36f, "Seconds between tag generations (each detonation scatters the next generation)."); TagDelay = c.Bind("Tandem Tags", "FirstPulseDelay", 0.62f, "Seconds from the throw until the thrown tag detonates (generation 1)."); TagRange = c.Bind("Tandem Tags", "MaxRange", 30f, "Aimed valid surface search range."); TagProc = c.Bind("Tandem Tags", "Playable03ProcPerPulse", 1f, "Proc coefficient of each wave and the final blast."); Verbose = c.Bind("Debug", "VerboseLog", false, "Write detailed hit and timing lines to the BepInEx log. No gameplay effect."); ConfigEntry val2 = c.Bind("Migration", "Kit017Applied", false, "One-time 0.17.0 migration of old Water Dragon and Tandem defaults; custom values are retained."); if (!val2.Value) { if (Old(WaterDamage, 18f)) { WaterDamage.Value = 16f; } if (Old(WaterRadius, 7.5f)) { WaterRadius.Value = 9f; } if (Old(WaterSpeed, 38f)) { WaterSpeed.Value = 34f; } if (Old(WaterLife, 4f)) { WaterLife.Value = 1.4f; } if (Old(TagDamage, 4.457143f)) { TagDamage.Value = 10f; } if (TagPulses.Value == 21) { TagPulses.Value = 6; } if (Old(TagInterval, 0.3f)) { TagInterval.Value = 0.28f; } if (Old(TagDelay, 1f)) { TagDelay.Value = 0.75f; } if (Old(TagProc, 0.06666666f)) { TagProc.Value = 1f; } val2.Value = true; } ConfigEntry val3 = c.Bind("Migration", "Kit018Applied", false, "One-time 0.18.0 migration of the Tandem cascade timing; custom values are retained."); if (!val3.Value) { if (Old(TagDelay, 0.75f)) { TagDelay.Value = 0.62f; } if (Old(TagInterval, 0.28f)) { TagInterval.Value = 0.36f; } val3.Value = true; } ConfigEntry val4 = c.Bind("Migration", "Kit020Applied", false, "One-time 0.20.0 migration of the Water Dragon range and Tandem area defaults; custom values are retained."); if (!val4.Value) { if (Old(WaterSpeed, 34f)) { WaterSpeed.Value = 52f; } if (Old(WaterLife, 1.4f)) { WaterLife.Value = 3f; } if (Old(TagRadius, 11.25f)) { TagRadius.Value = 20f; } val4.Value = true; } ConfigEntry val5 = c.Bind("Migration", "Kit021Applied", false, "One-time 0.21.0 migration of the Tandem area default (20 -> 28 m); custom values are retained."); if (!val5.Value) { if (Old(TagRadius, 20f) || Old(TagRadius, 11.25f)) { TagRadius.Value = 28f; } val5.Value = true; } } } [Serializable] public class DragonData { public DragonMesh[] meshes; } [Serializable] public class DragonMesh { public string name; public float[] v; public float[] uv; public int[] tri; } public static class KitVfx { public static GameObject splash; public static GameObject explosion; public static GameObject teleport; public static GameObject emerge; public static GameObject indicator; public static GameObject tagField; public static GameObject tagStop; public static readonly List effects = new List(); public static Material water; public static Material foam; public static Material paper; public static Material metal; public static Material gold; public static Material glow; public static Material Material(Color color) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(Shader.Find("Hopoo Games/Deferred/Standard") ?? Shader.Find("Standard")); val.color = color; if (val.HasProperty("_SpecularStrength")) { val.SetFloat("_SpecularStrength", 0.5f); } if (val.HasProperty("_Cull")) { val.SetInt("_Cull", 0); } return val; } public static void Prepare() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0080: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0107: 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: Expected O, but got Unknown //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown //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_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Expected O, but got Unknown //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) Color val = new Color(0.32f, 0.76f, 0.88f); water = Material(((Color)(ref val)).gamma); water.SetColor("_EmColor", new Color(0.08f, 0.38f, 0.48f)); water.SetFloat("_EmPower", 0.8f); water.SetTexture("_EmTex", (Texture)(object)Texture2D.whiteTexture); foam = Material(new Color(0.75f, 0.96f, 1f)); metal = Material(new Color(0.18f, 0.22f, 0.26f)); gold = Material(new Color(1f, 0.74f, 0.1f)); paper = Material(new Color(0.94f, 0.86f, 0.65f)); glow = new Material(Shader.Find("Hopoo Games/FX/Cloud Remap")); glow.SetColor("_TintColor", Color.white); glow.SetInt("_SrcBlend", 5); glow.SetInt("_DstBlend", 10); glow.SetInt("_ZWrite", 0); glow.SetInt("_Cull", 0); glow.SetFloat("_AlphaBoost", 1f); glow.SetFloat("_AlphaBias", 0f); glow.SetFloat("_Boost", 1f); glow.SetFloat("_InvFade", 0f); glow.SetInt("_ZTest", 4); glow.EnableKeyword("DISABLEREMAP"); glow.DisableKeyword("USE_CLOUDS"); glow.DisableKeyword("CALCTEXTUREALPHA"); glow.renderQueue = 3001; Texture2D val2 = new Texture2D(64, 64, (TextureFormat)4, false); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { Vector2 val3 = new Vector2(((float)j - 31.5f) / 31.5f, ((float)i - 31.5f) / 31.5f); float magnitude = ((Vector2)(ref val3)).magnitude; float num = Mathf.Clamp01((1f - magnitude) * 1.8f); val2.SetPixel(j, i, new Color(num, num, num, num)); } } ((Texture)val2).wrapMode = (TextureWrapMode)1; val2.Apply(); glow.mainTexture = (Texture)(object)val2; glow.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.whiteTexture); glow.SetTexture("_Cloud2Tex", (Texture)(object)Texture2D.whiteTexture); Texture2D val4 = new Texture2D(64, 64, (TextureFormat)4, false); for (int k = 0; k < 64; k++) { for (int l = 0; l < 64; l++) { float num2 = (Mathf.Sin((float)l * 0.36f + (float)k * 0.54f) + Mathf.Sin((float)l * 0.9f - (float)k * 0.13f)) * 0.15f; val4.SetPixel(l, k, new Color(0.3f + num2, 0.75f + num2, 0.9f + num2)); } } ((Texture)val4).wrapMode = (TextureWrapMode)0; val4.Apply(); water.mainTexture = (Texture)(object)val4; Texture2D val5 = new Texture2D(32, 64, (TextureFormat)4, false); for (int m = 0; m < 64; m++) { for (int n = 0; n < 32; n++) { bool flag = (n > 9 && n < 23 && m > 8 && m < 56 && (m % 8 < 2 || Mathf.Abs(n - 16 - (m / 8 % 3 - 1) * 4) < 2)) || n == 3 || n == 28; val5.SetPixel(n, m, flag ? new Color(0.1f, 0.06f, 0.04f) : new Color(0.94f, 0.86f, 0.65f)); } } val5.Apply(); paper.mainTexture = (Texture)(object)val5; StormFx.Prepare(); WaterLook.Prepare(); Water03.Prepare(); DragonRig.Prepare(); Marks.Prepare(); MangaFx.Prepare(); TandemLook.Prepare(); splash = NewEffect("TobiramaWaterBurst", WaterBurstFx.Build); teleport = Effect("TobiramaTeleport", 2); emerge = NewEffect("TobiramaWaterLaunch", WaterLaunchFx.Build); tagField = NewEffect("TobiramaTandemField", TandemField.Build); tagStop = Effect("TobiramaTagStop", 5); indicator = Effect("TobiramaTargetArea", 6); } public static GameObject Ghost(int kind) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_0209: 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_028a: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TobiramaGhost" + kind); val.AddComponent(); if (kind != 0) { GameObject val2 = new GameObject("KunaiBlade"); val2.transform.SetParent(val.transform, false); Mesh val3 = new Mesh(); val3.vertices = (Vector3[])(object)new Vector3[6] { new Vector3(0f, 0f, 0.5f), new Vector3(-0.12f, 0f, 0f), new Vector3(0f, 0.07f, 0f), new Vector3(0.12f, 0f, 0f), new Vector3(0f, -0.07f, 0f), new Vector3(0f, 0f, -0.2f) }; val3.triangles = new int[24] { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 1, 5, 2, 1, 5, 3, 2, 5, 4, 3, 5, 1, 4 }; val3.RecalculateNormals(); val2.AddComponent().sharedMesh = val3; ((Renderer)val2.AddComponent()).sharedMaterial = ((kind == 2) ? gold : metal); MeshRenderer obj = StormFx.Part(val2, "FormulaTag", StormFx.quad, TandemLook.tag); ((Component)obj).transform.localPosition = new Vector3(0f, 0f, -0.32f); ((Component)obj).transform.localRotation = Quaternion.Euler(90f, 0f, 0f); ((Component)obj).transform.localScale = new Vector3(0.12f, 0.24f, 1f); for (int i = 0; i < 2; i++) { MeshRenderer obj2 = StormFx.Part(val2, "Glint" + i, StormFx.quad, Marks.flashMat); ((Component)obj2).transform.localPosition = new Vector3(0f, 0f, -0.05f); ((Component)obj2).transform.localRotation = Quaternion.Euler(0f, (float)(i * 90), 0f); ((Component)obj2).transform.localScale = Vector3.one * ((kind == 2) ? 0.34f : 0.22f); } TrailRenderer obj3 = val.AddComponent(); ((Renderer)obj3).sharedMaterial = glow; obj3.startColor = ((kind == 2) ? new Color(1f, 0.75f, 0.1f, 0.9f) : new Color(0.6f, 0.8f, 1f, 0.6f)); obj3.endColor = Color.clear; obj3.time = 0.14f; obj3.startWidth = ((kind == 2) ? 0.14f : 0.04f); obj3.endWidth = 0f; } if (kind != 0) { val.AddComponent().kind = kind; } GameObject val4 = PrefabAPI.InstantiateClone(val, "TobiramaFlightGhost" + kind, false); Object.DestroyImmediate((Object)(object)val); if (kind == 0) { val4.AddComponent(); } return val4; } public static ParticleSystem Particles(GameObject root, Color color, float size, float life, float speed, bool loop) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Spray"); val.transform.SetParent(root.transform, false); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = loop; ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(life); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.5f, size); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(speed); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).maxParticles = 80; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((float)(loop ? 30 : 0)); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.15f; ((Renderer)((Component)val2).GetComponent()).sharedMaterial = glow; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(color, 0f), new GradientColorKey(color, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.75f, 0f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); return val2; } private static GameObject Effect(string name, int kind) { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0046: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().applyScale = false; val.AddComponent().DoNotPool = false; val.AddComponent(); val.AddComponent().kind = kind; PolishEffects.Build(val, kind); GameObject val2 = PrefabAPI.InstantiateClone(val, name, false); Object.DestroyImmediate((Object)val); effects.Add(new EffectDef(val2)); return val2; } private static GameObject NewEffect(string name, Action build) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().applyScale = false; val.AddComponent().DoNotPool = true; build(val); GameObject val2 = PrefabAPI.InstantiateClone(val, name, false); Object.DestroyImmediate((Object)(object)val); effects.Add(new EffectDef(val2)); return val2; } public static void Emit(GameObject prefab, Vector3 p, float scale, Vector3? end = null, Vector3? normal = null, Quaternion? rotation = null, float generic = 0f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) EffectManager.SpawnEffect(prefab, new EffectData { origin = p, scale = scale, start = (end ?? p), genericFloat = generic, rotation = (Quaternion)(((??)rotation) ?? (normal.HasValue ? Quaternion.FromToRotation(Vector3.up, normal.Value) : Quaternion.identity)) }, true); } public static void Field(CharacterBody owner, Vector3 p, uint id, float start, Vector3 hand, bool air = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c6: Expected O, but got Unknown EffectData val = new EffectData { origin = p, start = hand, scale = KitTuning.TagRadius.Value, genericUInt = (id | (uint)(air ? int.MinValue : 0)), genericFloat = start, color = new Color32((byte)(Mathf.Clamp(Mathf.RoundToInt(KitTuning.TagDelay.Value * 100f), 0, 65535) & 0xFF), (byte)(Mathf.Clamp(Mathf.RoundToInt(KitTuning.TagDelay.Value * 100f), 0, 65535) >> 8), (byte)Mathf.Clamp(Mathf.RoundToInt(Mathf.Max(0.05f, KitTuning.TagInterval.Value) * 100f), 1, 255), (byte)KitTuning.Waves) }; val.SetNetworkedObjectReference(((Component)owner).gameObject); EffectManager.SpawnEffect(tagField, val, true); } public static void StopField(CharacterBody owner, uint id) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0019: Expected O, but got Unknown EffectData val = new EffectData { origin = owner.corePosition, genericUInt = id }; val.SetNetworkedObjectReference(((Component)owner).gameObject); EffectManager.SpawnEffect(tagStop, val, true); } } public class WaterFlow : MonoBehaviour { public int kind; private float born; private float behind; private Transform model; private WaterWake wake; private static readonly MaterialPropertyBlock fadeBlock = new MaterialPropertyBlock(); private Renderer[] parts; private void OnEnable() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) born = Time.time; model = ((Component)this).transform.Find("SingleDragon"); behind = 1.6f; RaycastHit val = default(RaycastHit); if (kind == 0 && Physics.Raycast(((Component)this).transform.position, -((Component)this).transform.forward, ref val, behind, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { behind = Mathf.Max(0f, ((RaycastHit)(ref val)).distance - 0.5f); } if (kind == 0) { wake = WaterWake.Rent(); } ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(); } Kit.Log("GHOST_ENABLE kind=" + kind + " singleHead=" + ((kind == 0) ? 1 : 0)); } private void LateUpdate() { //IL_0029: 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_0055: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0265: 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_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0225: 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_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) if (kind != 0 || !Object.op_Implicit((Object)(object)model)) { return; } float num = Time.time - born; model.localPosition = Vector3.back * behind * (1f - Mathf.SmoothStep(0f, 1f, num / 0.22f)); float num2 = 1f - Mathf.SmoothStep(0f, 1f, num / 0.35f); model.localRotation = Quaternion.Euler(-14f * num2, Mathf.Sin(num * 9f) * 9f * num2 + Mathf.Sin(num * 5f) * 2f, Mathf.Sin(num * 7f) * 4f * num2); Transform obj = model; obj.localPosition += Vector3.up * (0.9f * Mathf.Sin(Mathf.Clamp01(num / 0.35f) * MathF.PI)); Camera val = null; foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.sceneCam)) { val = readOnlyInstances.sceneCam; break; } } if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; } if (Object.op_Implicit((Object)(object)val)) { Renderer[] componentsInChildren; if (parts == null) { componentsInChildren = (Renderer[])(object)((Component)model).GetComponentsInChildren(true); parts = componentsInChildren; } componentsInChildren = parts; foreach (Renderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2)) { Vector3 position = ((Component)val).transform.position; Bounds bounds = val2.bounds; float num3 = Mathf.Clamp01((Vector3.Distance(position, ((Bounds)(ref bounds)).ClosestPoint(((Component)val).transform.position)) - 1.5f) / 5f); val2.GetPropertyBlock(fadeBlock); Color color = val2.sharedMaterial.GetColor("_TintColor"); color.a *= num3; fadeBlock.SetColor("_TintColor", color); val2.SetPropertyBlock(fadeBlock); } } } WaterLook.body.mainTextureOffset = new Vector2(Time.time * 0.05f, (0f - Time.time) * 1.1f); WaterLook.shell.mainTextureOffset = new Vector2((0f - Time.time) * 0.08f, (0f - Time.time) * 1.7f); WaterLook.foam.mainTextureOffset = new Vector2(0f, (0f - Time.time) * 0.9f); foreach (Transform item in model) { Transform val3 = item; if (((Object)val3).name.Contains("body0") && !((Object)val3).name.Contains("body01")) { val3.localRotation = Quaternion.Euler(Mathf.Cos(num * 9f + (float)val3.GetSiblingIndex()) * 2f, Mathf.Sin(num * 12f + (float)val3.GetSiblingIndex()) * 3f, 0f); } } if (Object.op_Implicit((Object)(object)wake)) { wake.Follow(model.TransformPoint(new Vector3(0f, 0f, -4.2f))); } } private void OnDisable() { if (Object.op_Implicit((Object)(object)wake)) { wake.Release(); wake = null; } } } public static class MangaFx { public static GameObject prefab; internal static Material[] burst = (Material[])(object)new Material[4]; internal static Material[] halo = (Material[])(object)new Material[4]; internal static Material core; internal static Material ring; internal static Material shock; internal static Material speed; private static int lastVariant = -1; private static readonly Random rng = new Random(); public const float RegularHitStop = 0.055f; public const float FinisherHitStop = 0.11f; public static void Prepare() { //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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00fa: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown for (int i = 0; i < 4; i++) { burst[i] = Mat("burst" + ((i < 3) ? i.ToString() : "F"), 3104); halo[i] = Mat("burst" + ((i < 3) ? i.ToString() : "F") + "_halo", 3103); } core = Mat("core", 3105); ring = Mat("ring", 3102); shock = Mat("shock", 3102); speed = Mat("speed", 3103); GameObject val = new GameObject("TobiramaMangaImpact"); val.AddComponent().applyScale = false; val.AddComponent().DoNotPool = true; val.AddComponent(); prefab = PrefabAPI.InstantiateClone(val, "TobiramaMangaImpact", false); Object.DestroyImmediate((Object)val); KitVfx.effects.Add(new EffectDef(prefab)); } private static Material Mat(string name, int queue) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) Texture2D obj = StormFx.Tex("Manga/" + name + ".png", (TextureWrapMode)1); ((Texture)obj).anisoLevel = 4; Material obj2 = StormFx.Mat((Texture)(object)obj, additive: false, Color.white, 1f, queue); obj2.SetInt("_ZTest", 8); obj2.SetFloat("_Boost", 1f); return obj2; } public static float HitStop(int hit, float attackSpeed) { return ((hit == 2) ? 0.11f : 0.055f) / Mathf.Sqrt(Mathf.Max(1f, attackSpeed)); } public static void Spawn(CharacterBody attacker, GameObject source, HealthComponent victim, Vector3 point, Vector3 forward, int hit, int index, bool sound = false) { //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_003f: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01a9: 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_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_01b6: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown if (!NetworkServer.active || !Object.op_Implicit((Object)(object)prefab)) { return; } if (Object.op_Implicit((Object)(object)victim) && Object.op_Implicit((Object)(object)victim.body) && Object.op_Implicit((Object)(object)attacker)) { Vector3 corePosition = victim.body.corePosition; point = Vector3.Lerp(point, corePosition, 0.35f); float num = attacker.footPosition.y + 1.3f; point.y = Mathf.Max(point.y, Mathf.Min(num, corePosition.y + 0.5f * victim.body.radius)); } if (index >= 4) { Kit.Log("MANGA_SKIP index=" + index + " (4+ victims in one swing: no extra bursts, vanilla hit flash only)"); return; } int num2 = rng.Next(3); if (num2 == lastVariant) { num2 = (num2 + 1 + rng.Next(2)) % 3; } lastVariant = num2; bool flag = hit == 2; float num3 = (Object.op_Implicit((Object)(object)attacker) ? Mathf.Max(0.1f, attacker.attackSpeed) : 1f); float num4 = ((Object.op_Implicit((Object)(object)victim) && Object.op_Implicit((Object)(object)victim.body)) ? victim.body.radius : 1f); float scale = Mathf.Clamp(0.8f + 0.25f * num4, 0.9f, 1.4f); uint genericUInt = (uint)(num2 | (sound ? 4 : 0) | (flag ? 16 : 0) | ((index >= 1) ? 32 : 0) | (hit << 6) | (Mathf.Clamp(Mathf.RoundToInt(num3 * 20f), 1, 255) << 8) | (rng.Next(65536) << 16)); EffectData val = new EffectData { origin = point, rotation = Util.QuaternionSafeLookRotation(forward), scale = scale, genericUInt = genericUInt, genericFloat = index }; if (Object.op_Implicit((Object)(object)source)) { val.SetNetworkedObjectReference(source); } EffectManager.SpawnEffect(prefab, val, true); Kit.Log("MANGA_SEND hit=" + (hit + 1) + " fin=" + flag + " variant=" + num2 + " index=" + index + " size=" + scale.ToString("0.00") + " aspd=" + num3.ToString("0.00") + " hitstop=" + HitStop(hit, num3).ToString("0.000") + " sound=" + sound + " t=" + Time.time.ToString("0.000")); } } public class MangaSpawn : MonoBehaviour { private void Start() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) EffectComponent component = ((Component)this).GetComponent(); EffectData val = (Object.op_Implicit((Object)(object)component) ? component.effectData : null); if (val != null) { try { uint genericUInt = val.genericUInt; int num = (int)((genericUInt >> 6) & 3); float num2 = Mathf.Max(0.05f, (float)((genericUInt >> 8) & 0xFF) / 20f); MangaImpact.Rent().Play(val.origin, val.rotation * Vector3.forward, (int)(genericUInt & 3), (genericUInt & 0x10) != 0, (genericUInt & 0x20) != 0, num, num2, val.scale, (int)(genericUInt >> 16)); GameObject val2 = val.ResolveNetworkedObjectReference(); if ((genericUInt & 4) != 0) { MangaSound.Play(val.origin, (genericUInt & 0x10) != 0, val2); } CharacterBody val3 = (Object.op_Implicit((Object)(object)val2) ? val2.GetComponent() : null); Visual visual = ((Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.modelLocator) && Object.op_Implicit((Object)(object)val3.modelLocator.modelTransform)) ? ((Component)val3.modelLocator.modelTransform).GetComponentInChildren() : null); if (Object.op_Implicit((Object)(object)visual) && val.genericFloat < 0.5f) { float num3 = MangaFx.HitStop(num, num2); visual.hitStopUntil = Mathf.Max(visual.hitStopUntil, Time.time + num3); Kit.Log("MANGA_SHOW hit=" + (num + 1) + " hitstop=" + num3.ToString("0.000") + " t=" + Time.time.ToString("0.000")); } } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("Tobirama manga impact: " + ex.Message)); } } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class MangaImpact : MonoBehaviour { private static readonly Stack pool = new Stack(); public static int Live; private static Camera cachedCam; private static int camFrame = -1; private MeshRenderer burstR; private MeshRenderer haloR; private MeshRenderer coreR; private MeshRenderer ringR; private MeshRenderer flashR; private readonly MeshRenderer[] lines = (MeshRenderer[])(object)new MeshRenderer[4]; private readonly float[] lineOff = new float[4]; private readonly float[] linePerp = new float[4]; private readonly float[] lineLen = new float[4]; private Vector3 point; private Vector3 strike; private bool fin; private bool reduced; private bool showLines; private int variant; private int hit; private float born; private float life; private float R; private float spin; private float lineLife; private bool active; private static readonly MaterialPropertyBlock block = new MaterialPropertyBlock(); public static MangaImpact Rent() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown while (pool.Count > 0) { MangaImpact mangaImpact = pool.Pop(); if (Object.op_Implicit((Object)(object)mangaImpact)) { return mangaImpact; } } GameObject val = new GameObject("Tobirama manga impact"); Object.DontDestroyOnLoad((Object)(object)val); MangaImpact mangaImpact2 = val.AddComponent(); mangaImpact2.ringR = StormFx.Part(val, "Ring", StormFx.quad, MangaFx.ring); mangaImpact2.haloR = StormFx.Part(val, "Halo", StormFx.quad, MangaFx.halo[0]); mangaImpact2.burstR = StormFx.Part(val, "Burst", StormFx.quad, MangaFx.burst[0]); mangaImpact2.coreR = StormFx.Part(val, "Core", StormFx.quad, MangaFx.core); mangaImpact2.flashR = StormFx.Part(val, "Flash", StormFx.quad, MangaFx.core); for (int i = 0; i < 4; i++) { mangaImpact2.lines[i] = StormFx.Part(val, "Speed" + i, StormFx.quad, MangaFx.speed); } return mangaImpact2; } public void Play(Vector3 p, Vector3 forward, int v, bool finisher, bool small, int step, float aspd, float size, int seed) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.SetActive(true); active = true; Live++; point = p; strike = forward; variant = Mathf.Clamp(v, 0, 2); fin = finisher; hit = step; born = Time.time; reduced = small || Live > 12; if (reduced) { fin = false; } float num = Mathf.Clamp(1f / Mathf.Sqrt(Mathf.Max(1f, aspd)), fin ? 0.7f : 0.62f, 1f); life = (fin ? 0.26f : 0.15f) * num; R = (fin ? 0.73f : 0.54f) * Mathf.Max(0.5f, size) * (reduced ? 0.65f : 1f); Random random = new Random(seed); spin = (float)(random.NextDouble() * 2.0 - 1.0) * (float)(fin ? 11 : 24); ((Renderer)burstR).sharedMaterial = (fin ? MangaFx.burst[3] : MangaFx.burst[variant]); ((Renderer)haloR).sharedMaterial = (fin ? MangaFx.halo[3] : MangaFx.halo[variant]); ((Renderer)ringR).sharedMaterial = MangaFx.shock; ((Renderer)ringR).enabled = fin && !reduced; ((Renderer)flashR).enabled = fin; showLines = !fin && !reduced && aspd < 1.95f; lineLife = life * 0.62f * Mathf.Lerp(1f, 0.6f, Mathf.Clamp01(aspd - 1f)); int num2 = (showLines ? ((aspd < 1.45f) ? (3 + (seed & 1)) : 2) : 0); for (int i = 0; i < 4; i++) { ((Renderer)lines[i]).enabled = i < num2; lineOff[i] = 1.05f + (float)random.NextDouble() * 0.3f; linePerp[i] = ((float)i - (float)(num2 - 1) * 0.5f) * 0.17f + (float)(random.NextDouble() - 0.5) * 0.06f; lineLen[i] = (0.7f + (float)random.NextDouble() * 0.3f) * ((aspd < 1.45f) ? 1f : 0.7f); } LateUpdate(); } private static Camera Cam() { if (camFrame == Time.frameCount && Object.op_Implicit((Object)(object)cachedCam)) { return cachedCam; } camFrame = Time.frameCount; cachedCam = null; foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.sceneCam) && readOnlyInstances.localUserViewer != null) { cachedCam = readOnlyInstances.sceneCam; break; } } if (!Object.op_Implicit((Object)(object)cachedCam)) { foreach (CameraRigController readOnlyInstances2 in CameraRigController.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances2) && Object.op_Implicit((Object)(object)readOnlyInstances2.sceneCam)) { cachedCam = readOnlyInstances2.sceneCam; break; } } } if (!Object.op_Implicit((Object)(object)cachedCam)) { cachedCam = Camera.main; } return cachedCam; } private static float Ease(float t) { t = Mathf.Clamp01(t); return 1f - (1f - t) * (1f - t) * (1f - t); } private void Release() { if (active) { active = false; Live = Mathf.Max(0, Live - 1); ((Component)this).gameObject.SetActive(false); pool.Push(this); } } private void OnDisable() { if (active) { active = false; Live = Mathf.Max(0, Live - 1); pool.Push(this); } } private void LateUpdate() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) if (!active) { return; } float num = Time.time - born; if (num >= life) { Release(); return; } Camera val = Cam(); if (!Object.op_Implicit((Object)(object)val)) { Release(); return; } Vector3 val2 = ((Component)val).transform.position - point; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.01f) { return; } val2 /= magnitude; ((Component)this).transform.position = point + val2 * Mathf.Min(0.35f, magnitude * 0.3f); ((Component)this).transform.rotation = Quaternion.LookRotation(-val2, ((Component)val).transform.up); float num2 = Mathf.Clamp01((magnitude - 1.2f) / 1.3f) * Mathf.Clamp01((90f - magnitude) / 30f); float num3 = num / life; float num4 = (fin ? 0.045f : 0.032f); float num5 = Mathf.Lerp(fin ? 0.5f : 0.6f, 1f, Ease(num / num4)) * (1f + (fin ? 0.1f : 0.14f) * Mathf.Clamp01((num - num4) / (life - num4))); float num6 = 1f - Mathf.Clamp01((num3 - (fin ? 0.38f : 0.55f)) / (fin ? 0.62f : 0.45f)); float rollDeg = spin + (fin ? 0f : ((variant == 1) ? Angle(val) : ((float)(variant * 37)))); Set(burstR, R * 2f * num5, rollDeg, num6 * num2); Set(haloR, R * 2f * num5, rollDeg, num6 * num6 * num2); float num7 = Mathf.Lerp(0.55f, 1f, Ease(num / 0.03f)); float num8 = 1f - Mathf.Clamp01((num3 - 0.3f) / 0.3f); Set(coreR, R * (fin ? 0.8f : 0.78f) * num7, spin * 2f, num8 * num2); if (fin) { float num9 = ((num < 0.02f) ? 0.7f : (0.7f * (1f - Mathf.Clamp01((num - 0.02f) / 0.025f)))); Set(flashR, R * 1.1f * Mathf.Lerp(0.7f, 1.1f, Ease(num / 0.03f)), 0f, num9 * num2); } if (((Renderer)ringR).enabled) { float num10 = Mathf.Clamp01(num3 / 0.7f); float num11 = Mathf.Lerp(0.45f, 1.3f, Ease(num10)); float num12 = 0.8f * Mathf.Pow(1f - num10, 1.5f); Set(ringR, R * 2f * num11 / 0.86f, 0f, num12 * num2); } if (!showLines) { return; } float num13 = Angle(val); Quaternion val3 = Quaternion.Euler(0f, 0f, num13); float num14 = Mathf.Clamp01(num / lineLife); float num15 = ((num14 < 0.15f) ? (num14 / 0.15f) : (1f - Mathf.Clamp01((num14 - 0.35f) / 0.65f))); for (int i = 0; i < 4; i++) { if (((Renderer)lines[i]).enabled) { Transform transform = ((Component)lines[i]).transform; float num16 = Mathf.Lerp(-0.25f, 0.12f, Ease(num14)); transform.localPosition = val3 * new Vector3((0f - (lineOff[i] - num16)) * R, linePerp[i] * R, 0f) * 1f; transform.localRotation = val3; transform.localScale = new Vector3(lineLen[i] * R, lineLen[i] * R * 0.15f, 1f); Tint(lines[i], num15 * num2); } } } private float Angle(Camera cam) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Vector3 right = ((Component)cam).transform.right; Vector3 up = ((Component)cam).transform.up; float num = Vector3.Dot(strike, right); float num2 = Vector3.Dot(strike, up); if (num * num + num2 * num2 > 0.25f) { return Mathf.Atan2(num2, num) * 57.29578f; } if (hit != 0) { if (hit != 1) { return 90f; } return 35f; } return 195f; } private static void Set(MeshRenderer r, float size, float rollDeg, float alpha) { //IL_0007: 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_002e: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)r).transform; transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(0f, 0f, rollDeg); transform.localScale = new Vector3(size, size, 1f); Tint(r, alpha); } private static void Tint(MeshRenderer r, float alpha) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) ((Renderer)r).GetPropertyBlock(block); block.SetColor("_TintColor", new Color(1f, 1f, 1f, Mathf.Clamp01(alpha))); ((Renderer)r).SetPropertyBlock(block); } } public static class MangaSound { public const float MinGap = 0.06f; public const float MaxBurstWindow = 0.1f; public const int MaxBurst = 3; private static readonly Dictionary lastBy = new Dictionary(); private static readonly Queue recent = new Queue(); private static int lastRegular = -1; private static readonly Random rng = new Random(); public static int Played; public static int Skipped; public static void Play(Vector3 point, bool finisher, GameObject striker) { //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) float unscaledTime = Time.unscaledTime; int key = (Object.op_Implicit((Object)(object)striker) ? ((Object)striker).GetInstanceID() : 0); if (lastBy.TryGetValue(key, out var value) && unscaledTime - value < 0.06f) { Skipped++; Kit.Log("HITSFX_SKIP striker_gap t=" + unscaledTime.ToString("0.000")); return; } while (recent.Count > 0 && unscaledTime - recent.Peek() > 0.1f) { recent.Dequeue(); } if (recent.Count >= 3) { Skipped++; Kit.Log("HITSFX_SKIP burst t=" + unscaledTime.ToString("0.000")); return; } lastBy[key] = unscaledTime; recent.Enqueue(unscaledTime); if (lastBy.Count > 64) { lastBy.Clear(); } string text; if (finisher) { text = "Play_TBH10_fin" + rng.Next(2); } else { int num = rng.Next(4); if (num == lastRegular) { num = (num + 1 + rng.Next(3)) % 4; } lastRegular = num; text = "Play_TBH10_hit" + num; } GameObject val = new GameObject("Tobirama hit sound"); val.transform.position = point; val.AddComponent(); AkSoundEngine.SetGameObjectOutputBusVolume(val, (GameObject)null, Mathf.Clamp((TobiAudio.EffectLevel != null) ? TobiAudio.EffectLevel.Value : 0.8f, 0f, 2f)); uint num2 = AkSoundEngine.PostEvent(text, val); Object.Destroy((Object)(object)val, 2f); Played++; Kit.Log("HITSFX " + text + " id=" + num2 + " fin=" + finisher + " played=" + Played + " t=" + unscaledTime.ToString("0.000")); } } public static class MeleeTuning { public static ConfigEntry[] Damage; public static ConfigEntry[] Reach; public static ConfigEntry[] Angle; public static ConfigEntry[] Start; public static ConfigEntry[] End; public static ConfigEntry[] OriginHeight; public static ConfigEntry Proc; public static ConfigEntry Height; public static ConfigEntry Buffer; public static readonly float[] Durations = new float[3] { 0.3f, 0.4f, 17f / 30f }; public static readonly float[] Force = new float[3] { 260f, 320f, 1750f }; public static readonly float[] Lift = new float[3] { 60f, 80f, 470f }; public static void Init(ConfigFile c) { Damage = new ConfigEntry[3]; Reach = new ConfigEntry[3]; Angle = new ConfigEntry[3]; Start = new ConfigEntry[3]; End = new ConfigEntry[3]; OriginHeight = new ConfigEntry[3]; float[] array = new float[3] { 3.3f, 4.8f, 7.2f }; float[] array2 = new float[3] { 2.5f, 2.4f, 2.4f }; float[] array3 = new float[3] { 90f, 105f, 110f }; float[] array4 = new float[3] { 0.1f, 1f / 6f, 0.2f }; float[] array5 = new float[3] { 0.2f, 4f / 15f, 1f / 3f }; for (int i = 0; i < 3; i++) { string text = "Primary hit " + (i + 1); Damage[i] = c.Bind(text, "DamageCoefficient", array[i], "Provisional multiplier of body damage."); Reach[i] = c.Bind(text, (i == 2) ? "Playable02ReachMetres" : "Pass04ReachMetres", array2[i], "Forward melee reach, independent of visual model spin."); Angle[i] = c.Bind(text, "FullConeDegrees", array3[i], "Full cone angle; targets behind are excluded."); OriginHeight[i] = c.Bind(text, "Pass04OriginHeight", (new float[3] { 1.1f, 1.5f, 1.2f })[i], "Melee origin above feet, aligned to the revised contact pose; facing remains gameplay aim."); Start[i] = c.Bind(text, "StormContactStartSeconds", array4[i], "Base-speed animation seconds; scales with attack speed."); End[i] = c.Bind(text, "StormContactEndSeconds", array5[i], "Base-speed window end; each enemy once across the window."); } Proc = c.Bind("Primary", "ProcCoefficient", 1f, "Per enemy per swing."); Height = c.Bind("Primary", "VerticalReach", 2.6f, "Vertical reach around chest; varied enemy sizes."); Buffer = c.Bind("Primary", "BufferStartSeconds", 0.08f, "Earliest held/repeated primary input queued per hit, scales with attack speed."); ConfigEntry val = c.Bind("Migration", "Melee018Applied", false, "One-time 0.18.0 migration of the third strike timing and reach."); if (!val.Value) { if (Math.Abs(Reach[2].Value - 1.3f) < 0.001f) { Reach[2].Value = 2.4f; } if (Math.Abs(Start[2].Value - 2f / 15f) < 0.001f) { Start[2].Value = 0.2f; } if (Math.Abs(End[2].Value - 7f / 30f) < 0.001f) { End[2].Value = 1f / 3f; } val.Value = true; } } } public static class MeleeContact { public static bool Resolve(CharacterBody b, Vector3 forward, int hit, HashSet victims, bool crit) { //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) return ResolveAt(b, b.footPosition, forward, hit, victims, crit, 1f, 1f, ((Component)b).gameObject, hostileOnly: false, (DamageSource)1); } public static bool ResolveAt(CharacterBody b, Vector3 foot, Vector3 forward, int hit, HashSet victims, bool crit, float damageScale, float procScale, GameObject inflictor, bool hostileOnly, DamageSource source = (DamageSource)0) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: 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_0214: 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_0225: 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_0255: 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_025e: 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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return false; } bool result = false; Vector3 val = foot + Vector3.up * MeleeTuning.OriginHeight[hit].Value; float num = Mathf.Max(0.1f, MeleeTuning.Reach[hit].Value); float num2 = Mathf.Cos(Mathf.Clamp(MeleeTuning.Angle[hit].Value * 0.5f, 1f, 89f) * (MathF.PI / 180f)); int num3 = 0; Collider[] array = Physics.OverlapSphere(val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); foreach (Collider val2 in array) { HurtBox component = ((Component)val2).GetComponent(); if (!Kit.AttackTarget(b, component) || victims.Contains(component.healthComponent)) { continue; } Vector3 val3 = val2.ClosestPoint(val); Vector3 val4 = val3 - val; if (((Vector3)(ref val4)).sqrMagnitude < 0.0001f) { Bounds bounds = val2.bounds; val3 = ((Bounds)(ref bounds)).center; val4 = val3 - val; } Vector3 val5 = Vector3.ProjectOnPlane(val4, Vector3.up); if (!(Mathf.Abs(val4.y) > MeleeTuning.Height.Value) && !(Vector3.Dot(val5, forward) <= 0f) && !(Vector3.Dot(((Vector3)(ref val5)).normalized, forward) < num2)) { Vector3 val6 = (Object.op_Implicit((Object)(object)component.healthComponent.body) ? component.healthComponent.body.corePosition : ((Component)component).transform.position); if (!Physics.CheckSphere(val, 0.035f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.Linecast(val, val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.Linecast(val, val6, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { bool sound = victims.Count == 0; victims.Add(component.healthComponent); Vector3 force = ((Vector3)(ref val5)).normalized * MeleeTuning.Force[hit] + Vector3.up * MeleeTuning.Lift[hit]; DamageInfo val7 = new DamageInfo { attacker = ((Component)b).gameObject, inflictor = inflictor, damage = b.damage * MeleeTuning.Damage[hit].Value * damageScale, crit = crit, position = val3, force = force, procCoefficient = MeleeTuning.Proc.Value * procScale, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, source) }; float health = component.healthComponent.health; component.healthComponent.TakeDamage(val7); Kit.Log((hostileOnly ? "HIT CLONE_MELEE" : "HIT PRIMARY") + " hit=" + (hit + 1) + " victim=" + (Object.op_Implicit((Object)(object)component.healthComponent.body) ? ((Object)component.healthComponent.body).name : ((Object)component.healthComponent).name) + "#" + ((Object)component.healthComponent).GetInstanceID() + " loss=" + (health - component.healthComponent.health).ToString("0.#")); GlobalEventManager.instance.OnHitEnemy(val7, ((Component)component.healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val7, ((Component)component.healthComponent).gameObject); MangaFx.Spawn(b, inflictor, component.healthComponent, val3, forward, hit, num3++, sound); result = true; } } } return result; } } public class Taijutsu : BaseSkillState { public int step; public float carrySeconds; public bool chained; private OneClick click; private float speed; private float duration; private float start; private float end; private float offset; private bool queued; private bool crit; private Visual visual; private Vector3 forward; private readonly HashSet victims = new HashSet(); public override void OnEnter() { //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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) ((BaseState)this).OnEnter(); click = new OneClick(chained); step = Mathf.Clamp(step, 0, 2); speed = Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); offset = Mathf.Clamp(carrySeconds, 0f, MeleeTuning.Durations[step] * 0.5f); duration = (MeleeTuning.Durations[step] - offset) / speed; start = Mathf.Max(0f, Mathf.Clamp(MeleeTuning.Start[step].Value, 0f, MeleeTuning.Durations[step]) - offset) / speed; end = Mathf.Max(start, (Mathf.Clamp(MeleeTuning.End[step].Value, 0f, MeleeTuning.Durations[step]) - offset) / speed); Vector3 val = Vector3.ProjectOnPlane(((EntityState)this).inputBank.aimDirection, Vector3.up); forward = ((Vector3)(ref val)).normalized; if (((Vector3)(ref forward)).sqrMagnitude < 0.5f) { forward = ((EntityState)this).characterDirection.forward; } crit = ((EntityState)this).characterBody.RollCrit(); visual = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)visual)) { visual.skillOverride = true; visual.combatUntil = Time.time + 3f; visual.Play((step == 0) ? "Primary_01_Slash" : ((step == 1) ? "Primary_02_Kick" : (((EntityState)this).characterMotor.isGrounded ? "Primary_03_Heavy" : "Primary_03_Swing_Air")), speed, 0f, restart: true, (step == 0) ? 0.05f : 0f); visual.player[visual.current].time = offset; } ((EntityState)this).characterBody.SetAimTimer(duration + 1f); if (NetworkServer.active) { TobiAudio.Send(((EntityState)this).characterBody, (step == 0) ? 8 : ((step == 1) ? 11 : 12)); } } public override void FixedUpdate() { //IL_0012: 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_00b7: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (click.Queue(((EntityState)this).inputBank.skill1, ((EntityState)this).fixedAge >= MeleeTuning.Buffer.Value / speed)) { queued = true; } if (((EntityState)this).fixedAge >= start && ((EntityState)this).fixedAge - Time.fixedDeltaTime <= end) { MeleeContact.Resolve(((EntityState)this).characterBody, forward, step, victims, crit); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { if ((queued || click.Held(((EntityState)this).inputBank.skill1)) && step < 2) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Taijutsu { chained = true, step = step + 1, carrySeconds = Mathf.Max(0f, ((EntityState)this).fixedAge * speed + offset - MeleeTuning.Durations[step]) }); } else if (step < 2) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ComboExit { step = step }); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { if (Object.op_Implicit((Object)(object)visual)) { visual.skillOverride = false; visual.lockUntil = 0f; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { if (((EntityState)this).fixedAge >= start && ((EntityState)this).fixedAge <= end) { return (InterruptPriority)2; } return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter w) { ((BaseSkillState)this).OnSerialize(w); w.Write(step); w.Write(carrySeconds); } public override void OnDeserialize(NetworkReader r) { ((BaseSkillState)this).OnDeserialize(r); step = r.ReadInt32(); carrySeconds = r.ReadSingle(); } } public class ComboExit : BaseSkillState { public int step; private float duration; private Visual visual; public override void OnEnter() { ((BaseState)this).OnEnter(); float num = Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); duration = ((step == 0) ? 0.3f : (11f / 30f)) / num; visual = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)visual)) { visual.skillOverride = true; visual.Play((step == 0) ? "Primary_01_Exit" : "Primary_02_Exit", num, 0f, restart: true, 0.025f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)visual)) { visual.skillOverride = false; visual.lockUntil = 0f; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } public override void OnSerialize(NetworkWriter w) { ((BaseSkillState)this).OnSerialize(w); w.Write(step); } public override void OnDeserialize(NetworkReader r) { ((BaseSkillState)this).OnDeserialize(r); step = r.ReadInt32(); } } public static class MeleeFx { public static GameObject impact; public static GameObject waterArc; private static Material flash; private static Material dust; private static Material arc; private static Mesh crescent; public static void Prepare() { //IL_001a: 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_008b: Unknown result type (might be due to invalid IL or missing references) flash = StormFx.Mat((Texture)(object)StormFx.soft, additive: true, new Color(1f, 0.95f, 0.85f, 1f), 1.4f, 3006); dust = StormFx.Mat((Texture)(object)Tex03.Masked(StormFx.Tex("Raijin/puff.png", (TextureWrapMode)1)), additive: false, new Color(0.62f, 0.56f, 0.48f, 0.55f), 1f, 3004); arc = StormFx.Mat((Texture)(object)Tex03.column, additive: false, new Color(0.62f, 0.88f, 1f, 0.85f), 1.3f, 3004); crescent = Crescent(); impact = Effect("TobiramaStrikeImpact", delegate(GameObject g) { ImpactFx.Build(g, flash, dust); }); waterArc = Effect("TobiramaWaterEdge", delegate(GameObject g) { WaterEdgeFx.Build(g, crescent, arc); }); } private static GameObject Effect(string name, Action build) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().applyScale = false; val.AddComponent().DoNotPool = true; build(val); GameObject val2 = PrefabAPI.InstantiateClone(val, name, false); Object.DestroyImmediate((Object)(object)val); KitVfx.effects.Add(new EffectDef(val2)); return val2; } private static Mesh Crescent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0077: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); int num = 24; Vector3 val2 = default(Vector3); for (int i = 0; i <= num; i++) { float num2 = (float)i / (float)num; float num3 = Mathf.Lerp(-65f, 65f, num2) * (MathF.PI / 180f); float num4 = Mathf.Sin(num2 * MathF.PI); ((Vector3)(ref val2))..ctor(Mathf.Sin(num3), 0f, Mathf.Cos(num3)); list.Add(val2 * (1f - 0.28f * num4)); list.Add(val2 * (1f + 0.08f * num4) + Vector3.up * 0.05f * num4); list2.Add(new Vector2(num2 * 2f, 0f)); list2.Add(new Vector2(num2 * 2f, 1f)); byte b = (byte)(255f * Mathf.Clamp01(num4 * 1.4f)); list3.Add(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b)); list3.Add(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b)); if (i < num) { int num5 = i * 2; list4.AddRange(new int[6] { num5, num5 + 1, num5 + 2, num5 + 1, num5 + 3, num5 + 2 }); } } val.SetVertices(list); val.SetUVs(0, list2); val.SetColors(list3); val.SetTriangles(list4, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } } public class ImpactFx : MonoBehaviour { public Renderer core; public ParticleSystem dustPs; public ParticleSystem drops; private float born; private float power; private bool init; public static void Build(GameObject g, Material flash, Material dust) { //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_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) ImpactFx impactFx = g.AddComponent(); impactFx.core = (Renderer)(object)StormFx.Part(g, "Flash", StormFx.sphere, flash); impactFx.dustPs = StormFx.System(g, "Dust", dust, 30, -0.05f, stretch: false, 1.2f); StormFx.Fade(impactFx.dustPs, Color.white, Color.white, 0.6f, 0.4f, 2f); Water03.Cap(impactFx.dustPs, 0.12f); impactFx.drops = StormFx.System(g, "Drops", Water03.droplet, 40, 1.4f, stretch: false); StormFx.Fade(impactFx.drops, Color.white, Color.white, 0.9f, 0.7f, 0.6f); Water03.Cap(impactFx.drops, 0.03f); } private void Update() { //IL_01fd: 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_023a: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) if (!init) { init = true; born = Time.time; EffectData effectData = ((Component)this).GetComponent().effectData; power = Mathf.Max(1f, effectData.scale); ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(); } Vector3 val = effectData.rotation * Vector3.forward; for (int j = 0; j < 3 + (int)power * 2; j++) { Vector3 insideUnitSphere = Random.insideUnitSphere; insideUnitSphere.y = Mathf.Abs(insideUnitSphere.y) * 0.4f; StormFx.Emit(dustPs, ((Component)this).transform.position - Vector3.up * 0.6f + insideUnitSphere * 0.4f, (insideUnitSphere + val * 0.6f) * 2.5f, Random.Range(0.7f, 1.2f) * (0.8f + 0.2f * power), Random.Range(0.4f, 0.7f), Color.white); } if (power >= 3f) { for (int k = 0; k < 18; k++) { Vector3 insideUnitSphere2 = Random.insideUnitSphere; StormFx.Emit(drops, ((Component)this).transform.position + insideUnitSphere2 * 0.2f, val * 5f + insideUnitSphere2 * 3f + Vector3.up * 2.5f, Random.Range(0.06f, 0.12f), Random.Range(0.35f, 0.6f), Color.white); } } } float num = Time.time - born; float num2 = Water03.CameraFade(((Component)this).transform.position, 4f, 0.3f); ((Component)core).transform.localScale = Vector3.one * (0.12f + 0.3f * StormFx.Ease(num / 0.05f)) * (0.8f + 0.25f * power); StormFx.Tint(core, new Color(1f, 0.95f, 0.85f, 0.5f * (1f - Mathf.Clamp01(num / 0.1f)) * num2)); if (num > 0.9f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class WaterEdgeFx : MonoBehaviour { public Renderer body; public ParticleSystem drops; private float born; private float reach = 1.2f; private bool init; public static void Build(GameObject g, Mesh m, Material mat) { //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) WaterEdgeFx waterEdgeFx = g.AddComponent(); waterEdgeFx.body = (Renderer)(object)StormFx.Part(g, "Edge", m, mat); waterEdgeFx.drops = StormFx.System(g, "Drops", Water03.droplet, 60, 1.2f, stretch: false); StormFx.Fade(waterEdgeFx.drops, Color.white, Color.white, 0.9f, 0.7f, 0.6f); Water03.Cap(waterEdgeFx.drops, 0.03f); } private void Update() { //IL_0177: 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_01e3: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_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_011d: Unknown result type (might be due to invalid IL or missing references) if (!init) { init = true; born = Time.time; EffectComponent component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.effectData != null && component.effectData.scale > 0.1f) { reach = component.effectData.scale; } drops.Play(); for (int i = 0; i < 26; i++) { float num = Random.Range(-60f, 60f); Vector3 val = ((Component)this).transform.rotation * (Quaternion.Euler(0f, num, 0f) * Vector3.forward); StormFx.Emit(drops, ((Component)this).transform.position + val * reach, val * Random.Range(3f, 7f) + Vector3.up * Random.Range(0.5f, 2.5f), Random.Range(0.06f, 0.13f), Random.Range(0.35f, 0.6f), Color.white); } } float num2 = Time.time - born; float num3 = StormFx.Ease(num2 / 0.1f); float num4 = reach * (0.85f + 0.35f * num3); ((Component)body).transform.localScale = new Vector3(num4, 1f, num4); ((Component)body).transform.localRotation = Quaternion.Euler(0f, Mathf.Lerp(-60f, 20f, num3), 0f); StormFx.Tint(body, new Color(0.62f, 0.88f, 1f, 0.85f * (1f - Mathf.Clamp01((num2 - 0.08f) / 0.12f)))); StormFx.Scroll(body, new Vector2((0f - num2) * 3f, 0f), Vector2.one); if (num2 > 0.7f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public sealed class OneClick { public static float HoldMin = 0.22f; private static float downSince; private bool released; private bool wasDown = true; public OneClick(bool chained) { if (!chained) { downSince = Time.fixedTime; } } public bool Queue(ButtonState b, bool pastBuffer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (!b.down) { released = true; wasDown = false; return false; } if (!wasDown) { wasDown = true; downSince = Time.fixedTime; } if (released) { return true; } if (pastBuffer) { return Time.fixedTime - downSince >= HoldMin; } return false; } public bool Held(ButtonState b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (b.down) { return !released; } return false; } } public sealed class OwnerMove10 : INetMessage, ISerializableObject { public NetworkInstanceId body; public Vector3 position; public bool pose; public static void Init() { NetworkingAPI.RegisterMessageType(); } public unsafe static void Move(CharacterBody b, Vector3 position, bool pose) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!Object.op_Implicit((Object)(object)b)) { return; } if (Util.HasEffectiveAuthority(((Component)b).gameObject)) { TeleportHelper.TeleportBody(b, position); if (Object.op_Implicit((Object)(object)b.characterMotor)) { b.characterMotor.velocity = Vector3.zero; } Vector3 val = position; Kit.Log("RAIJIN_MOVE local " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString()); } else if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new OwnerMove10 { body = ((NetworkBehaviour)b).netId, position = position, pose = pose }, (NetworkDestination)1); Vector3 val = position; string? text = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); NetworkInstanceId netId = ((NetworkBehaviour)b).netId; Kit.Log("RAIJIN_MOVE owner_request " + text + " body=" + ((NetworkInstanceId)(ref netId)).Value); } } public void Serialize(NetworkWriter w) { //IL_0002: 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) w.Write(body); w.Write(position); w.Write(pose); } public void Deserialize(NetworkReader r) { //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_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) body = r.ReadNetworkId(); position = r.ReadVector3(); pose = r.ReadBoolean(); } public unsafe void OnReceived() { //IL_0001: 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_0082: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(body); if (!Object.op_Implicit((Object)(object)val) || !Util.HasEffectiveAuthority(val)) { return; } CharacterBody component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || !component.healthComponent.alive) { return; } ((Component)component).GetComponent()?.DetachForTeleport(); TeleportHelper.TeleportBody(component, position); if (Object.op_Implicit((Object)(object)component.characterMotor)) { component.characterMotor.velocity = Vector3.zero; } Vector3 arrivalPoint = position - (component.transform.position - component.footPosition); TobiBody tobiBody = Kit.Runtime(component); tobiBody.arrival = true; tobiBody.arrivalPoint = arrivalPoint; if (pose) { Visual visual = ((Object.op_Implicit((Object)(object)component.modelLocator) && Object.op_Implicit((Object)(object)component.modelLocator.modelTransform)) ? ((Component)component.modelLocator.modelTransform).GetComponentInChildren() : null); if (Object.op_Implicit((Object)(object)visual) && !visual.skillOverride) { visual.Play((Object.op_Implicit((Object)(object)component.characterMotor) && component.characterMotor.isGrounded) ? "Land_Heavy" : "Air_Apex", 1.2f, 0f, restart: true, 0.03f); visual.lockUntil = Time.time + 0.25f; } } Vector3 val2 = position; Kit.Log("RAIJIN_MOVE owner_applied " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString() + " now=" + ((object)component.transform.position/*cast due to .constrained prefix*/).ToString()); } } [BepInPlugin("henry.TobiramaSenju", "Tobirama Senju", "0.25.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private class Provider : IContentPackProvider { private ContentPack pack = new ContentPack(); public string identifier => "henry.TobiramaSenju"; public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { typeof(ContentPack).GetProperty("identifier").GetSetMethod(nonPublic: true).Invoke(pack, new object[1] { "henry.TobiramaSenju" }); pack.bodyPrefabs.Add((GameObject[])(object)new GameObject[1] { body }); pack.survivorDefs.Add((SurvivorDef[])(object)new SurvivorDef[1] { survivor }); pack.skillDefs.Add(defs.ToArray()); pack.skillFamilies.Add(families.ToArray()); pack.projectilePrefabs.Add(Kit.projectiles.ToArray()); pack.networkedObjectPrefabs.Add((GameObject[])(object)new GameObject[1] { WaterRelay.prefab }); pack.effectDefs.Add(KitVfx.effects.ToArray()); pack.entityStateTypes.Add(new Type[13] { typeof(RelayDeploy), typeof(TobiramaMain), typeof(PreviewNoSkill), typeof(TobiramaDeath), typeof(Taijutsu), typeof(ComboExit), typeof(WaterDragonCast), typeof(RaijinBurst), typeof(RaijinResolve), typeof(RaijinArrival), typeof(TandemCast), typeof(RaijinSlash), typeof(RaijinSwap) }); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(pack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static CollectContentPackProvidersDelegate <>9__11_0; public static Action <>9__12_0; public static Action <>9__12_1; internal void b__11_0(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)new Provider()); } internal void b__12_0(SkillFamily f) { families.Add(f); } internal void b__12_1(SkillDef d) { defs.Add(d); } } public const string Id = "henry.TobiramaSenju"; public static Plugin instance; public static ConfigEntry FallEnter; public static ConfigEntry FallExit; public static GameObject body; public static GameObject display; public static SurvivorDef survivor; private static List defs = new List(); private static List families = new List(); public ManualLogSource Log => ((BaseUnityPlugin)this).Logger; private void Awake() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown instance = this; FallEnter = ((BaseUnityPlugin)this).Config.Bind("Animation", "FastFallEnter", -8f, "Vertical m/s threshold entering fast fall."); FallExit = ((BaseUnityPlugin)this).Config.Bind("Animation", "FastFallExit", -5f, "Vertical m/s exit threshold; hysteresis."); float value = ((BaseUnityPlugin)this).Config.Bind("Presentation", "ModelScale", 0.72f, "Character model scale.").Value; MeleeTuning.Init(((BaseUnityPlugin)this).Config); KitTuning.Init(((BaseUnityPlugin)this).Config); OwnerMove10.Init(); Kit.Prepare(); WaterRelay.Init(((BaseUnityPlugin)this).Config, value); TobiAudio.Init(((BaseUnityPlugin)this).Config); WallRun.Install(); Build(value); SkinVoiceMigration13.Install(); ((Component)this).gameObject.AddComponent(); ShinobiLanding.Init(); object obj = <>c.<>9__11_0; if (obj == null) { CollectContentPackProvidersDelegate val = delegate(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)new Provider()); }; <>c.<>9__11_0 = val; obj = (object)val; } ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)obj; } private static void Build(float scale) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_00cd: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_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_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_063b: 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_065f: Expected O, but got Unknown //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0471: 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_04e9: Unknown result type (might be due to invalid IL or missing references) LanguageAPI.Add("HENRY_TOBIRAMA_NAME", "Tobirama Senju"); LanguageAPI.Add("HENRY_TOBIRAMA_DESC", "Second Hokage, inventor of the Flying Thunder God. Brand enemies with kunai, cut through them with Flying Raijin Slash, crush lines of foes with the Water Dragon and level the field with a chain of Tandem paper bombs. Hold Jump against a wall to run along it."); LanguageAPI.Add("HENRY_TOBIRAMA_SUBTITLE", "Second Hokage"); body = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody"), "HenryTobiramaBody"); CharacterBody component = body.GetComponent(); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(Path.Combine(Visual.Assets, "Portrait.png"))); component.portraitIcon = (Texture)(object)val; component.baseNameToken = "HENRY_TOBIRAMA_NAME"; component.subtitleNameToken = "HENRY_TOBIRAMA_SUBTITLE"; component.baseMoveSpeed = 7f; component.baseMaxHealth = 120f; component.levelMaxHealth = 36f; component.baseDamage = 12f; component.bodyColor = new Color(0.15f, 0.4f, 0.7f); component.preferredPodPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod"); body.AddComponent(); body.AddComponent(); body.AddComponent(); EntityStateMachine[] components = body.GetComponents(); foreach (EntityStateMachine val2 in components) { if (val2.customName == "Body") { val2.mainStateType = new SerializableEntityStateType(typeof(TobiramaMain)); } } CharacterDeathBehavior component2 = body.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathState = new SerializableEntityStateType(typeof(TobiramaDeath)); } GameObject gameObject = ((Component)body.GetComponent().modelTransform).gameObject; Visual.Build(gameObject, scale); DefaultAppearance.Build(gameObject); TobiItemDisplays.Install(gameObject); SkillLocator component3 = body.GetComponent(); component3.passiveSkill.enabled = true; component3.passiveSkill.icon = FinalIcons.LoadNamed("Passive"); component3.passiveSkill.skillNameToken = "HENRY_TOBIRAMA_PASSIVE_NAME"; component3.passiveSkill.skillDescriptionToken = "HENRY_TOBIRAMA_PASSIVE_DESC"; component3.passiveSkill.keywordToken = ""; LanguageAPI.Add("HENRY_TOBIRAMA_PASSIVE_NAME", "Flying Thunder God Formula"); LanguageAPI.Add("HENRY_TOBIRAMA_PASSIVE_DESC", $"Kunai and Flying Raijin Slash brand enemies with the formula for {KitTuning.MarkDuration.Value:0}s. Branded enemies can be struck with Flying Raijin Slash and take +{KitTuning.MarkBonus.Value * 100f:0}% from your next Water Dragon burst or Tandem final blast. Hokage Landing halves fall damage; hold Jump against a wall to run along it."); GenericSkill[] array = (GenericSkill[])(object)new GenericSkill[4] { component3.primary, component3.secondary, component3.utility, component3.special }; string[] array2 = new string[4] { "Taijutsu Combo", "Water Style: Water Dragon Jutsu", "Flying Raijin", "Tandem Paper Bombs" }; for (int j = 0; j < 4; j++) { SkillDef val3 = (SkillDef)(object)((j == 2) ? ScriptableObject.CreateInstance() : ((RaijinSkillDef)(object)ScriptableObject.CreateInstance())); ((Object)val3).name = "HenryTobiramaPreviewSkill" + j; val3.skillName = val3.name; val3.skillNameToken = "HENRY_TOBIRAMA_SKILL_" + j; val3.skillDescriptionToken = val3.skillNameToken + "_DESC"; val3.icon = FinalIcons.Load(j); val3.activationState = new SerializableEntityStateType(typeof(PreviewNoSkill)); val3.activationStateMachineName = "Weapon"; val3.baseMaxStock = 0; val3.requiredStock = 1; val3.stockToConsume = 1; val3.baseRechargeInterval = 0f; val3.isCombatSkill = false; val3.mustKeyPress = true; LanguageAPI.Add(val3.skillNameToken, array2[j]); if (j == 0) { val3.activationState = new SerializableEntityStateType(typeof(Taijutsu)); val3.baseMaxStock = 1; val3.rechargeStock = 1; val3.stockToConsume = 0; val3.isCombatSkill = true; val3.mustKeyPress = false; val3.interruptPriority = (InterruptPriority)0; val3.cancelSprintingOnActivation = true; val3.canceledFromSprinting = false; LanguageAPI.Add(val3.skillDescriptionToken, $"Chain a blade-hand slash ({MeleeTuning.Damage[0].Value * 100f:0.#}%), a sweeping kick ({MeleeTuning.Damage[1].Value * 100f:0.#}%) and a lunging finishing strike ({MeleeTuning.Damage[2].Value * 100f:0.#}%) that knocks enemies back."); } if (j > 0) { val3.activationState = new SerializableEntityStateType(j switch { 2 => typeof(RaijinBurst), 1 => typeof(WaterDragonCast), _ => typeof(TandemCast), }); val3.baseMaxStock = ((j != 2) ? 1 : 2); val3.rechargeStock = 1; val3.requiredStock = 1; val3.stockToConsume = 1; val3.baseRechargeInterval = j switch { 2 => KitTuning.RaijinCooldown.Value, 1 => KitTuning.WaterCooldown.Value, _ => KitTuning.TagCooldown.Value, }; val3.beginSkillCooldownOnSkillEnd = true; val3.isCombatSkill = true; val3.interruptPriority = (InterruptPriority)1; val3.cancelSprintingOnActivation = j != 2; val3.canceledFromSprinting = false; LanguageAPI.Add(val3.skillDescriptionToken, j switch { 2 => $"Two charges. Sling three kunai in one swipe: two deal {KitTuning.KunaiDamage.Value * 100f:0}% and brand enemies, the third is a formula anchor you teleport to on impact (press again to go early). Aim at a branded enemy and press to Flying Raijin Slash behind it for {KitTuning.SlashDamage.Value * 100f:0}%. Aim at your shadow clone to swap places.", 1 => $"Release a giant water dragon that plows through enemies for {KitTuning.WaterPathDamage.Value * 100f:0}% damage each, carrying small foes, then bursts into a {KitTuning.WaterRadius.Value:0.#}m geyser for {KitTuning.WaterDamage.Value * 100f:0}% damage.", _ => $"Throw an explosive tag within {KitTuning.TagRange.Value:0}m. It sticks and detonates, scattering more tags that stick to enemies and the ground and detonate in turn: {KitTuning.Waves} spreading generations for {KitTuning.TagDamage.Value * 100f:0}% damage (+{KitTuning.TagBonusDamage.Value * 100f:0}% per generation to tagged enemies), then a final blast for {KitTuning.TagFinalDamage.Value * 100f:0}% damage.", }); } SkillFamily val4 = ScriptableObject.CreateInstance(); ((Object)val4).name = "HenryTobiramaFamily" + j; Variant[] array3 = new Variant[1]; Variant val5 = new Variant { skillDef = val3 }; ((Variant)(ref val5)).viewableNode = new Node(val3.name, false, (Node)null); array3[0] = val5; val4.variants = (Variant[])(object)array3; typeof(GenericSkill).GetField("_skillFamily", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SetValue(array[j], val4); defs.Add(val3); families.Add(val4); } WaterRelay.AddSkill(body, defs, families); VoiceLoadout.Register(body, "HENRY_TOBIRAMA", FinalIcons.LoadNamed("Voice-JP"), FinalIcons.LoadNamed("Voice-EN"), delegate(SkillFamily f) { families.Add(f); }, delegate(SkillDef d) { defs.Add(d); }).skillFamily.defaultVariantIndex = 1u; display = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterDisplays/CommandoDisplay"), "HenryTobiramaDisplay", false); Visual.Build(display, scale); SilenceSelection(display); DefaultAppearance.BuildDisplay(display, body); survivor = ScriptableObject.CreateInstance(); ((Object)survivor).name = "HenryTobiramaSurvivor"; survivor.cachedName = "HenryTobirama"; survivor.bodyPrefab = body; survivor.displayPrefab = display; survivor.displayNameToken = "HENRY_TOBIRAMA_NAME"; survivor.descriptionToken = "HENRY_TOBIRAMA_DESC"; survivor.primaryColor = component.bodyColor; survivor.desiredSortPosition = 105f; survivor.unlockableDef = null; } private static void SilenceSelection(GameObject root) { Animator[] componentsInChildren = root.GetComponentsInChildren(true); foreach (Animator obj in componentsInChildren) { ((Behaviour)obj).enabled = false; obj.runtimeAnimatorController = null; } Component[] componentsInChildren2 = root.GetComponentsInChildren(true); foreach (Component val in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val)) { Type type = ((object)val).GetType(); if (type.Name == "AkEvent" || type.Name == "AkAmbient" || type.Name == "PlaySoundOnEvent") { Object.DestroyImmediate((Object)(object)val); } } } CharacterSelectSurvivorPreviewDisplayController component = root.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } string[] array = new string[2] { "skillChangeResponses", "skinChangeResponses" }; foreach (string name in array) { FieldInfo field = ((object)component).GetType().GetField(name); if (field != null && field.FieldType.IsArray) { field.SetValue(component, Array.CreateInstance(field.FieldType.GetElementType(), 0)); } } } } public class PreviewNoSkill : BaseSkillState { public override void OnEnter() { ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } } public static class PolishEffects { private static Material fireMat; private static Material smokeMat; private static Mesh splashSheet; private static Material sheetMat; public static Color32 TimingColor(float delay, float span) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(delay * 100f), 0, 65535); int num2 = Mathf.Clamp(Mathf.RoundToInt(span * 100f), 0, 65535); return new Color32((byte)num, (byte)(num >> 8), (byte)num2, (byte)(num2 >> 8)); } public static void Timing(Color32 c, out float delay, out float span) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) delay = (float)(c.r + (c.g << 8)) * 0.01f; span = (float)(c.b + (c.a << 8)) * 0.01f; } public static LineRenderer Line(GameObject root, string name, int points, float width, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) GameObject val = new GameObject(name); val.transform.SetParent(root.transform, false); LineRenderer obj = val.AddComponent(); obj.useWorldSpace = false; obj.positionCount = points; obj.widthMultiplier = width; ((Renderer)obj).sharedMaterial = KitVfx.glow; obj.startColor = color; obj.endColor = new Color(color.r, color.g, color.b, 0f); return obj; } private static Material Cloud(bool fire) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (fire && Object.op_Implicit((Object)(object)fireMat)) { return fireMat; } if (!fire && Object.op_Implicit((Object)(object)smokeMat)) { return smokeMat; } Material val = new Material(KitVfx.glow); Texture2D val2 = new Texture2D(128, 128, (TextureFormat)4, false); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = ((float)j - 63.5f) / 63.5f; float num2 = ((float)i - 63.5f) / 63.5f; float num3 = Mathf.PerlinNoise((float)j * 0.061f, (float)i * 0.061f) * 0.6f + Mathf.PerlinNoise((float)j * 0.143f + 9f, (float)i * 0.143f) * 0.25f; float num4 = Mathf.Sqrt(num * num + num2 * num2); float num5 = Mathf.Clamp01((1f - num4) * 3.3f - 0.65f + num3 * 0.6f); float num6 = (fire ? Mathf.Lerp(0.55f, 1f, num3) : Mathf.Lerp(0.45f, 0.85f, num3)); val2.SetPixel(j, i, new Color(num6 * num5, num6 * num5, num6 * num5, num5)); } } ((Texture)val2).wrapMode = (TextureWrapMode)1; val2.Apply(); val.mainTexture = (Texture)(object)val2; val.SetInt("_DstBlend", fire ? 1 : 10); val.SetFloat("_Boost", fire ? 2.5f : 1f); if (fire) { fireMat = val; } else { smokeMat = val; } return val; } private static void Particle(GameObject g, string name, Color color, float life, int max) { //IL_0001: 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_005a: 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_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: 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_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: 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_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = KitVfx.Particles(g, color, 0.5f, life, 1f, loop: false); ((Object)val).name = name; MainModule main = val.main; ((MainModule)(ref main)).maxParticles = max; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit((name == "Droplets") ? 0.7f : ((name == "Debris") ? 1.5f : 0f)); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, 6.28f); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0.6f, 1f, (name == "Smoke") ? 2f : 1.25f)); bool flag = name == "Fire" || name == "HotCore" || name == "Sparks"; bool flag2 = name == "Smoke"; if (flag || flag2) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.white); ParticleSystemRenderer component = ((Component)val).GetComponent(); ((Renderer)component).sharedMaterial = Cloud(flag); if (name == "Sparks") { component.renderMode = (ParticleSystemRenderMode)1; component.lengthScale = 2.5f; component.velocityScale = 0.06f; } ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)((!flag) ? new GradientColorKey[2] { new GradientColorKey(new Color(0.35f, 0.29f, 0.23f), 0f), new GradientColorKey(new Color(0.24f, 0.25f, 0.27f), 1f) } : new GradientColorKey[4] { new GradientColorKey(new Color(1f, 0.96f, 0.6f), 0f), new GradientColorKey(new Color(1f, 0.64f, 0.12f), 0.25f), new GradientColorKey(new Color(1f, 0.24f, 0.015f), 0.7f), new GradientColorKey(new Color(0.35f, 0.1f, 0.025f), 1f) }), (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(flag ? 0.95f : 0.38f, 0f), new GradientAlphaKey(flag ? 0.8f : 0.28f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); RotationOverLifetimeModule rotationOverLifetime = val.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(-1.5f, 1.5f); } } private static Material SheetMaterial() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)sheetMat)) { return sheetMat; } sheetMat = new Material(KitVfx.glow); Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = (float)j / 127f; float num2 = (float)i / 127f; float num3 = Mathf.Pow(Mathf.Sin(num * MathF.PI), 0.8f) * Mathf.Sin(num2 * MathF.PI); float num4 = Mathf.PerlinNoise((float)j * 0.065f, (float)i * 0.13f); float num5 = 0.55f + 0.45f * Mathf.Sin((float)i * 0.24f + (float)j * 0.07f + num4 * 4f); float num6 = num3 * (0.2f + 0.65f * num4); val.SetPixel(j, i, new Color(num6 * (0.3f + 0.5f * num5), num6 * (0.75f + 0.25f * num5), num6, num6)); } } ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(); sheetMat.mainTexture = (Texture)(object)val; sheetMat.SetFloat("_Boost", 1.8f); return sheetMat; } private static void WaterSheets(GameObject root) { //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)splashSheet)) { List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i < 9; i++) { for (int j = 0; j < 7; j++) { float num = (float)i / 8f; float num2 = ((float)j / 6f - 0.5f) * 0.6f; float num3 = (0.13f + num * 0.87f) * (1f + 0.07f * Mathf.Sin((float)j * 2.4f)); list.Add(new Vector3(Mathf.Cos(num2) * num3, Mathf.Sin(num * MathF.PI) * (0.44f + 0.09f * Mathf.Cos(num2 * 7f)), Mathf.Sin(num2) * num3)); list2.Add(new Vector2((float)j / 6f, num)); if (i < 8 && j < 6) { int num4 = i * 7 + j; list3.AddRange(new int[6] { num4, num4 + 7, num4 + 1, num4 + 1, num4 + 7, num4 + 8 }); } } } splashSheet = new Mesh(); ((Object)splashSheet).name = "Curved water mass sheets"; splashSheet.SetVertices(list); splashSheet.SetUVs(0, list2); splashSheet.SetTriangles(list3, 0); splashSheet.RecalculateNormals(); } for (int k = 0; k < 8; k++) { GameObject val = new GameObject("MassSheet" + k); val.transform.SetParent(root.transform, false); val.AddComponent().sharedMesh = splashSheet; ((Renderer)val.AddComponent()).sharedMaterial = SheetMaterial(); val.transform.localRotation = Quaternion.Euler(0f, (float)(k * 45), 0f); } } public static void Build(GameObject g, int kind) { //IL_00e1: 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_00c6: 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_0118: 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_0330: 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_028d: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_0234: 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) switch (kind) { case 4: { for (int i = 0; i < 128; i++) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)5); Object.DestroyImmediate((Object)(object)obj.GetComponent()); ((Object)obj).name = "Tag" + i; obj.transform.SetParent(g.transform, false); obj.GetComponent().sharedMaterial = KitVfx.paper; obj.transform.localScale = new Vector3(0.22f, 0.44f, 1f); } return; } case 5: return; } LineRenderer val = Line(g, "Ring", 49, 0.1f, (Color)(kind switch { 6 => new Color(0.8f, 0.9f, 0.3f, 0.8f), 1 => new Color(1f, 0.35f, 0.02f, 0.8f), _ => new Color(0.55f, 0.93f, 1f, 0.9f), })); for (int j = 0; j < 49; j++) { float num = (float)j * MathF.PI * 2f / 48f; val.SetPosition(j, new Vector3(Mathf.Cos(num), 0.06f, Mathf.Sin(num))); } switch (kind) { case 6: return; case 0: WaterSheets(g); Particle(g, "WaterCore", new Color(0.5f, 0.9f, 1f, 0.7f), 0.43f, 16); break; } switch (kind) { case 0: case 3: { int num2 = ((kind == 0) ? 12 : 7); for (int k = 0; k < num2; k++) { Line(g, "Sheet" + k, 12, (kind == 0) ? 0.3f : 0.23f, new Color(0.55f, 0.93f, 1f, 0.85f)); } Particle(g, "Droplets", new Color(0.65f, 0.94f, 1f), 0.85f, 160); Particle(g, "Foam", new Color(0.86f, 0.98f, 1f), 0.65f, 80); Particle(g, "Mist", new Color(0.55f, 0.82f, 0.88f, 0.3f), 0.9f, 32); break; } case 1: Particle(g, "Debris", new Color(0.24f, 0.14f, 0.06f), 0.65f, 14); Particle(g, "Fire", new Color(1f, 0.36f, 0.025f, 0.9f), 0.65f, 40); Particle(g, "HotCore", new Color(1f, 0.85f, 0.35f, 0.8f), 0.22f, 14); Particle(g, "Sparks", new Color(1f, 0.61f, 0.13f), 0.7f, 48); Particle(g, "Smoke", new Color(0.22f, 0.25f, 0.28f, 0.38f), 1.05f, 28); break; default: Particle(g, "Flash", new Color(0.6f, 0.9f, 1f), 0.35f, 32); break; } } public static void Burst(GameObject root, int kind, float scale) { //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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = root.GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren) { obj.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = obj.main; string name = ((Object)obj).name; float num = name switch { "Foam" => 0.19f, "Mist" => 0.4f, "Smoke" => 0.62f, "HotCore" => 0.57f, "Fire" => 0.83f, "WaterCore" => 0.62f, _ => 0.035f, }; float num2 = name switch { "Fire" => 0.48f, "Mist" => 0.45f, "Smoke" => 0.35f, "Droplets" => 1f, "Sparks" => 1.05f, "WaterCore" => 0.55f, _ => 1.1f, }; ((MainModule)(ref main)).startSpeed = new MinMaxCurve(scale * num2 * 0.4f, scale * num2); ((MainModule)(ref main)).startSize = new MinMaxCurve(scale * num * 0.5f, scale * num); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)2; ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); ((ShapeModule)(ref shape)).radius = scale * 0.12f; int num3 = name switch { "Debris" => 12, "Smoke" => 21, "Sparks" => 44, "HotCore" => 8, "Fire" => 32, "Mist" => 24, "Foam" => 72, "Droplets" => 140, "WaterCore" => 14, _ => 25, }; obj.Play(); obj.Emit(num3); } } } public class WaterWake : MonoBehaviour { private static readonly Queue pool = new Queue(); private static int live; private TrailRenderer trail; private float until; private bool following; public static WaterWake Rent() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00ea: 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) WaterWake waterWake = null; while (pool.Count > 0 && !Object.op_Implicit((Object)(object)waterWake)) { waterWake = pool.Dequeue(); } if (!Object.op_Implicit((Object)(object)waterWake)) { if (live >= 16) { return null; } GameObject val = new GameObject("Tobirama pooled water wake"); waterWake = val.AddComponent(); waterWake.trail = val.AddComponent(); ((Renderer)waterWake.trail).sharedMaterial = KitVfx.glow; waterWake.trail.time = 0.22f; waterWake.trail.widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 2.4f), new Keyframe(0.45f, 1.4f), new Keyframe(1f, 0f) }); waterWake.trail.startColor = new Color(0.42f, 0.78f, 1f, 0.42f); waterWake.trail.time = 0.3f; waterWake.trail.endColor = Color.clear; waterWake.trail.minVertexDistance = 0.12f; live++; } ((Component)waterWake).gameObject.layer = 0; ((Component)waterWake).gameObject.SetActive(true); waterWake.trail.Clear(); waterWake.trail.emitting = false; waterWake.following = true; return waterWake; } public void Follow(Vector3 p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = p; trail.emitting = true; } public void Release() { following = false; trail.emitting = false; until = Time.time + 0.25f; } private void Update() { if (!following && Time.time >= until) { trail.Clear(); ((Component)this).gameObject.SetActive(false); pool.Enqueue(this); } } private void OnDestroy() { live--; } } public class TobiEffect : MonoBehaviour { public int kind; private bool initialized; private bool counted; private static int activeBursts; public static int PeakBursts; private float born; private float scale; private float nextBurst; private EffectData data; private CharacterBody owner; private string key; private int decor; private static readonly Dictionary fields = new Dictionary(); public static int ActiveFields => fields.Count; private void OnEnable() { initialized = false; born = Time.time; decor = 0; nextBurst = 0f; } private void OnDisable() { if (counted) { activeBursts--; counted = false; } if (key != null && fields.ContainsKey(key) && (Object)(object)fields[key] == (Object)(object)this) { fields.Remove(key); } key = null; } private void End() { ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Stop(true, (ParticleSystemStopBehavior)0); } EffectManagerHelper component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.OwningPool != null) { component.ReturnToPool(); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Update() { //IL_01b5: 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_05ff: 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_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_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_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Expected O, but got Unknown //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_04c7: 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_04e7: 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_0515: Expected O, but got Unknown //IL_0754: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { EffectComponent component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.effectData == null) { return; } if (kind == 1) { if (activeBursts >= 40) { End(); return; } counted = true; activeBursts++; PeakBursts = Mathf.Max(PeakBursts, activeBursts); } data = component.effectData; scale = data.scale; GameObject val = data.ResolveNetworkedObjectReference(); owner = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); key = (Object.op_Implicit((Object)(object)owner) ? ((Object)owner).GetInstanceID() : 0) + ":" + data.genericUInt; initialized = true; born = Time.time; if (kind == 4) { fields[key] = this; } if (kind == 5) { TandemField.Stop(key); End(); return; } if (kind != 4) { PolishEffects.Burst(((Component)this).gameObject, kind, (kind == 3) ? 2.1f : scale); } Kit.Log("FX_INIT kind=" + kind + " at=" + ((object)((Component)this).transform.position/*cast due to .constrained prefix*/).ToString()); } float num = Time.time - born; if (kind == 4) { num = Mathf.Max(0f, FixedTimeStamp.now.t - data.genericFloat); if (!Object.op_Implicit((Object)(object)owner) || !owner.healthComponent.alive) { End(); return; } PolishEffects.Timing(data.color, out var delay, out var span); float num2 = Mathf.Clamp01((num - delay) / Mathf.Max(0.1f, span)); int num3 = ((num < 0.5f) ? 3 : Mathf.Clamp(12 + Mathf.FloorToInt((num - 0.5f) * 30f), 3, 128)); Vector3 val2 = default(Vector3); for (int i = 0; i < 128; i++) { Transform child = ((Component)this).transform.GetChild(i); ((Component)child).gameObject.SetActive(i < num3); float num4 = (float)i * 2.399963f; float num5 = scale * 0.86f * Mathf.Sqrt(((float)i + 0.5f) / 128f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num4) * num5, 0.45f + (float)(i * 17 % 11) * 0.96f + Mathf.Sin(num * 6f + (float)i) * 0.22f, Mathf.Sin(num4) * num5); if (num < 0.5f) { val2 = Vector3.Lerp(data.start - ((Component)this).transform.position, val2, num / 0.5f); } child.localPosition = val2; child.localRotation = Quaternion.Euler(65f + Mathf.Sin(num * 8f + (float)i) * 35f, num4 * 57.29578f + num * 160f, (float)(i * 37)); } if (num >= delay && num < delay + span && num >= nextBurst && decor < 96) { float num6 = (float)decor * 2.399963f; float num7 = scale * Mathf.Lerp(0.35f, 0.65f, num2); float num8 = 0.6f + (float)(decor % 4) * 2.5333333f * Mathf.Lerp(0.65f, 1f, num2); Vector3 origin = ((Component)this).transform.position + new Vector3(Mathf.Cos(num6) * num7, num8, Mathf.Sin(num6) * num7); EffectManager.SpawnEffect(KitVfx.explosion, new EffectData { origin = origin, scale = scale * Mathf.Lerp(0.26f, 0.36f, num2) * (1f + 0.15f * Mathf.Sin((float)decor * 3.7f)) }, false); if ((decor & 1) == 0) { float num9 = num6 + 1.65f; float num10 = 0.6f + (float)((decor + 2) % 4) * 2.5333333f * Mathf.Lerp(0.65f, 1f, num2); EffectManager.SpawnEffect(KitVfx.explosion, new EffectData { origin = ((Component)this).transform.position + new Vector3(Mathf.Cos(num9) * num7, num10, Mathf.Sin(num9) * num7), scale = scale * Mathf.Lerp(0.16f, 0.23f, num2) }, false); } decor++; nextBurst = num + Mathf.Lerp(0.1f, 0.045f, num2); } if (num > delay + span + 0.95f || num > 60f) { End(); } return; } if (kind == 0) { float num11 = Mathf.Clamp01(num / 0.23f); float num12 = 1f - Mathf.Clamp01((num - 0.18f) / 0.55f); for (int j = 0; j < 8; j++) { Transform obj = ((Component)this).transform.Find("MassSheet" + j); ((Component)obj).gameObject.SetActive(num < 0.73f); obj.localScale = new Vector3(scale * num11 * (0.88f + 0.08f * Mathf.Sin((float)j)), scale * (0.38f + 0.62f * num11) * num12, scale * num11); } } if (kind == 0 || kind == 3) { float num13 = ((kind == 0) ? scale : 2f); int num14 = ((kind == 0) ? 12 : 7); for (int k = 0; k < num14; k++) { Transform obj2 = ((Component)this).transform.Find("Sheet" + k); LineRenderer component2 = ((Component)obj2).GetComponent(); float num15 = (float)k * MathF.PI * 2f / (float)num14; float num16 = num13 * Mathf.Clamp01(num / 0.44f); float num17 = 1f - Mathf.Clamp01((num - 0.2f) / 0.55f); component2.widthMultiplier = ((kind == 0) ? 0.06f : 0.1f) * num13 * num17; ((Component)obj2).gameObject.SetActive(num < 0.76f); for (int l = 0; l < 12; l++) { float num18 = (float)l / 11f; float num19 = num16 * num18; component2.SetPosition(l, new Vector3(Mathf.Cos(num15) * num19, Mathf.Sin(num18 * MathF.PI) * num13 * (0.22f + 0.08f * (float)(k % 3)) * (1f - Mathf.Clamp01(num / 1.1f)), Mathf.Sin(num15) * num19)); } } } Transform val3 = ((Component)this).transform.Find("Ring"); if (Object.op_Implicit((Object)(object)val3)) { ((Component)val3).gameObject.SetActive(kind == 6 || num < 0.5f); val3.localScale = Vector3.one * ((kind == 6) ? scale : Mathf.Lerp(0.1f, (kind == 3) ? 2f : scale, Mathf.Clamp01(num / 0.4f))); ((Component)val3).GetComponent().widthMultiplier = ((kind == 0) ? 0.24f : 0.1f) * (1f - Mathf.Clamp01(num / 0.6f)); } if (num > ((kind == 6) ? 0.65f : 1.2f)) { End(); } } } public static class Marks { private static readonly Dictionary until = new Dictionary(); public static GameObject sealFx; public static GameObject flashFx; public static GameObject slashFx; public static Material sealMat; public static Material flashMat; public static Material ghostMat; public static Material lineMat; public static void Prepare() { //IL_001a: 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_0080: 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) sealMat = StormFx.Mat((Texture)(object)Tex03.sealRing, additive: true, new Color(1f, 0.82f, 0.35f, 1f), 2.2f, 3006); flashMat = StormFx.Mat((Texture)(object)StormFx.soft, additive: true, new Color(1f, 0.95f, 0.7f, 1f), 3f, 3006); ghostMat = StormFx.Mat((Texture)(object)Texture2D.whiteTexture, additive: true, new Color(1f, 0.9f, 0.45f, 0.5f), 1.5f, 3005); lineMat = StormFx.Mat((Texture)(object)StormFx.Tex("Raijin/line.png", (TextureWrapMode)1), additive: true, new Color(1f, 0.95f, 0.7f, 1f), 3f, 3006); sealFx = Effect("TobiramaFormulaSeal", delegate(GameObject g) { g.AddComponent(); }); flashFx = Effect("TobiramaHiraishinFlash", delegate(GameObject g) { FlashFx.Build(g); }); slashFx = Effect("TobiramaRaijinSlash", delegate(GameObject g) { SlashLineFx.Build(g); }); } private static GameObject Effect(string name, Action build) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().applyScale = false; val.AddComponent().DoNotPool = true; build(val); GameObject val2 = PrefabAPI.InstantiateClone(val, name, false); Object.DestroyImmediate((Object)(object)val); KitVfx.effects.Add(new EffectDef(val2)); return val2; } public static bool Has(GameObject o) { if (Object.op_Implicit((Object)(object)o) && until.TryGetValue(o, out var value)) { return Time.time < value; } return false; } public static void Register(GameObject o, float seconds) { if (Object.op_Implicit((Object)(object)o)) { until[o] = Time.time + seconds; } } public static void Unregister(GameObject o) { if (Object.op_Implicit((Object)(object)o)) { until.Remove(o); } } public static void Apply(HealthComponent h) { //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_0046: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown if (NetworkServer.active && Object.op_Implicit((Object)(object)h) && h.alive && Object.op_Implicit((Object)(object)h.body)) { Register(((Component)h).gameObject, KitTuning.MarkDuration.Value); EffectData val = new EffectData { origin = h.body.corePosition, genericFloat = KitTuning.MarkDuration.Value, genericUInt = 1u, scale = Mathf.Max(0.6f, h.body.radius) }; val.SetNetworkedObjectReference(((Component)h).gameObject); EffectManager.SpawnEffect(sealFx, val, true); Kit.Log("MARK_APPLY victim=" + ((Object)h.body).name + "#" + ((Object)h).GetInstanceID()); } } public static float Consume(HealthComponent h, string why) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown if (!NetworkServer.active || !Object.op_Implicit((Object)(object)h) || !Has(((Component)h).gameObject)) { return 1f; } Unregister(((Component)h).gameObject); EffectData val = new EffectData { origin = (Object.op_Implicit((Object)(object)h.body) ? h.body.corePosition : ((Component)h).transform.position), genericUInt = 0u }; val.SetNetworkedObjectReference(((Component)h).gameObject); EffectManager.SpawnEffect(sealFx, val, true); Kit.Log("MARK_CONSUME by=" + why + " victim=" + (Object.op_Implicit((Object)(object)h.body) ? ((Object)h.body).name : ((Object)h).name) + "#" + ((Object)h).GetInstanceID()); return 1f + KitTuning.MarkBonus.Value; } public unsafe static CharacterBody AimTarget(CharacterBody owner, Ray aim) { //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_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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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_019e: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: 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_0161: 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_025d: 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_026c: 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_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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) string[] obj = new string[6] { "SLASH_AIM marks=", until.Count.ToString(), " origin=", null, null, null }; Vector3 val = ((Ray)(ref aim)).origin; obj[3] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); obj[4] = " dir="; val = ((Ray)(ref aim)).direction; obj[5] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); Kit.Log(string.Concat(obj)); CharacterBody result = null; float num = float.MaxValue; float value = KitTuning.SlashRange.Value; float num2 = Mathf.Cos(KitTuning.SlashCone.Value * (MathF.PI / 180f)); KeyValuePair[] array = until.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (!Object.op_Implicit((Object)(object)keyValuePair.Key) || Time.time >= keyValuePair.Value) { until.Remove(keyValuePair.Key); continue; } CharacterBody component = keyValuePair.Key.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || !component.healthComponent.alive || (Object)(object)component == (Object)(object)owner || (Object.op_Implicit((Object)(object)owner.teamComponent) && Object.op_Implicit((Object)(object)component.teamComponent) && component.teamComponent.teamIndex == owner.teamComponent.teamIndex)) { continue; } Vector3 val2 = component.corePosition - ((Ray)(ref aim)).origin; float magnitude = ((Vector3)(ref val2)).magnitude; float num3 = Vector3.Dot(val2 / Mathf.Max(0.01f, magnitude), ((Ray)(ref aim)).direction); Kit.Log("SLASH_AIM candidate " + ((Object)component).name + " dist=" + magnitude.ToString("0.0") + " angle=" + (Mathf.Acos(Mathf.Clamp(num3, -1f, 1f)) * 57.29578f).ToString("0.0")); if (magnitude > value) { continue; } Vector3 val3 = Vector3.ProjectOnPlane(component.corePosition - owner.corePosition, Vector3.up); int num4; if (((Vector3)(ref val3)).magnitude < 5f + component.radius) { Vector3 normalized = ((Vector3)(ref val3)).normalized; val = Vector3.ProjectOnPlane(((Ray)(ref aim)).direction, Vector3.up); num4 = ((Vector3.Dot(normalized, ((Vector3)(ref val)).normalized) > -0.1f) ? 1 : 0); } else { num4 = 0; } val = Vector3.Cross(((Ray)(ref aim)).direction, val2); float magnitude2 = ((Vector3)(ref val)).magnitude; if (num4 == 0 && (num3 <= 0f || (num3 < num2 && magnitude2 > component.radius + 1.2f))) { continue; } if (Physics.Linecast(((Ray)(ref aim)).origin, component.corePosition, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { Kit.Log("SLASH_AIM blocked " + ((Object)component).name); continue; } float num5 = (1f - num3) * 40f + magnitude * 0.1f; if (num5 < num) { num = num5; result = component; } } return result; } public static void Flash(Vector3 p, float scale) { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (NetworkServer.active) { EffectManager.SpawnEffect(flashFx, new EffectData { origin = p, scale = scale }, true); } } } public class SealFx : MonoBehaviour { private static readonly Dictionary live = new Dictionary(); private GameObject target; private CharacterBody body; private Transform quad; private MeshRenderer r; private float born; private float life; private float size; private float ending = -1f; private bool init; private void Update() { //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_027d: 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_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_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_02b2: 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_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0301: 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_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0384: 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) if (!init) { init = true; EffectComponent component = ((Component)this).GetComponent(); EffectData val = (Object.op_Implicit((Object)(object)component) ? component.effectData : null); if (val == null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } target = val.ResolveNetworkedObjectReference(); if (!Object.op_Implicit((Object)(object)target)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (val.genericUInt == 0) { Marks.Unregister(target); if (live.TryGetValue(target, out var value) && Object.op_Implicit((Object)(object)value)) { value.ending = Time.time; } Object.Destroy((Object)(object)((Component)this).gameObject); return; } Marks.Register(target, val.genericFloat); if (live.TryGetValue(target, out var value2) && Object.op_Implicit((Object)(object)value2) && (Object)(object)value2 != (Object)(object)this) { Object.Destroy((Object)(object)((Component)value2).gameObject); } live[target] = this; body = target.GetComponent(); life = val.genericFloat; size = Mathf.Clamp(val.scale, 0.6f, 3f); born = Time.time; GameObject val2 = new GameObject("Seal"); val2.transform.SetParent(((Component)this).transform, false); val2.AddComponent().sharedMesh = StormFx.quad; r = val2.AddComponent(); ((Renderer)r).sharedMaterial = Marks.sealMat; ((Renderer)r).shadowCastingMode = (ShadowCastingMode)0; quad = val2.transform; } if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { End(); return; } float num = Time.time - born; float num2 = ((ending >= 0f) ? (1f - Mathf.Clamp01((Time.time - ending) / 0.25f)) : (1f - Mathf.Clamp01((num - (life - 0.6f)) / 0.6f))); if (num2 <= 0f) { End(); return; } Camera val3 = Water03.Cam(); Vector3 val4 = body.corePosition + Vector3.up * body.radius * 0.2f; ((Component)this).transform.position = val4; if (Object.op_Implicit((Object)(object)val3)) { Vector3 val5 = ((Component)val3).transform.position - val4; ((Component)this).transform.position = val4 + ((Vector3)(ref val5)).normalized * Mathf.Min(body.radius * 0.9f, ((Vector3)(ref val5)).magnitude * 0.5f); ((Component)this).transform.rotation = Quaternion.LookRotation(-val5, ((Component)val3).transform.up); } float num3 = ((num < 0.18f) ? (1.4f - 0.4f * (num / 0.18f)) : 1f); quad.localRotation = Quaternion.Euler(0f, 0f, num * 40f); quad.localScale = Vector3.one * (0.75f + 0.35f * size) * num3; float num4 = 0.85f + 0.15f * Mathf.Sin(num * 6f); StormFx.Tint((Renderer)(object)r, new Color(1f, 0.82f, 0.35f, Mathf.Clamp01(num / 0.08f) * num2 * num4)); } private void End() { if (Object.op_Implicit((Object)(object)target) && live.ContainsKey(target) && (Object)(object)live[target] == (Object)(object)this) { live.Remove(target); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class FlashFx : MonoBehaviour { public Renderer core; public Renderer seal; public Renderer ring; private float born; private float scale; private bool init; public static void Build(GameObject g) { FlashFx flashFx = g.AddComponent(); flashFx.core = (Renderer)(object)StormFx.Part(g, "Core", StormFx.sphere, Marks.flashMat); flashFx.seal = (Renderer)(object)StormFx.Part(g, "Seal", StormFx.quad, Marks.sealMat); flashFx.ring = (Renderer)(object)StormFx.Part(g, "Ring", StormFx.ring, KitVfx.glow); } private void Update() { //IL_0066: 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_00a3: 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_00e7: 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_0106: 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_0137: 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_0169: 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_01ad: 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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0209: 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_024d: Unknown result type (might be due to invalid IL or missing references) if (!init) { init = true; born = Time.time; EffectComponent component = ((Component)this).GetComponent(); scale = ((Object.op_Implicit((Object)(object)component) && component.effectData != null) ? Mathf.Max(0.3f, component.effectData.scale) : 1f); } float num = Time.time - born; float num2 = Water03.CameraFade(((Component)this).transform.position, 8f, 0.1f); ((Component)core).transform.localScale = Vector3.one * (0.25f + 0.75f * StormFx.Ease(num / 0.06f)) * scale; StormFx.Tint(core, new Color(1f, 0.9f, 0.55f, 0.45f * (1f - Mathf.Clamp01(num / 0.14f)) * num2)); ((Component)seal).transform.localPosition = Vector3.down * 0.95f * scale; ((Component)seal).transform.localRotation = Quaternion.Euler(90f, num * 90f, 0f); ((Component)seal).transform.localScale = Vector3.one * (1.2f + 1.4f * StormFx.Ease(num / 0.15f)) * scale; StormFx.Tint(seal, new Color(1f, 0.82f, 0.35f, (1f - Mathf.Clamp01((num - 0.2f) / 0.35f)) * num2)); ((Component)ring).transform.localPosition = Vector3.down * 0.9f * scale; ((Component)ring).transform.localScale = Vector3.one * (0.5f + 3f * StormFx.Ease(num / 0.3f)) * scale; StormFx.Tint(ring, new Color(1f, 0.9f, 0.5f, 0.8f * (1f - Mathf.Clamp01(num / 0.35f)) * num2)); if (num > 0.6f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class SlashLineFx : MonoBehaviour { public LineRenderer line; public LineRenderer glow; private float born; private bool init; private Vector3 a; private Vector3 b; public static void Build(GameObject g) { //IL_0027: 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) SlashLineFx slashLineFx = g.AddComponent(); slashLineFx.line = PolishEffects.Line(g, "Slash", 2, 0.5f, new Color(1f, 0.95f, 0.75f, 1f)); ((Renderer)slashLineFx.line).sharedMaterial = Marks.lineMat; slashLineFx.line.useWorldSpace = true; slashLineFx.glow = PolishEffects.Line(g, "SlashGlow", 2, 1.4f, new Color(1f, 0.8f, 0.35f, 0.6f)); slashLineFx.glow.useWorldSpace = true; } private void Update() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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) if (!init) { init = true; born = Time.time; EffectData effectData = ((Component)this).GetComponent().effectData; a = effectData.start; b = effectData.origin; } float num = Time.time - born; float num2 = 1f - Mathf.Clamp01(num / 0.3f); Vector3.Lerp(a, b, 0.5f); LineRenderer[] array = (LineRenderer[])(object)new LineRenderer[2] { line, glow }; foreach (LineRenderer obj in array) { obj.SetPosition(0, Vector3.Lerp(b, a, 0.25f + 0.75f * num2)); obj.SetPosition(1, b); obj.widthMultiplier = (((Object)(object)obj == (Object)(object)line) ? 0.4f : 1.1f) * num2; } if (num > 0.32f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class Afterimage : MonoBehaviour { private readonly List parts = new List(); private float born; public static void Spawn(Visual v) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)v)) { return; } GameObject val = new GameObject("Tobirama afterimage"); Afterimage afterimage = val.AddComponent(); afterimage.born = Time.time; SkinnedMeshRenderer[] componentsInChildren = ((Component)v).GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { if (((Renderer)val2).enabled) { Mesh val3 = new Mesh(); val2.BakeMesh(val3); GameObject val4 = new GameObject("Part"); val4.transform.SetParent(val.transform, false); val4.transform.position = ((Component)val2).transform.position; val4.transform.rotation = ((Component)val2).transform.rotation; val4.AddComponent().sharedMesh = val3; MeshRenderer val5 = val4.AddComponent(); ((Renderer)val5).sharedMaterial = Marks.ghostMat; ((Renderer)val5).shadowCastingMode = (ShadowCastingMode)0; afterimage.parts.Add(val5); } } Object.Destroy((Object)(object)val, 0.5f); } private void Update() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) float num = 1f - Mathf.Clamp01((Time.time - born) / 0.45f); foreach (MeshRenderer part in parts) { if (Object.op_Implicit((Object)(object)part)) { StormFx.Tint((Renderer)(object)part, new Color(1f, 0.9f, 0.45f, 0.55f * num)); } } } private void OnDestroy() { foreach (MeshRenderer part in parts) { if (Object.op_Implicit((Object)(object)part)) { Object.Destroy((Object)(object)((Component)part).GetComponent().sharedMesh); } } } } public class RaijinSlash : TobiCast { public GameObject target; private bool struck; private bool moved; private float strikeAt = 0.12f; private float duration = 0.5f; private Vector3 departure; private static Vector3 Behind(CharacterBody tb, Vector3 from, out Vector3 back) { //IL_0020: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_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_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) Vector3.ProjectOnPlane(Object.op_Implicit((Object)(object)tb.characterDirection) ? tb.characterDirection.forward : tb.transform.forward, Vector3.up); Vector3 val = Vector3.ProjectOnPlane(tb.corePosition - from, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); back = val; return tb.footPosition + back * (tb.radius + 1.8f); } public unsafe override void OnEnter() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c8: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f6: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); ((EntityState)this).characterBody.SetAimTimer(0f); departure = ((EntityState)this).characterBody.corePosition; if (Object.op_Implicit((Object)(object)v)) { Afterimage.Spawn(v); } CharacterBody val = (Object.op_Implicit((Object)(object)target) ? target.GetComponent() : null); if (NetworkServer.active) { Marks.Flash(departure, 1f); TobiBody tobiBody = Kit.Runtime(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)tobiBody.anchor)) { tobiBody.anchor.Consume(teleport: false); } if (Object.op_Implicit((Object)(object)val)) { Vector3 back; Vector3 val2 = Behind(val, departure, out back); moved = tobiBody.Teleport(val2 - back * 1.2f, -back, val.healthComponent); Vector3 val3; if (!moved) { val3 = Vector3.ProjectOnPlane(val.corePosition - departure, Vector3.up); Vector3 normalized = ((Vector3)(ref val3)).normalized; moved = tobiBody.Teleport(val.footPosition + normalized * (val.radius + 2.4f), -normalized, val.healthComponent); } string[] obj = new string[8] { "RAIJIN_SLASH target=", ((Object)val).name, " moved=", moved.ToString(), " arrive=", null, null, null }; val3 = ((EntityState)this).characterBody.footPosition; obj[5] = ((object)(*(Vector3*)(&val3))/*cast due to .constrained prefix*/).ToString(); obj[6] = " target="; val3 = val.footPosition; obj[7] = ((object)(*(Vector3*)(&val3))/*cast due to .constrained prefix*/).ToString(); Kit.Log(string.Concat(obj)); } } Face(val); if (Object.op_Implicit((Object)(object)v)) { v.Play("Raijin_Slash", 1.15f, 0f, restart: true, 0f); if (TrackedReference.op_Implicit((TrackedReference)(object)v.player["Raijin_Slash"])) { v.player["Raijin_Slash"].time = 0.16f; v.player.Sample(); } v.lockUntil = Time.time + duration; } TobiAudio.Send(((EntityState)this).characterBody, 2); } private void Face(CharacterBody tb) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)tb) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = Vector3.ProjectOnPlane(tb.corePosition - ((EntityState)this).characterBody.corePosition, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; ((EntityState)this).characterDirection.moveVector = Vector3.zero; } } } public override void FixedUpdate() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00d6: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_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_016c: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); CharacterBody val = (Object.op_Implicit((Object)(object)target) ? target.GetComponent() : null); if (((EntityState)this).fixedAge < 0.3f) { Face(val); } if (!struck && ((EntityState)this).fixedAge >= strikeAt) { struck = true; if (NetworkServer.active && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { float num = Marks.Consume(val.healthComponent, "slash"); Vector3 val2 = Vector3.ProjectOnPlane(val.corePosition - departure, Vector3.up); Vector3 force = ((Vector3)(ref val2)).normalized * 1200f + Vector3.up * 600f; Kit.Damage(((EntityState)this).characterBody, val.healthComponent, ((EntityState)this).characterBody.damage * KitTuning.SlashDamage.Value * num, 1f, val.corePosition, ((EntityState)this).characterBody.RollCrit(), "RAIJIN_SLASH bonus=" + num.ToString("0.00"), force, (DamageType)0, (DamageSource)4); Marks.Apply(val.healthComponent); EffectManager.SpawnEffect(Marks.slashFx, new EffectData { origin = val.corePosition, start = departure }, true); GameObject slashFx = Marks.slashFx; EffectData val3 = new EffectData(); Vector3 corePosition = ((EntityState)this).characterBody.corePosition; val2 = ((EntityState)this).characterBody.corePosition - val.corePosition; val3.origin = corePosition + ((Vector3)(ref val2)).normalized * 0.8f; val3.start = val.corePosition; EffectManager.SpawnEffect(slashFx, val3, true); KitVfx.Emit(KitVfx.teleport, val.corePosition, 0.6f); } if (Object.op_Implicit((Object)(object)v)) { v.hitStopUntil = Time.time + 0.08f; } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnSerialize(NetworkWriter w) { ((BaseSkillState)this).OnSerialize(w); w.Write(target); } public override void OnDeserialize(NetworkReader r) { ((BaseSkillState)this).OnDeserialize(r); target = r.ReadGameObject(); } } public class RaijinSwap : TobiCast { public unsafe override void OnEnter() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00fe: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); if (NetworkServer.active) { RelayOwner component = ((Component)((EntityState)this).characterBody).GetComponent(); RelayClone relayClone = (Object.op_Implicit((Object)(object)component) ? component.clone : null); if (Object.op_Implicit((Object)(object)relayClone)) { Vector3 footPosition = ((EntityState)this).characterBody.footPosition; Vector3 position = ((Component)relayClone).transform.position; Marks.Flash(((EntityState)this).characterBody.corePosition, 1f); if (Object.op_Implicit((Object)(object)v)) { Afterimage.Spawn(v); } ((Component)((EntityState)this).characterBody).GetComponent()?.DetachForTeleport(); OwnerMove10.Move(((EntityState)this).characterBody, position + (((EntityState)this).characterBody.transform.position - ((EntityState)this).characterBody.footPosition), pose: false); relayClone.MoveTo(footPosition); Marks.Flash(position + Vector3.up, 1f); Marks.Flash(footPosition + Vector3.up, 0.8f); TobiAudio.Send(((EntityState)this).characterBody, 3, position + Vector3.up); Vector3 val = footPosition; string? text = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); val = position; Kit.Log("RAIJIN_CLONE_SWAP from=" + text + " to=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString()); } } if (Object.op_Implicit((Object)(object)v)) { v.Play(((EntityState)this).characterMotor.isGrounded ? "Land_Heavy" : "Air_Apex", 1.2f, 0f, restart: true, 0.03f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > 0.2f) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } public static bool Aimed(CharacterBody b, Ray aim) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_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_0079: 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) RelayOwner component = ((Component)b).GetComponent(); RelayClone relayClone = (Object.op_Implicit((Object)(object)component) ? component.clone : null); if (!Object.op_Implicit((Object)(object)relayClone)) { return false; } Vector3 val = ((Component)relayClone).transform.position + Vector3.up * 1f - ((Ray)(ref aim)).origin; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 80f) { return false; } Vector3 val2 = Vector3.Cross(((Ray)(ref aim)).direction, val); float magnitude2 = ((Vector3)(ref val2)).magnitude; if (Vector3.Dot(val, ((Ray)(ref aim)).direction) > 0f) { return magnitude2 < Mathf.Max(1.4f, magnitude * 0.07f); } return false; } } public class RaijinSkillDef : SkillDef { public override bool CanExecute(GenericSkill slot) { TobiBody tobiBody = (Object.op_Implicit((Object)(object)slot.characterBody) ? ((Component)slot.characterBody).GetComponent() : null); if ((Object)(object)tobiBody == (Object)null || (!Object.op_Implicit((Object)(object)tobiBody.anchor) && !tobiBody.utilityPressConsumed)) { return ((SkillDef)this).CanExecute(slot); } return false; } public override void OnExecute(GenericSkill slot) { TobiBody tobiBody = Kit.Runtime(slot.characterBody); if (!Object.op_Implicit((Object)(object)tobiBody.anchor) && !tobiBody.utilityPressConsumed) { tobiBody.utilityPressConsumed = true; ((SkillDef)this).OnExecute(slot); Kit.Log("RAIJIN_STOCK consumed stock=" + slot.stock + " max=" + slot.maxStock); } } } public static class RelayKeys { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_ApplyUserProfileBindingsToRewiredPlayer <>9__4_0; public static Action <>9__4_1; internal void b__4_0(orig_ApplyUserProfileBindingsToRewiredPlayer orig, LocalUser self) { try { Check(self.userProfile); } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_KEYS check skipped: " + ex)); } orig.Invoke(self); } internal void b__4_1() { try { foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { Remember(readOnlyLocalUsers.userProfile); } } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_KEYS remember skipped: " + ex)); } } } private const string Section = "Extra skill keys (managed automatically)"; private static readonly HashSet checkedProfiles = new HashSet(); private static readonly Dictionary expectedId = new Dictionary(); private static int Slot => RewiredAction.FirstExtraSkill.ActionId; private static void Log(string text) { Plugin.instance.Log.LogInfo((object)("TOBIRAMA_KEYS " + text)); } public static void Install() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__4_0; if (obj == null) { hook_ApplyUserProfileBindingsToRewiredPlayer val = delegate(orig_ApplyUserProfileBindingsToRewiredPlayer orig, LocalUser self) { try { Check(self.userProfile); } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_KEYS check skipped: " + ex)); } orig.Invoke(self); }; <>c.<>9__4_0 = val; obj = (object)val; } LocalUser.ApplyUserProfileBindingsToRewiredPlayer += (hook_ApplyUserProfileBindingsToRewiredPlayer)obj; InputBindingDisplayController.onBindingsChanged = (Action)Delegate.Combine(InputBindingDisplayController.onBindingsChanged, (Action)delegate { try { foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { Remember(readOnlyLocalUsers.userProfile); } } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_KEYS remember skipped: " + ex)); } }); } private static List Bindings(KeyboardMap map, int action) { List list = new List(); foreach (ActionElementMap allMap in ((ControllerMap)map).AllMaps) { if (allMap.actionId == action) { list.Add(allMap); } } return list; } private static KeyCode Key(ActionElementMap m) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return (KeyCode)m.keyboardKeyCode; } private static int ExpectedId(KeyboardMap map, int action, KeyCode key) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown //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_001f: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected I4, but got Unknown if (expectedId.TryGetValue((int)key, out var value)) { return value; } KeyboardMap val = new KeyboardMap(map); ((ControllerMap)val).DeleteElementMapsWithAction(action); ((ControllerMap)val).CreateElementMap(action, (Pole)0, key, (ModifierKeyFlags)0); value = -1; foreach (ActionElementMap allMap in ((ControllerMap)val).AllMaps) { if (allMap.actionId == action) { value = allMap.elementIdentifierId; break; } } expectedId[(int)key] = value; return value; } private static ModifierKeyFlags Modifiers(ActionElementMap m) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected I4, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected I4, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected I4, but got Unknown //IL_0068: 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_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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) ModifierKeyFlags val = (ModifierKeyFlags)0; ModifierKey[] array = (ModifierKey[])(object)new ModifierKey[3] { (ModifierKey)(int)m.modifierKey1, (ModifierKey)(int)m.modifierKey2, (ModifierKey)(int)m.modifierKey3 }; foreach (ModifierKey val2 in array) { switch (val2 - 1) { case 0: val = (ModifierKeyFlags)(val | 1); break; case 1: val = (ModifierKeyFlags)(val | 4); break; case 2: val = (ModifierKeyFlags)(val | 0x10); break; case 3: val = (ModifierKeyFlags)(val | 0x40); break; } } return val; } private static bool Unchosen(KeyboardMap map, int action) { List list = Bindings(map, action); if (list.Count == 0) { return true; } int elementIdentifierId = RewiredAction.FirstExtraSkill.DefaultKeyboardMap.elementIdentifierId; int num = ExpectedId(map, action, (KeyCode)49); int num2 = 99; foreach (ActionElementMap item in list) { int elementIdentifierId2 = item.elementIdentifierId; if (elementIdentifierId2 != elementIdentifierId && elementIdentifierId2 != num && elementIdentifierId2 != num2) { return false; } } return true; } private unsafe static bool Repair(KeyboardMap map, int action) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0029: 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_0039: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00e7: Unknown result type (might be due to invalid IL or missing references) bool result = false; foreach (ActionElementMap item in Bindings(map, action)) { if ((int)item.elementType == 1 && (int)item.keyboardKeyCode != 0) { KeyCode val = Key(item); int num = ExpectedId(map, action, val); if (num >= 0 && num != item.elementIdentifierId) { Log("repair action " + action + ": shown " + ((object)(*(KeyCode*)(&val))/*cast due to .constrained prefix*/).ToString() + " but element " + item.elementIdentifierId + " fired; rebound to " + ((object)(*(KeyCode*)(&val))/*cast due to .constrained prefix*/).ToString()); Pole axisContribution = item.axisContribution; ModifierKeyFlags val2 = Modifiers(item); ((ControllerMap)map).DeleteElementMap(item.id); ((ControllerMap)map).CreateElementMap(action, axisContribution, val, val2); result = true; } } } return result; } private static string Describe(KeyboardMap map, int action) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_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_0037: 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: Expected I4, but got Unknown List list = Bindings(map, action); if (list.Count == 0) { return ""; } ActionElementMap m = list[0]; ModifierKeyFlags val = Modifiers(m); return ((object)Key(m)/*cast due to .constrained prefix*/).ToString() + (((int)val == 0) ? "" : (":" + (int)val)); } private static bool TryParse(string text, out KeyCode key, out ModifierKeyFlags mods) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown key = (KeyCode)0; mods = (ModifierKeyFlags)0; if (string.IsNullOrEmpty(text)) { return false; } string[] array = text.Split(':'); try { key = (KeyCode)(int)(KeyCode)Enum.Parse(typeof(KeyCode), array[0]); if (array.Length > 1) { mods = (ModifierKeyFlags)int.Parse(array[1]); } return (int)key != 0; } catch { return false; } } private unsafe static bool Assign(KeyboardMap map, int action, KeyCode key, ModifierKeyFlags mods, string why) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_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) foreach (ActionElementMap allMap in ((ControllerMap)map).AllMaps) { if (allMap.actionId != action && allMap.keyboardKeyCode == (KeyboardKeyCode)key && Modifiers(allMap) == mods) { Log("not assigning " + ((object)(*(KeyCode*)(&key))/*cast due to .constrained prefix*/).ToString() + " to action " + action + " (" + why + "): already used by action " + allMap.actionId + "; keeping " + Describe(map, action)); return false; } } List list = Bindings(map, action); if (list.Count == 1 && Key(list[0]) == key && Modifiers(list[0]) == mods && ExpectedId(map, action, key) == list[0].elementIdentifierId) { return false; } ((ControllerMap)map).DeleteElementMapsWithAction(action); ((ControllerMap)map).CreateElementMap(action, (Pole)0, key, mods); Log("action " + action + " -> " + ((object)(*(KeyCode*)(&key))/*cast due to .constrained prefix*/).ToString() + " (" + why + ")"); return true; } private static ConfigEntry Entry(UserProfile profile) { return ((BaseUnityPlugin)Plugin.instance).Config.Bind("Extra skill keys (managed automatically)", "Profile " + profile.fileName, "", "Extra skill 1 key last chosen in this RoR2 profile (Tobirama restores it if it is lost). Delete the line to give this profile X again."); } private static void Check(UserProfile profile) { //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) if (profile == null || profile.keyboardMap == null || string.IsNullOrEmpty(profile.fileName)) { return; } KeyboardMap keyboardMap = profile.keyboardMap; int slot = Slot; bool flag = Repair(keyboardMap, slot); if (checkedProfiles.Add(profile.fileName)) { ConfigEntry val = Entry(profile); if (Unchosen(keyboardMap, slot)) { if (TryParse(val.Value, out var key, out var mods)) { flag |= Assign(keyboardMap, slot, key, mods, "restoring this profile's own choice"); } else if (val.Value == "") { flag |= Assign(keyboardMap, slot, (KeyCode)120, (ModifierKeyFlags)0, "first launch default"); } } val.Value = Describe(keyboardMap, slot); Log("profile " + profile.fileName + " extra skill 1=" + Describe(keyboardMap, slot)); } if (flag) { profile.RequestEventualSave(); if (InputBindingDisplayController.onBindingsChanged != null) { InputBindingDisplayController.onBindingsChanged(); } } } private static void Remember(UserProfile profile) { if (profile != null && profile.keyboardMap != null && checkedProfiles.Contains(profile.fileName)) { KeyboardMap keyboardMap = profile.keyboardMap; if (Repair(keyboardMap, Slot)) { profile.RequestEventualSave(); } ConfigEntry val = Entry(profile); string text = Describe(keyboardMap, Slot); if (val.Value != text) { val.Value = text; Log("remembered profile " + profile.fileName + " extra skill 1 key " + text); } } } } public class RelayClone : NetworkBehaviour { private int meleeStep; private uint swing; private uint displayedSwing; private float meleeStarted; private float nextScan; private bool meleeCrit; private Vector3 meleeForward; private readonly HashSet meleeVictims = new HashSet(); public NetworkInstanceId ownerId; public CharacterBody owner; public uint generation; public uint cast; public float expires; public float started; public float speed = 1f; public Vector3 target; public byte phase; private Visual visual; private uint displayedCast; private uint lastReleased; private bool ending; private bool ready; public static int Mirrored; public static Vector3 LastOrigin; public static Vector3 LastTarget; public int MeleeStep => meleeStep; public uint Swing => swing; private void WriteMelee(NetworkWriter w) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) w.Write(meleeStep); w.Write(swing); w.Write(meleeStarted); w.Write(meleeForward); } private void ReadMelee(NetworkReader r) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) meleeStep = r.ReadInt32(); swing = r.ReadUInt32(); meleeStarted = r.ReadSingle(); meleeForward = r.ReadVector3(); } private void StopMelee() { meleeVictims.Clear(); meleeStep = 0; nextScan = 0f; } private HurtBox Nearby(int step) { //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_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_0031: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f8: 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_0115: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position + Vector3.up * MeleeTuning.OriginHeight[step].Value; HurtBox result = null; float num = float.PositiveInfinity; bool flag = false; Collider[] array = Physics.OverlapSphere(val, MeleeTuning.Reach[step].Value, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); foreach (Collider val2 in array) { HurtBox component = ((Component)val2).GetComponent(); if (!Kit.AttackTarget(owner, component)) { continue; } bool flag2 = Kit.Combatant(owner, component); if (!flag || flag2) { Vector3 val3 = val2.ClosestPoint(val); Vector3 val4 = val3 - val; Vector3 val5 = (Object.op_Implicit((Object)(object)component.healthComponent.body) ? component.healthComponent.body.corePosition : ((Component)component).transform.position); if (!(Mathf.Abs(val4.y) > MeleeTuning.Height.Value) && !Physics.CheckSphere(val, 0.035f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.Linecast(val, val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !Physics.Linecast(val, val5, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((flag2 && !flag) || ((Vector3)(ref val4)).sqrMagnitude < num)) { num = ((Vector3)(ref val4)).sqrMagnitude; result = component; flag = flag2; } } } return result; } private void StartMelee(HurtBox h) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_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_009a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(((Component)h).transform.position - ((Component)this).transform.position, Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude < 0.001f)) { meleeForward = ((Vector3)(ref val)).normalized; target = ((Component)this).transform.position + meleeForward * 3f; ((Component)this).transform.rotation = Util.QuaternionSafeLookRotation(meleeForward); speed = Mathf.Max(0.1f, owner.attackSpeed); meleeStarted = FixedTimeStamp.now.t; meleeVictims.Clear(); meleeCrit = owner.RollCrit(); phase = 3; swing++; ((NetworkBehaviour)this).SetDirtyBit(1u); } } private void FixedUpdate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !ready || ending) { return; } Bind(); if (!Object.op_Implicit((Object)(object)owner) || !owner.healthComponent.alive || !Object.op_Implicit((Object)(object)Run.instance) || FixedTimeStamp.now.t >= expires) { End(Object.op_Implicit((Object)(object)owner) && owner.healthComponent.alive); return; } float t = FixedTimeStamp.now.t; if (phase == 1 || phase == 2) { if (!(t - started >= 1.2f / speed)) { return; } phase = 0; ((NetworkBehaviour)this).SetDirtyBit(1u); } if (phase == 3) { float num = (t - meleeStarted) * speed; float value = MeleeTuning.Start[meleeStep].Value; float value2 = MeleeTuning.End[meleeStep].Value; if (num >= value && num - Time.fixedDeltaTime * speed <= value2) { MeleeContact.ResolveAt(owner, ((Component)this).transform.position, meleeForward, meleeStep, meleeVictims, meleeCrit, WaterRelay.MeleeDamage.Value, WaterRelay.MeleeProc.Value, ((Component)this).gameObject, hostileOnly: true, (DamageSource)8); } if (num < MeleeTuning.Durations[meleeStep]) { return; } meleeStep = (meleeStep + 1) % 3; phase = 0; ((NetworkBehaviour)this).SetDirtyBit(1u); } if (!(t < nextScan)) { nextScan = t + 0.1f; HurtBox val = Nearby(meleeStep); if (Object.op_Implicit((Object)(object)val)) { StartMelee(val); } else { meleeStep = 0; } } } private void DisplayMelee() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (displayedSwing != swing) { displayedSwing = swing; string text = ((meleeStep == 0) ? "Primary_01_Slash" : ((meleeStep == 1) ? "Primary_02_Kick" : "Primary_03_Heavy")); visual.Play(text, speed, 0f, restart: true, 0.035f); visual.player[text].time = Mathf.Max(0f, FixedTimeStamp.now.t - meleeStarted) * speed; } } public override bool OnSerialize(NetworkWriter w, bool initial) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) w.Write(ownerId); w.Write(generation); w.Write(expires); w.Write(((Component)this).transform.position); w.Write(target); w.Write(cast); w.Write(started); w.Write(speed); w.Write(phase); WriteMelee(w); return true; } public override void OnDeserialize(NetworkReader r, bool initial) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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) ownerId = r.ReadNetworkId(); generation = r.ReadUInt32(); expires = r.ReadSingle(); ((Component)this).transform.position = r.ReadVector3(); target = r.ReadVector3(); cast = r.ReadUInt32(); started = r.ReadSingle(); speed = r.ReadSingle(); phase = r.ReadByte(); ReadMelee(r); } private void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown visual = ((Component)this).GetComponentInChildren(); visual.reviewOverride = true; foreach (AnimationState item in ((Component)Plugin.body.GetComponent().modelTransform).GetComponentInChildren().player) { AnimationState val = item; visual.player.AddClip(val.clip, val.name); } visual.Play("Combat_Idle"); ready = true; Bind(); } private void Bind() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)owner)) { return; } GameObject val = (NetworkServer.active ? NetworkServer.FindLocalObject(ownerId) : ClientScene.FindLocalObject(ownerId)); if (!Object.op_Implicit((Object)(object)val)) { return; } owner = val.GetComponent(); if (!NetworkServer.active && Util.HasEffectiveAuthority(val)) { ((Component)owner).GetComponent()?.Pay(generation); } if (!NetworkServer.active) { RelayOwner component = ((Component)owner).GetComponent(); if (Object.op_Implicit((Object)(object)component) && (!Object.op_Implicit((Object)(object)component.clone) || component.clone.generation < generation)) { component.clone = this; } } } public void Begin(uint id, float rate, Vector3 aim) { //IL_001e: 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) if (!ending) { StopMelee(); cast = id; speed = rate; started = FixedTimeStamp.now.t; target = aim; phase = 1; ((NetworkBehaviour)this).SetDirtyBit(1u); } } public void CancelCast() { phase = 0; ((NetworkBehaviour)this).SetDirtyBit(1u); } public void MoveTo(Vector3 foot) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = foot; ((NetworkBehaviour)this).SetDirtyBit(1u); } public unsafe void Release(uint id, Vector3 aim, float damage, bool crit) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0161: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0215: 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_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_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) if (!ending && Object.op_Implicit((Object)(object)owner) && owner.healthComponent.alive && !(FixedTimeStamp.now.t >= expires) && cast == id && lastReleased != id) { lastReleased = id; target = aim; phase = 2; ((NetworkBehaviour)this).SetDirtyBit(1u); Vector3 val = ((Component)this).transform.position + Vector3.up * 1.2f; Vector3 val2 = target - val; Vector3 val3 = ((Vector3)(ref val2)).normalized; Vector3 val4 = (Object.op_Implicit((Object)(object)owner.inputBank) ? owner.inputBank.aimDirection : ((Component)this).transform.forward); val2 = target - val; if (((Vector3)(ref val2)).magnitude < 6f || Vector3.Dot(val3, val4) < 0.2f) { val3 = val4; target = val + val4 * 30f; } ProjectileManager.instance.FireProjectile(WaterRelay.dragon, val, Util.QuaternionSafeLookRotation(val3), ((Component)owner).gameObject, damage * WaterRelay.Damage.Value, 0f, crit, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); Mirrored++; LastOrigin = val; LastTarget = target; Vector3 val5 = Vector3.ProjectOnPlane(val3, Vector3.up); if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = Vector3.forward; } ((Vector3)(ref val5)).Normalize(); KitVfx.Emit(KitVfx.emerge, WaterDragonCast.SourcePoint(val, ((Component)this).transform.position, val5), 0.75f, null, null, Util.QuaternionSafeLookRotation(val5)); TobiAudio.Send(owner, 4, val); string[] obj = new string[8] { "RELAY_RELEASE cast=", id.ToString(), " origin=", null, null, null, null, null }; val2 = val; obj[3] = ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString(); obj[4] = " target="; val2 = target; obj[5] = ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString(); obj[6] = " damage="; obj[7] = (damage * WaterRelay.Damage.Value).ToString(); Kit.Log(string.Concat(obj)); } } private void Update() { //IL_007b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_014b: Unknown result type (might be due to invalid IL or missing references) if (!ready) { return; } Bind(); if (NetworkServer.active && (!Object.op_Implicit((Object)(object)owner) || !owner.healthComponent.alive || !Object.op_Implicit((Object)(object)Run.instance) || FixedTimeStamp.now.t >= expires)) { End(Object.op_Implicit((Object)(object)owner) && owner.healthComponent.alive); return; } Vector3 val = Vector3.ProjectOnPlane(target - ((Component)this).transform.position, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Util.QuaternionSafeLookRotation(val), 1f - Mathf.Exp((0f - Time.deltaTime) * 14f)); } if (phase > 0 && phase < 3 && displayedCast != cast) { displayedCast = cast; visual.Play("Water_Dragon", speed, 0f, restart: true, 0.06f); visual.player["Water_Dragon"].time = Mathf.Max(0f, FixedTimeStamp.now.t - started) * speed; } if (phase == 3) { DisplayMelee(); } else if (phase == 0) { visual.Play("Combat_Idle"); } } public void End(bool dissolve) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!ending) { StopMelee(); ending = true; if (dissolve && NetworkServer.active) { RelaySmoke.Emit(((Component)this).transform.position); } if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)((Component)owner).GetComponent()) && (Object)(object)((Component)owner).GetComponent().clone == (Object)(object)this) { ((Component)owner).GetComponent().clone = null; } if (NetworkServer.active) { NetworkServer.Destroy(((Component)this).gameObject); } } } } public class RelaySmoke : MonoBehaviour { private static GameObject prefab; private ParticleSystem ps; private float born; private bool emitted; private uint sound; public static Sprite Icon() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0051: 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) Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, File.ReadAllBytes(Path.Combine(Visual.Assets, "Icons", "ShadowClone.png"))); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } public static void Prepare() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0148: 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_015d: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_01fa: 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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Expected O, but got Unknown //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02db: 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_0301: 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_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) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0343: 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_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(256, 256, (TextureFormat)4, true); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)2; Color[] array = (Color[])(object)new Color[65536]; for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { float num = ((float)j - 127.5f) / 127.5f; float num2 = ((float)i - 127.5f) / 127.5f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.Clamp01((0.98f - num3) * 4f); float num5 = Mathf.PerlinNoise(num * 3f + 4f, num2 * 3f + 7f) * 0.45f + 0.55f; array[i * 256 + j] = new Color(0.84f, 0.87f, 0.89f, Mathf.Pow(num4, 2f) * Mathf.Clamp01(1f - num3 * num3) * num5); } } val.SetPixels(array); val.Apply(); Material val2 = new Material(KitVfx.glow); val2.mainTexture = (Texture)(object)val; val2.SetInt("_DstBlend", 10); val2.SetColor("_TintColor", Color.white); GameObject val3 = new GameObject("Shadow Clone smoke"); val3.SetActive(false); val3.AddComponent(); val3.AddComponent().DoNotPool = false; val3.AddComponent(); val3.AddComponent(); val3.AddComponent(); ParticleSystem val4 = val3.AddComponent(); val4.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val4.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).playOnAwake = false; ((MainModule)(ref main)).duration = 0.9f; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.55f, 0.9f); ((MainModule)(ref main)).startSize = new MinMaxCurve(1f, 1.65f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.6f, 2.2f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, 6.28f); ((MainModule)(ref main)).maxParticles = 64; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.83f, 0.86f, 0.89f, 0.8f)); EmissionModule emission = val4.emission; ((EmissionModule)(ref emission)).enabled = false; ShapeModule shape = val4.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(1.05f, 1.8f, 1.05f); ((ShapeModule)(ref shape)).position = Vector3.up * 1.05f; ColorOverLifetimeModule colorOverLifetime = val4.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val5 = new Gradient(); val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0.4f, 0f), new GradientAlphaKey(1f, 0.08f), new GradientAlphaKey(0.6f, 0.4f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val5); SizeOverLifetimeModule sizeOverLifetime = val4.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0.7f, 1f, 1.6f)); ((Renderer)((Component)val4).GetComponent()).sharedMaterial = val2; prefab = PrefabAPI.InstantiateClone(val3, "TobiramaShadowCloneSmoke", false); prefab.SetActive(true); Object.DestroyImmediate((Object)(object)val3); KitVfx.effects.Add(new EffectDef(prefab)); } public static void Emit(Vector3 foot) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) KitVfx.Emit(prefab, foot, 1f); } private void OnEnable() { born = Time.time; emitted = false; ps = ((Component)this).GetComponent(); } private void Update() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!emitted) { EffectComponent component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.effectData == null) { return; } emitted = true; born = Time.time; ps.Emit(60); AkSoundEngine.SetGameObjectOutputBusVolume(((Component)this).gameObject, (GameObject)null, Mathf.Clamp(TobiAudio.EffectLevel.Value, 0f, 2f)); sound = AkSoundEngine.PostEvent("Play_TBS0161_clone_smoke", ((Component)this).gameObject); Kit.Log("SHADOW_SMOKE sound=" + sound); } if (Time.time - born > 1.05f) { ps.Stop(true, (ParticleSystemStopBehavior)0); EffectManagerHelper component2 = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component2) && component2.OwningPool != null) { component2.ReturnToPool(); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void OnDisable() { if (sound != 0) { AkSoundEngine.StopPlayingID(sound, 30); } sound = 0u; } } public class ReliableWaterFlight : MonoBehaviour { private struct Carried { public CharacterBody body; public Vector3 offset; public float until; } public struct SlamRecord { public Vector3 point; public Vector3 center; public Vector3 dir; public float time; public string reason; } public const float PathRadius = 1.7f; public const float WorldRadius = 0.45f; public const float CarryMass = 260f; public const float CarrySeconds = 0.45f; public const float RangeDrop = 40f; private ProjectileController controller; private ProjectileDamage payload; private CharacterBody owner; private Vector3 direction; private Vector3 start; private float age; private bool resolved; private bool started; private int slides; private readonly HashSet hit = new HashSet(); private readonly List carried = new List(); private readonly Collider[] buffer = (Collider[])(object)new Collider[64]; public static int Spawned; public static int Detonated; public static int Cancelled; public const float FollowMaxAimUp = 0.21f; public const float SkimHeight = 1.1f; public const float FollowDepth = 45f; public const float FollowRate = 14f; public const float ClimbRate = 35f; public const float DescentRate = 28f; public const float LookAhead = 4f; private bool aimLow; private bool follow; private Vector3 flatDir; private float nextFlightLog; private CharacterBody slamTarget; public static readonly SlamRecord[] Slams = new SlamRecord[6]; private static int slamNext; public const float LargeMassFallback = 900f; private float PathCoefficient { get { if (!(KitTuning.WaterDamage.Value > 0f)) { return 0f; } return KitTuning.WaterPathDamage.Value / KitTuning.WaterDamage.Value; } } private void Start() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) controller = ((Component)this).GetComponent(); payload = ((Component)this).GetComponent(); direction = ((Component)this).transform.forward; aimLow = direction.y < 0.21f; flatDir = Vector3.ProjectOnPlane(direction, Vector3.up); if (((Vector3)(ref flatDir)).sqrMagnitude < 0.01f) { aimLow = false; } else { ((Vector3)(ref flatDir)).Normalize(); } if (NetworkServer.active) { Spawned++; } } public static bool RecentSlam(Vector3 near, float maxDist, out SlamRecord r) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) r = default(SlamRecord); float num = maxDist * maxDist; bool result = false; SlamRecord[] slams = Slams; for (int i = 0; i < slams.Length; i++) { SlamRecord slamRecord = slams[i]; if (slamRecord.reason != null && !(Time.time - slamRecord.time > 0.3f)) { Vector3 val = slamRecord.center - near; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; r = slamRecord; result = true; } } } return result; } private float Follow(ref Vector3 to, float dt) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) float num = float.NegativeInfinity; RaycastHit val = default(RaycastHit); if (Physics.Raycast(to + Vector3.up * 2.5f, Vector3.down, ref val, 47.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val)).point.y; } float num2 = num; if (Physics.Raycast(to + flatDir * 4f + Vector3.up * 2.5f, Vector3.down, ref val, 47.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val)).point.y > num) { num = ((RaycastHit)(ref val)).point.y; } if (float.IsNegativeInfinity(num)) { to.y -= 14f * dt; return -1f; } float num3 = num + 1.1f; float num4 = Mathf.Lerp(to.y, num3, 1f - Mathf.Exp((0f - dt) * 14f)); num4 = to.y + Mathf.Clamp(num4 - to.y, -28f * dt, 35f * dt); if (!float.IsNegativeInfinity(num2)) { num4 = Mathf.Max(num4, num2 + 0.6f); } to.y = num4; if (!float.IsNegativeInfinity(num2)) { return to.y - num2; } return -1f; } private bool World(Collider c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) & (1 << ((Component)c).gameObject.layer)) != 0; } public static bool IsLarge(CharacterBody b, out string why) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 why = "small"; if (!Object.op_Implicit((Object)(object)b)) { why = "nobody"; return false; } if (!Object.op_Implicit((Object)(object)b.master)) { why = "object"; return false; } if (b.isChampion) { why = "champion"; return true; } if ((int)b.hullClassification == 1 || (int)b.hullClassification == 2) { why = "hull_" + ((object)Unsafe.As(ref b.hullClassification)/*cast due to .constrained prefix*/).ToString(); return true; } if (Mass(b) >= 900f && Mass(b) < 9999f) { why = "mass"; return true; } why = "hull_" + ((object)Unsafe.As(ref b.hullClassification)/*cast due to .constrained prefix*/).ToString(); return false; } private void FixedUpdate() { //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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00fd: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: 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_0231: 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_023d: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_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_0425: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043c: 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_044b: 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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: 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_0286: 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_0289: 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_02af: 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_02e6: 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_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0307: 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_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_0a55: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0a6d: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0a72: Unknown result type (might be due to invalid IL or missing references) //IL_0a77: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: 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_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0642: 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_0ab7: Unknown result type (might be due to invalid IL or missing references) //IL_0ab9: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Unknown result type (might be due to invalid IL or missing references) //IL_0ae2: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0654: 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_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_0b17: Unknown result type (might be due to invalid IL or missing references) //IL_0b1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b21: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b0a: Unknown result type (might be due to invalid IL or missing references) //IL_0b0f: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_08a5: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09c3: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0a02: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || resolved) { return; } float fixedDeltaTime = Time.fixedDeltaTime; age += fixedDeltaTime; if (!started) { started = true; start = ((Component)this).transform.position; } if (!Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.owner)) { owner = controller.owner.GetComponent(); } if (!Object.op_Implicit((Object)(object)owner)) { if (age > 0.25f) { Cancel(); } return; } if (!owner.healthComponent.alive) { Cancel(); return; } Vector3 val = ((Component)this).transform.position; if (aimLow) { RaycastHit val2 = default(RaycastHit); bool flag = Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val2, 45.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); if (!follow && flag && (direction.y >= -0.05f || val.y - ((RaycastHit)(ref val2)).point.y <= 1.6f)) { follow = true; } if (follow) { Vector3 val3 = direction - flatDir; if (((Vector3)(ref val3)).sqrMagnitude > 1E-06f) { direction = flatDir; ((Component)this).transform.rotation = Util.QuaternionSafeLookRotation(direction); } } } float num = Mathf.Max(0.05f, KitTuning.WaterLife.Value); float num2 = Mathf.Max(0f, KitTuning.WaterSpeed.Value) * Mathf.Min(fixedDeltaTime, Mathf.Max(0f, num - age + fixedDeltaTime)); RaycastHit val4 = default(RaycastHit); bool flag2 = Physics.SphereCast(val, 0.45f, direction, ref val4, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); if (flag2 && ((RaycastHit)(ref val4)).normal.y > 0.55f && slides < 120) { Vector3 val5 = Vector3.ProjectOnPlane(direction, ((RaycastHit)(ref val4)).normal); if (((Vector3)(ref val5)).sqrMagnitude > 0.04f) { slides++; direction = ((Vector3)(ref val5)).normalized; ((Component)this).transform.rotation = Util.QuaternionSafeLookRotation(direction); Vector3 val6 = val; RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 1.5f, Vector3.down, ref val7, 6f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val6 = ((RaycastHit)(ref val7)).point + Vector3.up * 1.1f; } flag2 = Physics.SphereCast(val6, 0.45f, direction, ref val4, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val4)).normal.y <= 0.55f; val = val6; } } float num3 = (flag2 ? Mathf.Max(0f, ((RaycastHit)(ref val4)).distance - 0.05f) : num2); Vector3 to = val + direction * num3; if (follow && !flag2) { float num4 = Follow(ref to, fixedDeltaTime); if (KitTuning.Verbose != null && KitTuning.Verbose.Value && age >= nextFlightLog) { nextFlightLog = age + 0.1f; Kit.Log("WATER_FLIGHT age=" + age.ToString("0.00") + " follow=1 height=" + num4.ToString("0.00") + " y=" + to.y.ToString("0.0") + " slides=" + slides); } } int num5 = Physics.OverlapCapsuleNonAlloc(val - Vector3.up * 0.7f, to - Vector3.up * 0.7f, 1.7f, buffer, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); CharacterBody val8 = null; string text = ""; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (num5 >= buffer.Length) { break; } if (!Object.op_Implicit((Object)(object)readOnlyInstances) || !Object.op_Implicit((Object)(object)readOnlyInstances.mainHurtBox) || !Object.op_Implicit((Object)(object)readOnlyInstances.healthComponent) || hit.Contains(readOnlyInstances.healthComponent)) { continue; } Vector3 val9 = to - val; float num6 = ((((Vector3)(ref val9)).sqrMagnitude > 0.0001f) ? Mathf.Clamp01(Vector3.Dot(readOnlyInstances.corePosition - val, val9) / ((Vector3)(ref val9)).sqrMagnitude) : 0f); Vector3 val10 = readOnlyInstances.corePosition - (val + val9 * num6); float y = val10.y; val10.y = 0f; if (((Vector3)(ref val10)).magnitude <= 1.7f + readOnlyInstances.radius && y > -3.5f && y < 2.5f) { Collider component = ((Component)readOnlyInstances.mainHurtBox).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Array.IndexOf(buffer, component, 0, num5) < 0) { buffer[num5++] = component; } } } for (int i = 0; i < num5; i++) { HurtBox component2 = ((Component)buffer[i]).GetComponent(); if (!Kit.AttackTarget(owner, component2) || hit.Contains(component2.healthComponent)) { continue; } CharacterBody body = component2.healthComponent.body; Vector3 val11; if (!Object.op_Implicit((Object)(object)body)) { Bounds bounds = buffer[i].bounds; val11 = ((Bounds)(ref bounds)).center; } else { val11 = body.corePosition; } Vector3 c = val11; c = Surface(c); if (Physics.Linecast(val, c, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && Physics.Linecast(to, c, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && Physics.Linecast(c + Vector3.up * 1.5f, c, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { continue; } hit.Add(component2.healthComponent); string why; bool flag3 = IsLarge(body, out why); float num7 = Mass(body); bool flag4 = Object.op_Implicit((Object)(object)body) && (flag3 || num7 >= 260f); Vector3 force = direction * (float)(flag4 ? 2600 : 1600) + Vector3.up * (float)(flag4 ? 300 : 500); float combinedHealth = component2.healthComponent.combinedHealth; Kit.Damage(owner, component2.healthComponent, payload.damage * PathCoefficient, controller.procCoefficient, buffer[i].ClosestPoint(val), payload.crit, "WATER_PATH", force, (DamageType)32, (DamageSource)(((Object)this).name.StartsWith("TobiramaRelayDragon") ? 8 : 2)); Kit.Log("DRAGON_TOUCH body=" + (Object.op_Implicit((Object)(object)body) ? ((Object)body).name.Replace("(Clone)", "") : ((Object)component2.healthComponent).name) + " class=" + (flag3 ? "large" : "small") + " why=" + why + " hull=" + (Object.op_Implicit((Object)(object)body) ? ((object)Unsafe.As(ref body.hullClassification)/*cast due to .constrained prefix*/).ToString() : "?") + " mass=" + num7.ToString("0") + " champion=" + (Object.op_Implicit((Object)(object)body) && body.isChampion) + " team=" + ((object)component2.teamIndex/*cast due to .constrained prefix*/).ToString() + " damage=" + (payload.damage * PathCoefficient).ToString("0.#") + " loss=" + (combinedHealth - (Object.op_Implicit((Object)(object)component2.healthComponent) ? component2.healthComponent.combinedHealth : 0f)).ToString("0.#") + " dist=" + Vector3.Distance(start, to).ToString("0.0")); if (flag3) { if (!Object.op_Implicit((Object)(object)val8)) { val8 = body; text = why; } } else if (Object.op_Implicit((Object)(object)body) && !flag4 && Util.HasEffectiveAuthority(((Component)body).gameObject) && (Object.op_Implicit((Object)(object)body.characterMotor) || Object.op_Implicit((Object)(object)body.rigidbody))) { Vector3 val12 = body.transform.position - to; val12 = Vector3.ProjectOnPlane(val12, direction); val12 = Vector3.ClampMagnitude(val12, 1.1f); carried.Add(new Carried { body = body, offset = val12, until = age + 0.45f }); } } ((Component)this).transform.position = to; Carry(to); if (Object.op_Implicit((Object)(object)val8)) { Vector3 corePosition = val8.corePosition; ((Component)this).transform.position = corePosition; slamTarget = val8; Detonate(corePosition, corePosition, -direction, "large:" + text); } else if (flag2) { Detonate(to, ((RaycastHit)(ref val4)).point, ((RaycastHit)(ref val4)).normal, "wall"); } else if (age >= num) { Vector3 val13 = to; RaycastHit val14 = default(RaycastHit); if (Physics.Raycast(to + Vector3.up * 0.5f, Vector3.down, ref val14, 40f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val13 = ((RaycastHit)(ref val14)).point + Vector3.up * 0.5f; } ((Component)this).transform.position = val13; Detonate(val13, val13, Vector3.up, "range"); } } private static Vector3 Surface(Vector3 c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(c + Vector3.up * 3f, Vector3.down, ref val, 3.2f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && ((RaycastHit)(ref val)).point.y > c.y - 0.05f) { return ((RaycastHit)(ref val)).point + Vector3.up * 0.5f; } return c; } private static float Mass(CharacterBody b) { if (!Object.op_Implicit((Object)(object)b)) { return 9999f; } if (Object.op_Implicit((Object)(object)b.characterMotor)) { return b.characterMotor.mass; } if (Object.op_Implicit((Object)(object)b.rigidbody)) { return b.rigidbody.mass; } return 9999f; } private void Carry(Vector3 at) { //IL_008a: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_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_012e: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0174: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) for (int num = this.carried.Count - 1; num >= 0; num--) { Carried carried = this.carried[num]; if (!Object.op_Implicit((Object)(object)carried.body) || !Object.op_Implicit((Object)(object)carried.body.healthComponent) || !carried.body.healthComponent.alive || age > carried.until) { if (Object.op_Implicit((Object)(object)carried.body) && Object.op_Implicit((Object)(object)carried.body.characterMotor)) { carried.body.characterMotor.velocity = direction * 8f + Vector3.up * 4f; } this.carried.RemoveAt(num); } else { Vector3 val = at + carried.offset; Vector3 velocity = direction * KitTuning.WaterSpeed.Value; if (Object.op_Implicit((Object)(object)carried.body.characterMotor)) { CharacterMotor characterMotor = carried.body.characterMotor; Vector3 val2 = val - (carried.body.corePosition - carried.body.transform.position); if (!Physics.CheckSphere(val2 + Vector3.up * 0.6f, 0.3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { ((BaseCharacterController)characterMotor).Motor.SetPosition(val2, true); } characterMotor.velocity = velocity; } else if (Object.op_Implicit((Object)(object)carried.body.rigidbody) && !carried.body.rigidbody.isKinematic) { carried.body.rigidbody.MovePosition(val); carried.body.rigidbody.velocity = velocity; } } } } public void Cancel() { if (!resolved) { resolved = true; Cancelled++; if (NetworkServer.active) { NetworkServer.Destroy(((Component)this).gameObject); } } } private unsafe void Detonate(Vector3 center, Vector3 visualPoint, Vector3 normal, string reason) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_020b: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_02e7: 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_0273: 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_0277: 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_028b: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_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_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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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_0350: 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_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: 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_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0642: 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_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_03d5: 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_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) if (resolved || !NetworkServer.active) { return; } resolved = true; Detonated++; carried.Clear(); HashSet hashSet = new HashSet(); float value = KitTuning.WaterRadius.Value; Vector3 val = center + normal * 0.3f; Collider[] array = Physics.OverlapSphere(val, value, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); Vector3 val6; foreach (Collider val2 in array) { if (!Object.op_Implicit((Object)(object)val2)) { continue; } HurtBox component = ((Component)val2).GetComponent(); if (Kit.AttackTarget(owner, component) && !hashSet.Contains(component.healthComponent)) { Vector3 val3 = val2.ClosestPoint(val); Vector3 val4; if (!Object.op_Implicit((Object)(object)component.healthComponent.body)) { Bounds bounds = val2.bounds; val4 = ((Bounds)(ref bounds)).center; } else { val4 = component.healthComponent.body.corePosition; } Vector3 val5 = val4; if (!Physics.Linecast(val, val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) || !Physics.Linecast(val, val5, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { hashSet.Add(component.healthComponent); val6 = Vector3.ProjectOnPlane(val5 - val, Vector3.up); Vector3 force = ((Vector3)(ref val6)).normalized * 700f + Vector3.up * 1700f; float num = Marks.Consume(component.healthComponent, "water"); Kit.Damage(owner, component.healthComponent, payload.damage * num, controller.procCoefficient, val3, payload.crit, "WATER_BURST" + ((num > 1f) ? "_MARKED" : ""), force, (DamageType)0, (DamageSource)(((Object)this).name.StartsWith("TobiramaRelayDragon") ? 8 : 2)); } } } Vector3 val7 = visualPoint; RaycastHit val8 = default(RaycastHit); if (Physics.Raycast(center + Vector3.up * 0.5f, Vector3.down, ref val8, (float)(reason.StartsWith("large") ? 16 : 4), LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val7 = ((RaycastHit)(ref val8)).point; } if (Object.op_Implicit((Object)(object)slamTarget)) { Vector3 footPosition = slamTarget.footPosition; RaycastHit val9 = default(RaycastHit); val7 = (Physics.Raycast(footPosition + Vector3.up * 1.5f, Vector3.down, ref val9, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val9)).point : footPosition); } GameObject splash = KitVfx.splash; Vector3 p = val7; float scale = value; val6 = Vector3.ProjectOnPlane(direction, Vector3.up); KitVfx.Emit(splash, p, scale, null, null, Util.QuaternionSafeLookRotation((((Vector3)(ref val6)).sqrMagnitude > 0.01f) ? Vector3.ProjectOnPlane(direction, Vector3.up) : Vector3.forward)); Kit.WaterImpacted?.Invoke(owner, val7); Slams[slamNext] = new SlamRecord { point = val7, center = center, dir = Vector3.ProjectOnPlane(direction, Vector3.up), time = Time.time, reason = reason }; slamNext = (slamNext + 1) % Slams.Length; string text = ""; if (Object.op_Implicit((Object)(object)slamTarget)) { HealthComponent healthComponent = slamTarget.healthComponent; Vector3 footPosition2 = slamTarget.footPosition; Vector3 val10 = val7 - footPosition2; val10.y = 0f; text = " target=" + ((Object)slamTarget).name.Replace("(Clone)", "") + " targetBurstHit=" + (Object.op_Implicit((Object)(object)healthComponent) && hashSet.Contains(healthComponent)) + " fxToTargetFeet=" + ((Vector3)(ref val10)).magnitude.ToString("0.00") + " coreToBurst=" + Vector3.Distance(slamTarget.corePosition, val).ToString("0.00") + " radius=" + value.ToString("0.0"); } Vector3 val11 = center - start; val11.y = 0f; string[] obj = new string[27] { "WATER_DETONATE reason=", reason, text, " fx=", ((Vector3)(ref val7)).ToString("F1"), " follow=", (follow ? 1 : 0).ToString(), " range=", Vector3.Distance(start, center).ToString("0.0"), " flatRange=", ((Vector3)(ref val11)).magnitude.ToString("0.0"), " age=", age.ToString("0.00"), " speed=", KitTuning.WaterSpeed.Value.ToString(), " life=", KitTuning.WaterLife.Value.ToString(), " pathHits=", hit.Count.ToString(), " burstHits=", hashSet.Count.ToString(), " burst=", payload.damage.ToString(), " path=", (payload.damage * PathCoefficient).ToString(), " at=", null }; val6 = center; obj[26] = ((object)(*(Vector3*)(&val6))/*cast due to .constrained prefix*/).ToString(); Kit.Log(string.Concat(obj)); NetworkServer.Destroy(((Component)this).gameObject); } } public sealed class SelectionVoice : MonoBehaviour { private readonly Dictionary choices = new Dictionary(); private GameObject emitter; private uint playing; private NetworkUser pending; private float pendingAt; public static int Plays; public static uint LastLanguage; public static uint LastPlayingID; private void Update() { //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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0118: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)PreGameController.instance)) { choices.Clear(); pending = null; Stop(); return; } foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (!Object.op_Implicit((Object)(object)readOnlyInstances) || !((NetworkBehaviour)readOnlyInstances).isLocalPlayer) { continue; } BodyIndex bodyIndexPreference = readOnlyInstances.bodyIndexPreference; if (!choices.TryGetValue(readOnlyInstances, out var value) || value != bodyIndexPreference) { choices[readOnlyInstances] = bodyIndexPreference; Stop(); pending = null; if (bodyIndexPreference == BodyCatalog.FindBodyIndex("HenryTobiramaBody")) { pending = readOnlyInstances; pendingAt = Time.unscaledTime + 0.18f; } } } if (Object.op_Implicit((Object)(object)pending) && Time.unscaledTime >= pendingAt) { NetworkUser val = pending; pending = null; if (val.bodyIndexPreference == BodyCatalog.FindBodyIndex("HenryTobiramaBody")) { Loadout val2 = new Loadout(); val.networkLoadout.CopyLoadout(val2); uint skinIndex = val2.bodyLoadoutManager.GetSkinIndex(val.bodyIndexPreference); bool flag = VoiceLoadout.Get(val2, val.bodyIndexPreference) == VoiceLoadout.Lang.Japanese; Stop(); emitter = new GameObject("Tobirama selection-only voice"); emitter.AddComponent(); AkSoundEngine.SetGameObjectOutputBusVolume(emitter, (GameObject)null, Mathf.Clamp(TobiAudio.VoiceLevel.Value, 0f, 2f)); playing = AkSoundEngine.PostEvent(flag ? "Play_TBI01_jp_selection_local" : "Play_TBI01_en_selection_local", emitter); LastPlayingID = playing; LastLanguage = (flag ? 1u : 0u); Plays++; Object.Destroy((Object)(object)emitter, 8f); Kit.Log("SELECTION_VOICE skin=" + skinIndex + " voice=" + (flag ? "JP" : "EN") + " id=" + playing + " count=" + Plays); } } } private void Stop() { if (playing != 0) { AkSoundEngine.StopPlayingID(playing, 70); } playing = 0u; if (Object.op_Implicit((Object)(object)emitter)) { Object.Destroy((Object)(object)emitter, 0.08f); } emitter = null; } private void OnDestroy() { Stop(); } } public static class ShinobiLanding { public static float LastInput; public static float LastApplied; public static float LastLoss; public static int Hits; public static void Init() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(Reduce); } private static void Reduce(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 bool flag = NetworkServer.active && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)((Component)self.body).GetComponent()) && (int)DamageTypeCombo.op_Implicit(info.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) > 0; float damage = info.damage; float health = self.health; if (flag) { LastInput = damage; info.damage *= 0.5f; LastApplied = info.damage; Hits++; } try { orig.Invoke(self, info); } finally { if (flag) { LastLoss = health - self.health; Kit.Log("FALL_DAMAGE input=" + damage + " applied=" + LastApplied + " loss=" + LastLoss); info.damage = damage; } } } } public static class SkinVoiceMigration13 { private const string BodyName = "HenryTobiramaBody"; private static string ListFile => Path.Combine(Paths.ConfigPath, "Shedurr.Tobirama.SkinVoiceMigrated.txt"); public static void Install() { LocalUserManager.onUserSignIn += delegate(LocalUser u) { try { Migrate((u != null) ? u.userProfile : null); } catch (Exception ex) { Plugin.instance.Log.LogError((object)("TOBIRAMA_SKINVOICE_MIGRATION " + ex)); } }; } private static string RawProfile(UserProfile profile) { try { MemberInfo memberInfo = (MemberInfo)(((object)typeof(RoR2Application).GetField("cloudStorage", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) ?? ((object)typeof(RoR2Application).GetProperty("cloudStorage", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))); object obj = ((memberInfo is FieldInfo fieldInfo) ? fieldInfo.GetValue(null) : ((memberInfo is PropertyInfo propertyInfo) ? propertyInfo.GetValue(null) : null)); if (obj == null) { return null; } Type type = obj.GetType().Assembly.GetType("Zio.UPath") ?? Type.GetType("Zio.UPath, Zio"); if (type == null) { return null; } object obj2 = Activator.CreateInstance(type, "/UserProfiles/" + profile.fileName + ".xml"); MethodInfo method = obj.GetType().GetMethod("OpenFile", new Type[4] { type, typeof(FileMode), typeof(FileAccess), typeof(FileShare) }); if (method == null) { return null; } using Stream stream = (Stream)method.Invoke(obj, new object[4] { obj2, FileMode.Open, FileAccess.Read, FileShare.ReadWrite }); using StreamReader streamReader = new StreamReader(stream); return streamReader.ReadToEnd(); } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_SKINVOICE_MIGRATION raw profile read failed: " + ex.Message)); return null; } } public static void Migrate(UserProfile profile) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0118: 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_0136: Unknown result type (might be due to invalid IL or missing references) if (profile == null || string.IsNullOrEmpty(profile.fileName)) { return; } BodyIndex val = BodyCatalog.FindBodyIndex("HenryTobiramaBody"); int num = VoiceLoadout.SlotIndex(val); if ((int)val == -1 || num < 0) { return; } string text = RawProfile(profile); if (text == null) { Plugin.instance.Log.LogWarning((object)("TOBIRAMA_SKINVOICE_MIGRATION profile=" + profile.fileName + " save not readable; retry next sign-in")); return; } Match match = Regex.Match(text, "(.*?)", RegexOptions.Singleline); string text2; if (!match.Success) { text2 = "no saved Tobirama loadout (defaults)"; } else if (match.Groups[1].Value.Contains("skillFamily=\"HenryTobiramaBodyVoiceLoadoutFamily\"")) { text2 = "already has a Voices choice (0.25.0+ save)"; } else { Match match2 = Regex.Match(match.Groups[1].Value, "(\\d+)"); int num2 = (match2.Success ? int.Parse(match2.Groups[1].Value) : 0); uint num3 = ((num2 >= 2) ? 1u : 0u); bool flag = num2 % 2 == 1; uint num4 = ((!flag) ? 1u : 0u); Loadout val2 = new Loadout(); profile.CopyLoadout(val2); uint skinIndex = val2.bodyLoadoutManager.GetSkinIndex(val); val2.bodyLoadoutManager.SetSkinIndex(val, num3); val2.bodyLoadoutManager.SetSkillVariant(val, num, num4); profile.SetLoadout(val2); text2 = "oldSkin=" + num2 + " (loaded as " + skinIndex + ") -> skin " + num3 + " + Voices " + (flag ? "Japanese" : "English"); try { File.AppendAllText(ListFile, profile.fileName + " " + DateTime.Now.ToString("s") + " " + text2 + Environment.NewLine); } catch { } } Plugin.instance.Log.LogInfo((object)("TOBIRAMA_SKINVOICE_MIGRATION profile=" + profile.fileName + " " + text2)); } } [Serializable] public class StormMeshData { public StormMeshEntry[] meshes; } [Serializable] public class StormMeshEntry { public string name; public float[] v; public float[] uv; public float[] size; public int[] tri; } public static class StormFx { private static readonly Dictionary textures = new Dictionary(); private static readonly Dictionary meshes = new Dictionary(); public static Mesh sphere; public static Mesh ring; public static Mesh quad; public static Texture2D soft; public static Texture2D scorch; private static readonly MaterialPropertyBlock block = new MaterialPropertyBlock(); public static Texture2D Tex(string path, TextureWrapMode wrap = (TextureWrapMode)0) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (textures.TryGetValue(path, out var value)) { return value; } value = new Texture2D(2, 2, (TextureFormat)4, true); string path2 = Path.Combine(Visual.Assets, path); if (File.Exists(path2)) { ImageConversion.LoadImage(value, File.ReadAllBytes(path2)); } else { Plugin.instance.Log.LogWarning((object)("Missing texture " + path)); } ((Texture)value).wrapMode = wrap; ((Texture)value).filterMode = (FilterMode)1; ((Object)value).name = path; textures[path] = value; return value; } public static Material Mat(Texture tex, bool additive, Color tint, float boost = 1f, int queue = 3001) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown Material val = new Material(KitVfx.glow) { mainTexture = tex }; val.SetColor("_TintColor", tint); val.SetInt("_SrcBlend", 5); val.SetInt("_DstBlend", additive ? 1 : 10); val.SetFloat("_Boost", boost); val.renderQueue = queue; return val; } public static Mesh Storm(string name) { meshes.TryGetValue(name, out var value); return value; } public static void Prepare() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //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_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_0216: 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_0228: 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_0257: 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: Expected O, but got Unknown //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Expected O, but got Unknown //IL_03d9: Unknown result type (might be due to invalid IL or missing references) StormMeshData stormMeshData; using (FileStream stream = File.OpenRead(Path.Combine(Visual.Assets, "StormWater.json"))) { stormMeshData = (StormMeshData)new DataContractJsonSerializer(typeof(StormMeshData)).ReadObject(stream); } StormMeshEntry[] array = stormMeshData.meshes; foreach (StormMeshEntry stormMeshEntry in array) { Mesh val = new Mesh(); ((Object)val).name = "Storm " + stormMeshEntry.name; Vector3[] array2 = (Vector3[])(object)new Vector3[stormMeshEntry.v.Length / 3]; Vector2[] array3 = (Vector2[])(object)new Vector2[array2.Length]; for (int j = 0; j < array2.Length; j++) { array2[j] = new Vector3(stormMeshEntry.v[3 * j], stormMeshEntry.v[3 * j + 1], stormMeshEntry.v[3 * j + 2]); array3[j] = new Vector2(stormMeshEntry.uv[2 * j], stormMeshEntry.uv[2 * j + 1]); } val.vertices = array2; val.uv = array3; val.triangles = stormMeshEntry.tri; White(val); val.RecalculateNormals(); val.RecalculateBounds(); meshes[stormMeshEntry.name] = val; } GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); sphere = Object.Instantiate(obj.GetComponent().sharedMesh); White(sphere); Object.DestroyImmediate((Object)(object)obj); GameObject obj2 = GameObject.CreatePrimitive((PrimitiveType)5); quad = Object.Instantiate(obj2.GetComponent().sharedMesh); White(quad); Object.DestroyImmediate((Object)(object)obj2); ring = new Mesh(); ((Object)ring).name = "Tobirama shock ring"; List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val2 = default(Vector3); for (int k = 0; k <= 48; k++) { float num = (float)k * MathF.PI * 2f / 48f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); list.Add(val2 * 0.72f); list.Add(val2); list2.Add(new Vector2((float)k / 12f, 0f)); list2.Add(new Vector2((float)k / 12f, 1f)); if (k < 48) { int num2 = k * 2; list3.AddRange(new int[6] { num2, num2 + 1, num2 + 2, num2 + 1, num2 + 3, num2 + 2 }); } } ring.SetVertices(list); ring.SetUVs(0, list2); ring.SetTriangles(list3, 0); White(ring); ring.RecalculateNormals(); ring.RecalculateBounds(); soft = (Texture2D)KitVfx.glow.mainTexture; scorch = new Texture2D(64, 64, (TextureFormat)4, true); for (int l = 0; l < 64; l++) { for (int m = 0; m < 64; m++) { float num3 = ((float)m - 31.5f) / 31.5f; float num4 = ((float)l - 31.5f) / 31.5f; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.PerlinNoise((float)m * 0.13f, (float)l * 0.13f); float num7 = Mathf.Clamp01((1f - num5) * 1.5f - 0.05f + (num6 - 0.5f) * 0.7f); num7 = num7 * num7 * (3f - 2f * num7); scorch.SetPixel(m, l, new Color(0.2f + 0.06f * num6, 0.17f + 0.04f * num6, 0.14f, num7)); } } ((Texture)scorch).wrapMode = (TextureWrapMode)1; scorch.Apply(); } public static void White(Mesh m) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Color32[] array = (Color32[])(object)new Color32[m.vertexCount]; for (int i = 0; i < array.Length; i++) { array[i] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } m.colors32 = array; } public static ParticleSystem System(GameObject root, string name, Material mat, int max, float gravity, bool stretch, float drag = 0f) { //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_0018: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(root.transform, false); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).playOnAwake = false; ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).maxParticles = max; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(gravity); ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).enabled = false; ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).enabled = false; ParticleSystemRenderer component = val.GetComponent(); ((Renderer)component).sharedMaterial = mat; if (stretch) { component.renderMode = (ParticleSystemRenderMode)1; component.lengthScale = 1.5f; component.velocityScale = 0.08f; } if (drag > 0f) { LimitVelocityOverLifetimeModule limitVelocityOverLifetime = val2.limitVelocityOverLifetime; ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).enabled = true; ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).drag = MinMaxCurve.op_Implicit(drag); ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).multiplyDragByParticleSize = false; ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).multiplyDragByParticleVelocity = true; } return val2; } public static void Fade(ParticleSystem ps, Color a, Color b, float alpha0, float alpha1, float grow) { //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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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_0089: 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_0099: 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_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_00e4: Unknown result type (might be due to invalid IL or missing references) ColorOverLifetimeModule colorOverLifetime = ps.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(alpha0, 0f), new GradientAlphaKey(alpha1, 0.35f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val); SizeOverLifetimeModule sizeOverLifetime = ps.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.EaseInOut(0f, 1f, 1f, grow)); RotationOverLifetimeModule rotationOverLifetime = ps.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(-0.8f, 0.8f); } public static void Emit(ParticleSystem ps, Vector3 p, Vector3 v, float size, float life, Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) EmitParams val = default(EmitParams); ((EmitParams)(ref val)).position = p; ((EmitParams)(ref val)).velocity = v; ((EmitParams)(ref val)).startSize = size; ((EmitParams)(ref val)).startLifetime = life; ((EmitParams)(ref val)).startColor = Color32.op_Implicit(c); ((EmitParams)(ref val)).rotation = Random.Range(0f, 360f); ((EmitParams)(ref val)).applyShapeToPosition = false; EmitParams val2 = val; ps.Emit(val2, 1); } public static MeshRenderer Part(GameObject root, string name, Mesh mesh, 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_0018: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(root.transform, false); val.AddComponent().sharedMesh = mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = mat; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } public static void Tint(Renderer r, Color c) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) r.GetPropertyBlock(block); block.SetColor("_TintColor", c); r.SetPropertyBlock(block); } public static void Scroll(Renderer r, Vector2 offset, Vector2 scale) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) r.GetPropertyBlock(block); block.SetVector("_MainTex_ST", new Vector4(scale.x, scale.y, offset.x, offset.y)); r.SetPropertyBlock(block); } public static float Ease(float t) { t = Mathf.Clamp01(t); return 1f - (1f - t) * (1f - t) * (1f - t); } } public static class WaterLook { public static Material body; public static Material shell; public static Material foam; public static Material sheet; public static Material sheetAdd; public static Material spray; public static Material mist; public static Material decal; public static Material decalAdd; public static Material ringMat; public static Material droplet; public static Material head; public static void Prepare() { //IL_0020: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_0242: 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) body = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd07.png", (TextureWrapMode)0), additive: false, new Color(0.5f, 0.8f, 1f, 0.68f), 1.15f, 3002); shell = StormFx.Mat((Texture)(object)StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0), additive: true, new Color(0.55f, 0.9f, 1f, 0.85f), 1.6f, 3003); foam = StormFx.Mat((Texture)(object)StormFx.Tex("Water/sjh_wtr04.png", (TextureWrapMode)0), additive: false, new Color(0.85f, 0.97f, 1f, 0.9f), 1.3f, 3003); sheet = StormFx.Mat((Texture)(object)StormFx.Tex("Water/sjh_wtr05.png", (TextureWrapMode)0), additive: false, new Color(0.7f, 0.92f, 1f, 0.85f), 1.2f, 3002); sheetAdd = StormFx.Mat((Texture)(object)StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0), additive: true, new Color(0.6f, 0.9f, 1f, 0.7f), 1.4f, 3003); spray = StormFx.Mat((Texture)(object)StormFx.soft, additive: false, new Color(0.88f, 0.97f, 1f, 0.95f), 1.3f, 3004); mist = StormFx.Mat((Texture)(object)StormFx.soft, additive: false, new Color(0.75f, 0.92f, 1f, 0.22f), 1f, 3004); decal = StormFx.Mat((Texture)(object)StormFx.soft, additive: false, new Color(0.05f, 0.16f, 0.22f, 0.55f), 1f, 2999); decalAdd = StormFx.Mat((Texture)(object)StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0), additive: true, new Color(0.35f, 0.7f, 0.85f, 0.5f), 1.2f, 3000); ringMat = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd01.png", (TextureWrapMode)0), additive: false, new Color(0.85f, 0.97f, 1f, 0.9f), 1.3f, 3003); droplet = StormFx.Mat((Texture)(object)StormFx.soft, additive: false, new Color(0.55f, 0.82f, 1f, 0.55f), 1.2f, 3004); head = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd07.png", (TextureWrapMode)0), additive: false, new Color(0.55f, 0.84f, 1f, 0.93f), 1.2f, 3003); } } [Serializable] public class StormDrive { public string bone; public string driver; public float[] k; } [Serializable] public class StormTwist { public string bone; public string parent; public string child; public float f; } [Serializable] public class StormData { public BoneData[] bones; public MeshData[] meshes; public StormDrive[] drive; public StormTwist[] twist; public float[] pelvisOffset; } public class StormFollow : MonoBehaviour { private static StormData data; public const int FirstStormSkin = 1; public Transform[] driven; public Transform[] drivers; public Quaternion[] k; public Transform[] twistBone; public Transform[] twistParent; public Transform[] twistChild; public Quaternion[] twistRest; public Vector3[] twistAxis; public float[] twistF; public Transform pelvis; public Transform hip; public Vector3 pelvisOffset; public GameObject[] purchasedParts; public GameObject[] stormParts; public int shown; public static float InkWidth = 0.003f; public static Color FaceTint = new Color(1f, 0.86f, 0.77f); private static Material inkMat; private CharacterBody body; private ModelSkinController msc; private RelayClone relay; private SurvivorMannequinSlotController slot; private bool looked; private static FieldInfo loadoutField = typeof(SurvivorMannequinSlotController).GetField("currentLoadout", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); public static bool IsStorm(int skin) { return skin >= 1; } private static Vector3 V(float[] a) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return new Vector3(a[0], a[1], a[2]); } private static Quaternion Q(float[] a) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(a[0], a[1], a[2], a[3]); } public static void Attach(Visual v, Transform root, List infos, List purchased) { //IL_0091: 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_013f: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_025c: 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_0292: 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_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_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_0618: 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_0640: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Expected O, but got Unknown //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Expected O, but got Unknown Stopwatch stopwatch = Stopwatch.StartNew(); if (data == null) { data = JsonUtility.FromJson(File.ReadAllText(Path.Combine(Visual.Assets, "StormSkin.json"))); } StormFollow stormFollow = ((Component)root).gameObject.AddComponent(); Transform[] bones = (Transform[])(object)new Transform[data.bones.Length]; Dictionary byName = new Dictionary(); for (int i = 0; i < bones.Length; i++) { bones[i] = new GameObject(data.bones[i].name).transform; byName[data.bones[i].name] = bones[i]; } for (int j = 0; j < bones.Length; j++) { BoneData boneData = data.bones[j]; Transform obj = bones[j]; obj.SetParent((boneData.parent < 0) ? root : bones[boneData.parent], false); obj.localPosition = V(boneData.rest.p); obj.localRotation = Q(boneData.rest.q); obj.localScale = V(boneData.rest.s); } List list = new List(); Dictionary dictionary = new Dictionary(); MeshData[] meshes = data.meshes; foreach (MeshData meshData in meshes) { GameObject val = new GameObject("Storm " + meshData.name); val.transform.SetParent(root, false); SkinnedMeshRenderer val2 = val.AddComponent(); Mesh val3 = new Mesh(); ((Object)val3).name = "TobiramaStorm_" + meshData.name; val3.indexFormat = (IndexFormat)1; int num = meshData.v.Length / 3; Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector2[] array3 = (Vector2[])(object)new Vector2[num]; BoneWeight[] array4 = (BoneWeight[])(object)new BoneWeight[num]; for (int l = 0; l < num; l++) { array[l] = new Vector3(meshData.v[l * 3], meshData.v[l * 3 + 1], meshData.v[l * 3 + 2]); array2[l] = new Vector3(meshData.n[l * 3], meshData.n[l * 3 + 1], meshData.n[l * 3 + 2]); array3[l] = new Vector2(meshData.uv[l * 2], meshData.uv[l * 2 + 1]); int num2 = l; BoneWeight val4 = default(BoneWeight); ((BoneWeight)(ref val4)).boneIndex0 = meshData.bi[l * 4]; ((BoneWeight)(ref val4)).boneIndex1 = meshData.bi[l * 4 + 1]; ((BoneWeight)(ref val4)).boneIndex2 = meshData.bi[l * 4 + 2]; ((BoneWeight)(ref val4)).boneIndex3 = meshData.bi[l * 4 + 3]; ((BoneWeight)(ref val4)).weight0 = meshData.bw[l * 4]; ((BoneWeight)(ref val4)).weight1 = meshData.bw[l * 4 + 1]; ((BoneWeight)(ref val4)).weight2 = meshData.bw[l * 4 + 2]; ((BoneWeight)(ref val4)).weight3 = meshData.bw[l * 4 + 3]; array4[num2] = val4; } val3.vertices = array; val3.normals = array2; val3.uv = array3; val3.triangles = meshData.tri; val3.boneWeights = array4; val3.bindposes = bones.Select((Transform b) => b.worldToLocalMatrix * root.localToWorldMatrix).ToArray(); val3.RecalculateBounds(); val2.sharedMesh = val3; val2.bones = bones; val2.rootBone = bones[0]; ((Renderer)val2).localBounds = new Bounds(new Vector3(0f, 1.3f, 0f), new Vector3(5f, 5f, 5f)); val2.updateWhenOffscreen = true; string text = meshData.texture ?? ""; if (meshData.name.StartsWith("1sec00t0 eye_l") && File.Exists(Path.Combine(Visual.Assets, "Storm/1seceye_l14.png"))) { text = "Storm/1seceye_l14.png"; } else if (meshData.name.StartsWith("1sec00t0 eye_r") && File.Exists(Path.Combine(Visual.Assets, "Storm/1seceye_r14.png"))) { text = "Storm/1seceye_r14.png"; } bool flag = meshData.name.StartsWith("1sec00t0 kao#"); if (flag) { text += "#face"; } if (!dictionary.TryGetValue(text, out var value)) { value = new Material(Shader.Find("Hopoo Games/Deferred/Standard") ?? Shader.Find("Standard")); string text2 = (flag ? text.Substring(0, text.Length - 5) : text); ((Object)value).name = "TobiramaStorm_" + Path.GetFileNameWithoutExtension(text2) + (flag ? "_Face" : ""); value.color = (flag ? FaceTint : Color.white); if (value.HasProperty("_SpecularStrength")) { value.SetFloat("_SpecularStrength", 0.06f); } if (value.HasProperty("_Cull")) { value.SetInt("_Cull", 0); } if (text2 != "") { Texture2D val5 = new Texture2D(2, 2); ImageConversion.LoadImage(val5, File.ReadAllBytes(Path.Combine(Visual.Assets, text2))); ((Texture)val5).filterMode = (FilterMode)1; ((Texture)val5).wrapMode = (TextureWrapMode)1; value.mainTexture = (Texture)(object)val5; } dictionary[text] = value; } ((Renderer)val2).sharedMaterial = value; infos.Add(new RendererInfo { renderer = (Renderer)(object)val2, defaultMaterial = value, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }); val.SetActive(false); list.Add(val); if (meshData.name == "1sec00t0 kao#1secbody1") { list.Add(FaceInk(meshData, root, bones, val3.bindposes, array4, infos)); } } StormDrive[] source = (from x in data.drive where byName.ContainsKey(x.bone) orderby Array.IndexOf(bones, byName[x.bone]) select x).ToArray(); stormFollow.driven = source.Select((StormDrive x) => byName[x.bone]).ToArray(); stormFollow.drivers = source.Select((StormDrive x) => P(x.driver)).ToArray(); stormFollow.k = source.Select((StormDrive x) => Q(x.k)).ToArray(); StormTwist[] source2 = data.twist.Where((StormTwist x) => byName.ContainsKey(x.bone) && byName.ContainsKey(x.parent) && byName.ContainsKey(x.child)).ToArray(); stormFollow.twistBone = source2.Select((StormTwist x) => byName[x.bone]).ToArray(); stormFollow.twistParent = source2.Select((StormTwist x) => byName[x.parent]).ToArray(); stormFollow.twistChild = source2.Select((StormTwist x) => byName[x.child]).ToArray(); stormFollow.twistF = source2.Select((StormTwist x) => x.f).ToArray(); stormFollow.twistRest = source2.Select((StormTwist x) => Quaternion.Inverse(byName[x.parent].rotation) * byName[x.bone].rotation).ToArray(); stormFollow.twistAxis = source2.Select(delegate(StormTwist x) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Vector3 val6 = byName[x.parent].InverseTransformDirection(byName[x.child].position - byName[x.parent].position); return ((Vector3)(ref val6)).normalized; }).ToArray(); stormFollow.pelvis = (from n in byName.Keys where n.EndsWith("00t0 pelvis") select byName[n]).First(); stormFollow.hip = P("spine"); stormFollow.pelvisOffset = V(data.pelvisOffset); stormFollow.purchasedParts = purchased.ToArray(); stormFollow.stormParts = list.ToArray(); stormFollow.shown = 0; stopwatch.Stop(); Plugin.instance.Log.LogInfo((object)("TOBIRAMA_STORM_BUILD_MS=" + stopwatch.ElapsedMilliseconds + " bones=" + bones.Length + " driven=" + stormFollow.driven.Length + " twist=" + stormFollow.twistBone.Length + " meshes=" + list.Count + " triangles=" + data.meshes.Sum((MeshData m) => m.tri.Length / 3))); Transform P(string n) { Transform? obj2 = ((IEnumerable)v.bones).FirstOrDefault((Func)((Transform x) => ((Object)x).name == n)); if (!Object.op_Implicit((Object)(object)obj2)) { throw new InvalidOperationException("Storm skin: purchased bone missing " + n); } return obj2; } } private static GameObject FaceInk(MeshData d, Transform root, Transform[] bones, Matrix4x4[] bindposes, BoneWeight[] weights, List infos) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_011f: 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_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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_025a: 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_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_01b4: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_038f: 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) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Expected O, but got Unknown //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_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) int num = d.v.Length / 3; Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector3[] array3 = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { array3[i] = new Vector3(d.v[i * 3], d.v[i * 3 + 1], d.v[i * 3 + 2]); } Dictionary dictionary = new Dictionary(); for (int j = 0; j + 2 < d.tri.Length; j += 3) { Vector3 val = array3[d.tri[j]]; Vector3 val2 = array3[d.tri[j + 1]]; Vector3 val3 = array3[d.tri[j + 2]]; Vector3 val4 = -Vector3.Cross(val2 - val, val3 - val); int[] array4 = new int[3] { d.tri[j], d.tri[j + 1], d.tri[j + 2] }; foreach (int num2 in array4) { Vector3Int key = K(array3[num2]); dictionary.TryGetValue(key, out var value); dictionary[key] = value + val4; } } for (int l = 0; l < num; l++) { dictionary.TryGetValue(K(array3[l]), out var value2); Vector3 normalized; if (!(((Vector3)(ref value2)).sqrMagnitude > 1E-20f)) { Vector3 val5 = new Vector3(d.n[l * 3], d.n[l * 3 + 1], d.n[l * 3 + 2]); normalized = ((Vector3)(ref val5)).normalized; } else { normalized = ((Vector3)(ref value2)).normalized; } Vector3 val6 = normalized; array2[l] = -val6; array[l] = array3[l] + val6 * InkWidth; } int[] triangles = (int[])d.tri.Clone(); Mesh val7 = new Mesh { name = "TobiramaStorm_FaceInk", indexFormat = (IndexFormat)1 }; val7.vertices = array; val7.normals = array2; val7.triangles = triangles; val7.boneWeights = weights; val7.bindposes = bindposes; val7.RecalculateBounds(); GameObject val8 = new GameObject("Storm FaceInk"); val8.transform.SetParent(root, false); SkinnedMeshRenderer val9 = val8.AddComponent(); val9.sharedMesh = val7; val9.bones = bones; val9.rootBone = bones[0]; ((Renderer)val9).localBounds = new Bounds(new Vector3(0f, 1.3f, 0f), new Vector3(5f, 5f, 5f)); val9.updateWhenOffscreen = true; ((Renderer)val9).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val9).receiveShadows = false; if (!Object.op_Implicit((Object)(object)inkMat)) { inkMat = new Material(Shader.Find("Hopoo Games/Deferred/Standard") ?? Shader.Find("Standard")); ((Object)inkMat).name = "TobiramaStorm_FaceInk"; inkMat.color = new Color(0.035f, 0.025f, 0.03f); if (inkMat.HasProperty("_SpecularStrength")) { inkMat.SetFloat("_SpecularStrength", 0f); } if (inkMat.HasProperty("_Cull")) { inkMat.SetInt("_Cull", 2); } } ((Renderer)val9).sharedMaterial = inkMat; infos.Add(new RendererInfo { renderer = (Renderer)(object)val9, defaultMaterial = inkMat, defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true }); val8.SetActive(false); return val8; static Vector3Int K(Vector3 p) { //IL_0000: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) return new Vector3Int(Mathf.RoundToInt(p.x * 20000f), Mathf.RoundToInt(p.y * 20000f), Mathf.RoundToInt(p.z * 20000f)); } } public void Show(int skin) { int num = (IsStorm(skin) ? 1 : 0); if (num == shown && stormParts != null && stormParts.Length != 0 && stormParts[0].activeSelf == (num == 1)) { return; } shown = num; GameObject[] array = purchasedParts; foreach (GameObject val in array) { if (Object.op_Implicit((Object)(object)val) && val.activeSelf != (num == 0)) { val.SetActive(num == 0); } } array = stormParts; foreach (GameObject val2 in array) { if (Object.op_Implicit((Object)(object)val2) && val2.activeSelf != (num == 1)) { val2.SetActive(num == 1); } } if (num == 1) { Drive(); } Kit.Log("STORM_SKIN show skin=" + skin + " storm=" + (num == 1) + " on=" + ((Object)this).name + " body=" + Object.op_Implicit((Object)(object)body)); } private void Update() { //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (!looked) { looked = true; CharacterModel componentInParent = ((Component)this).GetComponentInParent(); body = (Object.op_Implicit((Object)(object)componentInParent) ? componentInParent.body : null); msc = ((Component)this).GetComponentInParent(); relay = ((Component)this).GetComponentInParent(); slot = ((Component)this).GetComponentInParent(); } if (!Object.op_Implicit((Object)(object)body)) { CharacterModel componentInParent2 = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent2)) { body = componentInParent2.body; } } if (Object.op_Implicit((Object)(object)body)) { int skin = ((Object.op_Implicit((Object)(object)msc) && msc.currentSkinIndex >= 0) ? msc.currentSkinIndex : ((int)body.skinIndex)); Show(skin); } else if (Object.op_Implicit((Object)(object)relay)) { if (Object.op_Implicit((Object)(object)relay.owner)) { Show((int)relay.owner.skinIndex); } } else { if (!Object.op_Implicit((Object)(object)slot) || !(loadoutField != null)) { return; } try { object? value = loadoutField.GetValue(slot); Loadout val = (Loadout)((value is Loadout) ? value : null); if (val != null) { Show((int)val.bodyLoadoutManager.GetSkinIndex(BodyCatalog.FindBodyIndex("HenryTobiramaBody"))); } } catch (Exception) { } } } private void LateUpdate() { if (shown == 1) { Drive(); } } public void Drive() { //IL_0036: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f6: 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_0109: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01ac: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01d4: 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_01e3: 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) if (driven == null) { return; } for (int i = 0; i < driven.Length; i++) { Transform val = drivers[i]; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)driven[i])) { driven[i].rotation = val.rotation * k[i]; } } if (Object.op_Implicit((Object)(object)pelvis) && Object.op_Implicit((Object)(object)hip)) { Transform transform = ((Component)this).transform; pelvis.position = transform.TransformPoint(transform.InverseTransformPoint(hip.position) + pelvisOffset); } Vector3 val4 = default(Vector3); Quaternion identity = default(Quaternion); for (int j = 0; j < twistBone.Length; j++) { Quaternion rotation = twistParent[j].rotation; Quaternion val2 = Quaternion.Inverse(rotation) * twistChild[j].rotation; Vector3 val3 = twistAxis[j]; ((Vector3)(ref val4))..ctor(val2.x, val2.y, val2.z); Vector3 val5 = val3 * Vector3.Dot(val4, val3); ((Quaternion)(ref identity))..ctor(val5.x, val5.y, val5.z, val2.w); float num = Mathf.Sqrt(identity.x * identity.x + identity.y * identity.y + identity.z * identity.z + identity.w * identity.w); if (num < 1E-05f) { identity = Quaternion.identity; } else { ((Quaternion)(ref identity))..ctor(identity.x / num, identity.y / num, identity.z / num, identity.w / num); } twistBone[j].rotation = rotation * Quaternion.Slerp(Quaternion.identity, identity, twistF[j]) * twistRest[j]; } } } public static class TandemLook { public static Material tag; public static Material dome; public static Material glow; public static Material flame; public static Material ember; public static Material smoke; public static Material debris; public static Material shock; public static Material scorch; public static Material fuse; public static Material shockThin; public static Material dust; public static Mesh thinRing; public static Mesh dustRing; private static Mesh RingMesh(float inner, float outer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_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) Mesh val = new Mesh { name = "Tobirama thin ring" }; List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val2 = default(Vector3); for (int i = 0; i <= 96; i++) { float num = (float)i * MathF.PI * 2f / 96f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); list.Add(val2 * inner); list.Add(val2 * outer); list2.Add(new Vector2((float)i / 24f, 0f)); list2.Add(new Vector2((float)i / 24f, 1f)); if (i < 96) { int num2 = i * 2; list3.AddRange(new int[6] { num2, num2 + 1, num2 + 2, num2 + 1, num2 + 3, num2 + 2 }); } } val.SetVertices(list); val.SetUVs(0, list2); val.SetTriangles(list3, 0); val.RecalculateBounds(); val.bounds = new Bounds(Vector3.zero, Vector3.one * 2.2f); return val; } public static void Prepare() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_0029: 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_00ed: 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_0159: 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_01ca: 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_023c: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown //IL_005d: 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_037a: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) tag = new Material(KitVfx.paper); tag.mainTexture = (Texture)(object)StormFx.Tex("Tandem/tag.png", (TextureWrapMode)1); tag.color = Color.white; if (tag.HasProperty("_EmColor")) { tag.SetColor("_EmColor", new Color(0.42f, 0.38f, 0.3f)); tag.SetFloat("_EmPower", 1f); tag.SetTexture("_EmTex", tag.mainTexture); } dome = StormFx.Mat((Texture)(object)StormFx.Tex("Tandem/firedome.png", (TextureWrapMode)0), additive: true, new Color(1f, 0.6f, 0.3f, 0.8f), 1.05f, 3004); glow = StormFx.Mat((Texture)(object)StormFx.Tex("Tandem/fireglow.png", (TextureWrapMode)1), additive: true, new Color(1f, 0.7f, 0.4f, 0.8f), 1.1f, 3005); flame = StormFx.Mat((Texture)(object)StormFx.Tex("Tandem/fire03.png", (TextureWrapMode)1), additive: true, new Color(1f, 0.58f, 0.2f, 0.9f), 1.05f, 3004); ember = StormFx.Mat((Texture)(object)StormFx.soft, additive: true, new Color(1f, 0.7f, 0.3f, 1f), 3f, 3006); fuse = StormFx.Mat((Texture)(object)StormFx.soft, additive: true, new Color(1f, 0.75f, 0.35f, 1f), 4f, 3006); smoke = StormFx.Mat((Texture)(object)Tex03.Masked(StormFx.Tex("Tandem/smoke.png", (TextureWrapMode)1)), additive: false, new Color(0.12f, 0.11f, 0.1f, 0.9f), 1f, 3006); debris = StormFx.Mat((Texture)(object)StormFx.Tex("Tandem/debris.png", (TextureWrapMode)1), additive: false, new Color(0.25f, 0.18f, 0.12f, 1f), 1f, 3002); shock = StormFx.Mat((Texture)(object)StormFx.Tex("Tandem/shock.png", (TextureWrapMode)0), additive: true, new Color(1f, 0.75f, 0.45f, 1f), 1.6f, 3005); scorch = StormFx.Mat((Texture)(object)StormFx.scorch, additive: false, new Color(0.09f, 0.07f, 0.06f, 1f), 1f, 2999); Texture2D val = new Texture2D(4, 32, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, name = "Tobirama shock gradient" }; for (int i = 0; i < 32; i++) { float num = (float)i / 31f; float num2 = ((num < 0.7f) ? Mathf.SmoothStep(0f, 1f, num / 0.7f) : (1f - Mathf.SmoothStep(0f, 1f, (num - 0.7f) / 0.3f))); for (int j = 0; j < 4; j++) { val.SetPixel(j, i, new Color(1f, 1f, 1f, num2)); } } val.Apply(); shockThin = StormFx.Mat((Texture)(object)val, additive: true, new Color(1f, 0.82f, 0.55f, 1f), 1.6f, 3005); dust = StormFx.Mat((Texture)(object)val, additive: false, new Color(0.42f, 0.36f, 0.3f, 0.4f), 1f, 3003); thinRing = RingMesh(0.94f, 1f); dustRing = RingMesh(0.86f, 1.06f); } } public class FireballPool { public class Ball { public GameObject root; public MeshRenderer dome; public MeshRenderer inner; public MeshRenderer ring; public Transform scorchT; public MeshRenderer scorch; public float born; public float size; public float scorchBorn; public float ringMax; public float scorchSize; public bool active; public bool scorchActive; public bool air; public bool child; public Vector3 ground; public Vector3 normal; } private static readonly List all = new List(); public static int Live; public static int Peak; public static Ball Rent() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown foreach (Ball item in all) { if (!item.active && !item.scorchActive && Object.op_Implicit((Object)(object)item.root)) { return item; } } GameObject val = new GameObject("Tobirama pooled fireball"); Object.DontDestroyOnLoad((Object)(object)val); Ball ball = new Ball { root = val }; ball.dome = StormFx.Part(val, "Dome", StormFx.sphere, TandemLook.dome); ball.inner = StormFx.Part(val, "Core", StormFx.sphere, TandemLook.glow); ball.ring = StormFx.Part(val, "Ring", StormFx.ring, TandemLook.shock); ball.scorch = StormFx.Part(val, "Scorch", StormFx.quad, TandemLook.scorch); ball.scorchT = ((Component)ball.scorch).transform; ball.scorchT.SetParent((Transform)null, true); Object.DontDestroyOnLoad((Object)(object)((Component)ball.scorchT).gameObject); all.Add(ball); return ball; } public static void Prewarm(int n) { List list = new List(); for (int i = all.Count; i < n; i++) { Ball ball = Rent(); ball.active = true; list.Add(ball); } foreach (Ball item in list) { item.active = false; if (Object.op_Implicit((Object)(object)item.root)) { item.root.SetActive(false); } if (Object.op_Implicit((Object)(object)item.scorchT)) { ((Component)item.scorchT).gameObject.SetActive(false); } } } public static void Clear() { foreach (Ball item in all) { if (Object.op_Implicit((Object)(object)item.root)) { item.root.SetActive(false); } if (Object.op_Implicit((Object)(object)item.scorchT)) { ((Component)item.scorchT).gameObject.SetActive(false); } item.active = (item.scorchActive = false); } } } public class TandemField : MonoBehaviour { private class Tag { public int gen; public int parent; public Vector3 from; public Vector3 to; public Vector3 normal; public Vector3 pos; public Vector3 vel; public float launch; public float land; public float explodeAt; public float size; public Transform t; public Transform stuckTo; public Vector3 stuckLocal; public Quaternion stuckRot; public bool live; public bool landed; public float spin; public float wobble; public float zipY; public string style; } public static readonly int[] PerGeneration = new int[6] { 1, 3, 6, 9, 12, 15 }; public const float ThrowTime = 0.3f; public const float ScatterTime = 0.24f; private const int MaxTags = 140; private float start; private float radius; private float delay; private float interval; private int waves; private int wave; private bool initialized; private bool final; private bool stopped; private bool airField; private EffectData data; private CharacterBody owner; private string key; private Vector3 center; private Vector3 thrower; private int fullCount; private int popCount; private float lastShake; private int recentPops; private int explodedAir; private int explodedGround; private int explodedStuck; private readonly int[] genCount = new int[12]; public Transform[] pool; public ParticleSystem glowPs; public ParticleSystem flamePs; public ParticleSystem emberPs; public ParticleSystem smokePs; public ParticleSystem debrisPs; public ParticleSystem fusePs; private readonly List tags = new List(); private readonly List balls = new List(); private static readonly Dictionary fields = new Dictionary(); private Random rng; private const float LobG = 18f; private float finalAt0 = -1f; private bool columnDone; private Vector3 finalGround; public MeshRenderer shockR; public MeshRenderer dustR; private readonly float[] tierT = new float[3]; private const int SecN = 10; private readonly Vector3[] secP = (Vector3[])(object)new Vector3[10]; private readonly float[] secT = new float[10]; private readonly float[] secS = new float[10]; public static int ActiveFields => fields.Count; private float FinalAt => GenerationTime(waves - 1, delay, interval) + 0.5f; private float S => Mathf.Max(0.5f, radius / 11.25f); public static void Build(GameObject g) { //IL_0055: 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_00e9: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: 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_0334: 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_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) TandemField tandemField = g.AddComponent(); tandemField.pool = (Transform[])(object)new Transform[140]; for (int i = 0; i < 140; i++) { MeshRenderer val = StormFx.Part(g, "Tag" + i, StormFx.quad, TandemLook.tag); ((Component)val).transform.localScale = new Vector3(0.55f, 1.1f, 1f); TrailRenderer obj = ((Component)val).gameObject.AddComponent(); ((Renderer)obj).sharedMaterial = TandemLook.fuse; obj.time = 0.06f; obj.minVertexDistance = 0.05f; obj.widthMultiplier = 0.24f; obj.widthCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f); obj.startColor = new Color(1f, 0.86f, 0.66f, 0.8f); obj.endColor = new Color(1f, 0.45f, 0.16f, 0f); obj.emitting = false; ((Component)val).gameObject.SetActive(false); tandemField.pool[i] = ((Component)val).transform; } tandemField.glowPs = StormFx.System(g, "Glow", TandemLook.glow, 180, -0.05f, stretch: false); StormFx.Fade(tandemField.glowPs, new Color(1f, 0.95f, 0.75f), new Color(1f, 0.35f, 0.08f), 1f, 0.8f, 1.25f); Water03.Cap(tandemField.glowPs, 0.2f); tandemField.flamePs = StormFx.System(g, "Flame", TandemLook.flame, 760, -0.35f, stretch: false, 0.6f); StormFx.Fade(tandemField.flamePs, new Color(1f, 0.88f, 0.5f), new Color(0.5f, 0.13f, 0.03f), 1f, 0.9f, 1.5f); Water03.Cap(tandemField.flamePs, 0.16f); TextureSheetAnimationModule textureSheetAnimation = tandemField.flamePs.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 4; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = 8; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).animation = (ParticleSystemAnimationType)1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).rowMode = (ParticleSystemAnimationRowMode)1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0f, 1f, 0.999f)); tandemField.emberPs = StormFx.System(g, "Embers", TandemLook.ember, 820, 0.55f, stretch: true); StormFx.Fade(tandemField.emberPs, new Color(1f, 0.7f, 0.35f), new Color(0.9f, 0.25f, 0.05f), 1f, 1f, 0.4f); Water03.Cap(tandemField.emberPs, 0.03f); ((Component)tandemField.emberPs).GetComponent().renderMode = (ParticleSystemRenderMode)0; tandemField.smokePs = StormFx.System(g, "Smoke", TandemLook.smoke, 380, -0.12f, stretch: false, 0.35f); StormFx.Fade(tandemField.smokePs, new Color(0.2f, 0.17f, 0.15f), new Color(0.08f, 0.08f, 0.09f), 0.3f, 0.88f, 3f); Water03.Cap(tandemField.smokePs, 0.35f); tandemField.debrisPs = StormFx.System(g, "Debris", TandemLook.debris, 200, 2.2f, stretch: false); StormFx.Fade(tandemField.debrisPs, Color.white, Color.white, 1f, 1f, 0.8f); Water03.Cap(tandemField.debrisPs, 0.05f); tandemField.fusePs = StormFx.System(g, "Fuse", TandemLook.fuse, 460, -0.2f, stretch: false); StormFx.Fade(tandemField.fusePs, new Color(1f, 0.95f, 0.7f), new Color(1f, 0.4f, 0.1f), 1f, 0.7f, 0.3f); Water03.Cap(tandemField.fusePs, 0.025f); FireballPool.Prewarm(60); tandemField.shockR = StormFx.Part(g, "FinalShock", TandemLook.thinRing, TandemLook.shockThin); ((Component)tandemField.shockR).gameObject.SetActive(false); tandemField.dustR = StormFx.Part(g, "FinalDust", TandemLook.dustRing, TandemLook.dust); ((Component)tandemField.dustR).gameObject.SetActive(false); } private void OnEnable() { initialized = false; } private void OnDisable() { if (key != null && fields.ContainsKey(key) && (Object)(object)fields[key] == (Object)(object)this) { fields.Remove(key); } key = null; } public static void Stop(string k) { if (fields.TryGetValue(k, out var value) && Object.op_Implicit((Object)(object)value)) { value.stopped = true; } } public static float GenerationTime(int g, float delay, float interval) { return delay + (float)g * interval; } private void Init() { //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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) EffectComponent component = ((Component)this).GetComponent(); data = component.effectData; center = data.origin; radius = Mathf.Max(1f, data.scale); start = data.genericFloat; thrower = data.start; Color32 color = data.color; delay = (float)(color.r + (color.g << 8)) * 0.01f; interval = (float)(int)color.b * 0.01f; waves = Mathf.Clamp((int)color.a, 1, PerGeneration.Length); GameObject val = data.ResolveNetworkedObjectReference(); owner = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); key = (Object.op_Implicit((Object)(object)owner) ? ((Object)owner).GetInstanceID() : 0) + ":" + (data.genericUInt & 0x7FFFFFFF); fields[key] = this; airField = (data.genericUInt & 0x80000000u) != 0; initialized = true; wave = 0; final = false; stopped = false; balls.Clear(); tags.Clear(); ((Component)this).transform.rotation = Quaternion.identity; rng = new Random((int)(data.genericUInt * 7919 + 13)); lastShake = -1f; finalAt0 = -1f; Array.Clear(secT, 0, 10); Array.Clear(tierT, 0, 3); recentPops = 0; fullCount = (popCount = 0); explodedAir = (explodedGround = (explodedStuck = 0)); Array.Clear(genCount, 0, genCount.Length); Transform[] array = pool; foreach (Transform obj in array) { obj.SetParent(((Component)this).transform, false); ((Component)obj).gameObject.SetActive(false); } ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(); } Tag tag = AddTag(0, -1, thrower, center, 0f, Mathf.Max(0.15f, delay - 0.3f)); if (tag != null) { tag.explodeAt = delay; tag.size = 3f; tag.t.localScale = new Vector3(1f, 2f, 1f); TrailRenderer component2 = ((Component)tag.t).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.widthMultiplier = 0.45f; component2.time = 0.06f; } genCount[0]++; } } private Tag Fling(Tag parent, Vector3 from, float now) { //IL_0067: 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_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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0161: 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_0183: 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_0198: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: 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_03bc: 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_03c6: 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_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_0598: Unknown result type (might be due to invalid IL or missing references) int count = tags.Count; if (count >= pool.Length) { return null; } float num = FinalAt - 0.14f; float num2 = ((parent.gen == 0) ? now : (now + 0.07f * R())); if (num2 + 0.22f > num) { return null; } Vector3 val = (Object.op_Implicit((Object)(object)owner) ? owner.footPosition : thrower); Vector3 normal; float num3 = Ground(from, out normal); float num4 = from.y - num3; Vector3 val2 = from - center; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.04f) { val2 = Quaternion.Euler(0f, R() * 360f, 0f) * Vector3.forward; } ((Vector3)(ref val2)).Normalize(); Vector3 val3 = Quaternion.Euler(0f, R() * 360f, 0f) * Vector3.forward; float num5 = Flat(from - center); Vector3 val4 = Vector3.Slerp(val3, (num5 > radius * 0.75f) ? (-val2) : val2, (num5 > radius * 0.75f) ? 0.55f : 0.4f); val4.y = 0f; ((Vector3)(ref val4)).Normalize(); Vector3 val5 = val - from; val5.y = 0f; if (((Vector3)(ref val5)).magnitude < 9f && Vector3.Dot(val4, ((Vector3)(ref val5)).normalized) > 0.5f) { val4 = Vector3.Reflect(val4, ((Vector3)(ref val5)).normalized); } float num6 = R(); float num7 = 0f; float num8; float num11; string text; if (num6 < 0.28f && num4 < 5f * S) { num8 = (2.5f + 2.5f * R()) * S; float num9 = (6.2f + 2.6f * R()) * Mathf.Pow(S, 0.6f); float num10 = Mathf.Max(1.5f, num9 - num4); num11 = Mathf.Sqrt(36f * num10) * 1.1f; num7 = num11 / 18f * 0.86f; text = "lob"; } else if (num6 < 0.55f) { num8 = (10f + 7f * R()) * S; num11 = 0f; text = "zip"; } else if (num6 < 0.72f) { num8 = (1.5f + 2f * R()) * S; num11 = (8.5f + 3f * R()) * Mathf.Sqrt(S); text = "spin"; } else { num8 = (6f + 5f * R()) * S; num11 = (3.5f + 3f * R()) * Mathf.Sqrt(S); text = "arc"; } if (num4 > 3.2f * S && text != "lob" && text != "zip") { num11 = Mathf.Lerp(num11, -2f - 3f * R(), Mathf.Clamp01((num4 - 3.2f * S) / 3f)); } Tag tag = new Tag { gen = Mathf.Min(parent.gen + 1, genCount.Length - 1), parent = tags.IndexOf(parent), from = from, pos = from, vel = val4 * num8 + Vector3.up * num11, launch = num2, land = 0f, t = pool[count], live = true, spin = R() * 360f, wobble = R() * 6.28f, style = text, zipY = num3 + 0.5f + 0.8f * R() }; float num12 = ((parent.gen == 0) ? (0.14f + 0.24f * R()) : ((parent.gen <= 1) ? (0.22f + 0.42f * Mathf.Pow(R(), 1.25f)) : (0.26f + 0.58f * Mathf.Pow(R(), 1.25f)))); if (text == "lob") { num12 = num7 * (0.9f + 0.15f * R()); } tag.explodeAt = Mathf.Min(num2 + num12, num - 0.12f * R()); float num13 = Mathf.Clamp01((tag.explodeAt - delay) / Mathf.Max(0.1f, FinalAt - delay)); tag.size = Mathf.Lerp(4.4f, 1.8f, num13) * (0.72f + 0.56f * R()) * Mathf.Pow(S, 0.4f); float num14 = Mathf.Lerp(1.15f, 0.9f, num13) * Mathf.Pow(S, 0.3f); tag.t.localScale = new Vector3(num14, num14 * 2f, 1f); TrailRenderer component = ((Component)tag.t).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.widthMultiplier = 0.3f; component.time = Mathf.Min(0.06f, 1.5f / Mathf.Max(1f, ((Vector3)(ref tag.vel)).magnitude)); } tag.t.SetParent(((Component)this).transform, false); ((Component)tag.t).gameObject.SetActive(false); tags.Add(tag); genCount[tag.gen]++; return tag; } private int ChildCount(Tag tg) { float num = R(); if (tg.gen == 0) { if (!(num < 0.5f)) { return 7; } return 6; } if (tg.gen <= 2) { if (!(num < 0.35f)) { if (!(num < 0.8f)) { return 5; } return 4; } return 3; } if (!(num < 0.12f)) { if (!(num < 0.4f)) { if (!(num < 0.78f)) { return 3; } return 2; } return 1; } return 0; } private float R() { return (float)rng.NextDouble(); } private Tag AddTag(int gen, int parent, Vector3 from, Vector3 aimed, float launch, float land) { //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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: 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_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0387: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_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_0145: 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_0255: 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_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: 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_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: 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_02ba: 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_02c2: 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_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: 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_02e8: 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_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_02f9: 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_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) int count = tags.Count; if (count >= pool.Length) { return null; } Tag tag = new Tag { gen = gen, parent = parent, from = from, launch = launch, land = land, t = pool[count], live = true, spin = R() * 360f }; float num = Mathf.Lerp(0.7f, 0.5f, (float)gen / 5f); tag.t.localScale = new Vector3(num, num * 2f, 1f); TrailRenderer component = ((Component)tag.t).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.widthMultiplier = 0.24f; } CharacterBody val = null; float num2 = 1.8f; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.healthComponent) && readOnlyInstances.healthComponent.alive && (!Object.op_Implicit((Object)(object)owner) || !Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) || !Object.op_Implicit((Object)(object)owner.teamComponent) || readOnlyInstances.teamComponent.teamIndex != owner.teamComponent.teamIndex)) { Vector3 val2 = readOnlyInstances.corePosition - aimed; val2.y *= 0.4f; float num3 = ((Vector3)(ref val2)).magnitude - readOnlyInstances.radius; if (num3 < num2) { num2 = num3; val = readOnlyInstances; } } } if (Object.op_Implicit((Object)(object)val)) { Transform val3 = ((Object.op_Implicit((Object)(object)val.modelLocator) && Object.op_Implicit((Object)(object)val.modelLocator.modelTransform)) ? val.modelLocator.modelTransform : val.transform); Vector3 val4 = aimed - val.corePosition; val4.y = 0f; if (((Vector3)(ref val4)).sqrMagnitude < 0.01f) { val4 = from - val.corePosition; } val4.y = 0f; val4 = ((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val4)).normalized : Vector3.forward); Vector3 val5 = (tag.to = val.corePosition + val4 * Mathf.Max(0.3f, val.radius * 0.85f) + Vector3.up * (R() - 0.3f) * Mathf.Max(0.5f, val.radius)); tag.normal = val4; tag.stuckTo = val3; tag.stuckLocal = val3.InverseTransformPoint(val5); tag.stuckRot = Quaternion.Inverse(val3.rotation) * Quaternion.LookRotation(-val4, Vector3.up) * Quaternion.Euler(0f, 0f, R() * 40f - 20f); } else { Vector3 val6 = aimed; Vector3 val7 = Vector3.up; RaycastHit val8 = default(RaycastHit); if (!airField && Physics.Raycast(aimed + Vector3.up * 3f, Vector3.down, ref val8, 8f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val6 = ((RaycastHit)(ref val8)).point; val7 = ((RaycastHit)(ref val8)).normal; } tag.to = val6 + val7 * 0.04f; tag.normal = val7; } tag.t.SetParent(((Component)this).transform, false); ((Component)tag.t).gameObject.SetActive(false); tags.Add(tag); return tag; } private void Update() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { EffectComponent component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.effectData == null) { return; } Init(); } float num = (Object.op_Implicit((Object)(object)Run.instance) ? (FixedTimeStamp.now.t - start) : 0f); float finalAt = FinalAt; if (stopped && !final) { End(); return; } for (int i = 0; i < tags.Count; i++) { MoveTag(tags[i], num); } for (int j = 0; j < tags.Count; j++) { Tag tag = tags[j]; if (tag.live && !final && num >= tag.explodeAt && num >= tag.launch) { Detonate(tag, num); } } while (wave < waves && num >= GenerationTime(wave, delay, interval)) { wave++; } if (Time.time - lastShake > 0.2f && recentPops > 0) { Shake(0.35f + 0.14f * (float)Mathf.Min(recentPops, 6), 0.3f); lastShake = Time.time; recentPops = 0; } if (!final && wave >= waves && num >= finalAt) { final = true; Final(); } for (int num2 = balls.Count - 1; num2 >= 0; num2--) { if (!Animate(balls[num2])) { balls.RemoveAt(num2); } } AnimateShock(); if (num > finalAt + 7f || num > 40f || (stopped && balls.Count == 0)) { End(); } } private void MoveTag(Tag tg, float age) { //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: 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_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: 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_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_01eb: 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_0218: 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_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) if (!tg.live || !Object.op_Implicit((Object)(object)tg.t)) { return; } if (age < tg.launch) { ((Component)tg.t).gameObject.SetActive(false); return; } if (!((Component)tg.t).gameObject.activeSelf) { ((Component)tg.t).gameObject.SetActive(true); TrailRenderer component = ((Component)tg.t).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.Clear(); } } if (tg.gen > 0) { Fly(tg, age); return; } float num = Mathf.Clamp01((age - tg.launch) / Mathf.Max(0.05f, tg.land - tg.launch)); TrailRenderer component2 = ((Component)tg.t).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.emitting = num < 1f; } if (num < 1f) { float num2 = ((tg.gen == 0) ? 1.4f : (1.2f + 1.6f * (1f - (float)tg.gen / 6f))); Vector3 val = Vector3.Lerp(tg.from, Object.op_Implicit((Object)(object)tg.stuckTo) ? tg.stuckTo.TransformPoint(tg.stuckLocal) : tg.to, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * num2; tg.t.position = val; tg.t.rotation = Quaternion.Euler(60f + Mathf.Sin(age * 17f + tg.spin) * 50f, tg.spin + age * 540f, Mathf.Sin(age * 13f + tg.spin) * 60f); if (Random.value < 0.8f) { StormFx.Emit(fusePs, val + tg.t.up * 0.4f, Random.insideUnitSphere * 0.6f, Random.Range(0.08f, 0.14f), Random.Range(0.12f, 0.22f), Color.white); } return; } if (!tg.landed) { tg.landed = true; int num3 = ((tg.gen == 0) ? 26 : 6); for (int i = 0; i < num3; i++) { StormFx.Emit(fusePs, TagPos(tg) + Vector3.up * 0.3f, Random.insideUnitSphere * 3f + Vector3.up * 2f, Random.Range(0.1f, 0.2f), Random.Range(0.2f, 0.4f), Color.white); } if (tg.gen == 0) { StormFx.Emit(glowPs, TagPos(tg), Vector3.zero, 1.6f, 0.25f, new Color(1f, 0.7f, 0.4f, 0.6f)); } } if (Object.op_Implicit((Object)(object)tg.stuckTo)) { tg.t.position = tg.stuckTo.TransformPoint(tg.stuckLocal); tg.t.rotation = tg.stuckTo.rotation * tg.stuckRot; } else { tg.t.position = tg.to; tg.t.rotation = Quaternion.LookRotation(-tg.normal, Quaternion.Euler(0f, tg.spin, 0f) * Vector3.forward); } if (Random.value < 0.6f) { StormFx.Emit(fusePs, tg.t.position + tg.t.up * 0.4f, Random.insideUnitSphere * 1.2f + Vector3.up * 1.5f, Random.Range(0.1f, 0.16f), Random.Range(0.15f, 0.3f), Color.white); } } private int LiveFull() { int num = 0; float time = Time.time; foreach (FireballPool.Ball ball in balls) { if (ball.active && ball.child && time >= ball.born && time - ball.born < 0.65f) { num++; } } return num; } private Vector3 TagPos(Tag tg) { //IL_001a: 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) if (!Object.op_Implicit((Object)(object)tg.t)) { return tg.to; } return tg.t.position; } private static float Flat(Vector3 v) { v.y = 0f; return ((Vector3)(ref v)).magnitude; } private float SightFade(Vector3 p) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Camera val = Water03.Cam(); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)owner)) { return 1f; } Vector3 position = ((Component)val).transform.position; Vector3 val2 = owner.corePosition - position; float num = Mathf.Clamp01(Vector3.Dot(p - position, val2) / Mathf.Max(0.01f, ((Vector3)(ref val2)).sqrMagnitude)); float num2 = Vector3.Distance(p, position + val2 * num); return Mathf.SmoothStep(0f, 1f, (num2 - 2.5f) / 3.5f); } private float Ground(Vector3 p, out Vector3 normal) { //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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_00c6: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) normal = Vector3.up; RaycastHit val = default(RaycastHit); if (airField) { if (Physics.Raycast(p + Vector3.up * 2f, Vector3.down, ref val, 90f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { normal = ((RaycastHit)(ref val)).normal; return ((RaycastHit)(ref val)).point.y; } return p.y - 90f; } if (Physics.Raycast(new Vector3(p.x, center.y + 5f, p.z), Vector3.down, ref val, 12f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { normal = ((RaycastHit)(ref val)).normal; return ((RaycastHit)(ref val)).point.y; } return center.y; } private void Fly(Tag tg, float age) { //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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0253: 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_020e: 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_0224: 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_0276: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: 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_00e0: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_064a: 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_065a: 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_0682: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038d: 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_040a: 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_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: 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_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0477: 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_0481: 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_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) TrailRenderer component = ((Component)tg.t).GetComponent(); if (tg.landed) { if (Object.op_Implicit((Object)(object)tg.stuckTo)) { tg.t.position = tg.stuckTo.TransformPoint(tg.stuckLocal); tg.t.rotation = tg.stuckTo.rotation * tg.stuckRot; } else { tg.t.position = tg.pos; tg.t.rotation = Quaternion.LookRotation(-tg.normal, Quaternion.Euler(0f, tg.spin, 0f) * Vector3.forward); } if (Object.op_Implicit((Object)(object)component)) { component.emitting = false; } if (Random.value < 0.5f) { StormFx.Emit(fusePs, tg.t.position + tg.t.up * 0.35f, Random.insideUnitSphere * 1.2f + Vector3.up * 1.5f, Random.Range(0.1f, 0.16f), Random.Range(0.15f, 0.3f), Color.white); } return; } float num = Mathf.Min(Time.deltaTime, 0.05f); float num2 = age - tg.launch; if (num <= 0f) { num = 0.016f; } Vector3 pos = tg.pos; if (tg.style == "lob") { tg.vel += Vector3.up * -18f * num; tg.vel *= Mathf.Exp(-0.3f * num); } else if (tg.style == "zip") { tg.vel.y = Mathf.Clamp((tg.zipY - tg.pos.y) * 10f, -16f, 3f); tg.vel *= Mathf.Exp(-1.1f * num); } else { tg.vel += Vector3.up * -10.5f * num; tg.vel *= Mathf.Exp(-1.1f * num); } tg.pos += tg.vel * num; RaycastHit val = default(RaycastHit); if (num2 > 0.03f && Physics.Linecast(pos, tg.pos, ref val, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { tg.landed = true; tg.pos = ((RaycastHit)(ref val)).point + ((RaycastHit)(ref val)).normal * 0.04f; tg.normal = ((RaycastHit)(ref val)).normal; SparkLand(tg); } else if (num2 > 0.08f) { foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.healthComponent) && readOnlyInstances.healthComponent.alive && (!Object.op_Implicit((Object)(object)owner) || !Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) || !Object.op_Implicit((Object)(object)owner.teamComponent) || readOnlyInstances.teamComponent.teamIndex != owner.teamComponent.teamIndex)) { Vector3 val2 = tg.pos - readOnlyInstances.corePosition; if (!(((Vector3)(ref val2)).magnitude > readOnlyInstances.radius + 0.55f)) { Transform val3 = ((Object.op_Implicit((Object)(object)readOnlyInstances.modelLocator) && Object.op_Implicit((Object)(object)readOnlyInstances.modelLocator.modelTransform)) ? readOnlyInstances.modelLocator.modelTransform : readOnlyInstances.transform); Vector3 val4 = ((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val2)).normalized : Vector3.up); Vector3 val5 = readOnlyInstances.corePosition + val4 * Mathf.Max(0.3f, readOnlyInstances.radius * 0.85f); tg.landed = true; tg.pos = val5; tg.normal = val4; tg.stuckTo = val3; tg.stuckLocal = val3.InverseTransformPoint(val5); tg.stuckRot = Quaternion.Inverse(val3.rotation) * Quaternion.LookRotation(-val4, Vector3.up) * Quaternion.Euler(0f, 0f, R() * 40f - 20f); SparkLand(tg); break; } } } } if (tg.landed) { Fly(tg, age); return; } if (Object.op_Implicit((Object)(object)component)) { component.emitting = false; } Vector3 val6 = Vector3.Cross((((Vector3)(ref tg.vel)).sqrMagnitude > 0.01f) ? ((Vector3)(ref tg.vel)).normalized : Vector3.forward, Vector3.up); if (((Vector3)(ref val6)).sqrMagnitude < 0.01f) { val6 = Vector3.right; } tg.t.position = tg.pos + ((Vector3)(ref val6)).normalized * Mathf.Sin(age * 11f + tg.wobble) * 0.22f; tg.t.rotation = Quaternion.Euler(60f + Mathf.Sin(age * 17f + tg.spin) * 50f, tg.spin + age * (float)((tg.style == "spin") ? 900 : 540), Mathf.Sin(age * 13f + tg.spin) * 60f); for (int i = 0; i < 2; i++) { StormFx.Emit(fusePs, tg.t.position + tg.t.up * 0.6f + Random.insideUnitSphere * 0.15f, Random.insideUnitSphere * 0.8f - tg.vel * 0.05f, Random.Range(0.12f, 0.2f), Random.Range(0.16f, 0.28f), Color.white); } } private static float CamTrailFade(Vector3 p) { //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) Camera val = Water03.Cam(); if (!Object.op_Implicit((Object)(object)val)) { return 1f; } return Mathf.SmoothStep(0f, 1f, (Vector3.Distance(((Component)val).transform.position, p) - 3f) / 5f); } private void SparkLand(Tag tg) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 6; i++) { StormFx.Emit(fusePs, tg.pos + Vector3.up * 0.3f, Random.insideUnitSphere * 3f + Vector3.up * 2f, Random.Range(0.1f, 0.2f), Random.Range(0.2f, 0.4f), Color.white); } } private void Detonate(Tag tg, float age) { //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_002e: 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_016a: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: 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_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_01b6: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_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_0201: 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_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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_025d: 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_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) tg.live = false; Vector3 val = TagPos(tg); if (Object.op_Implicit((Object)(object)tg.t)) { ((Component)tg.t).gameObject.SetActive(false); } Vector3 normal; float num = Ground(val, out normal); float num2 = val.y - num; bool flag = (tg.gen > 0 || airField) && !Object.op_Implicit((Object)(object)tg.stuckTo) && num2 > 1.1f; if (flag) { explodedAir++; } else if (Object.op_Implicit((Object)(object)tg.stuckTo)) { explodedStuck++; } else { explodedGround++; } float num3 = ((tg.size > 0f) ? tg.size : 3.2f); bool flag2 = tg.gen < 3 || R() < 0.62f; if (flag2 && tg.gen > 0 && LiveFull() >= ((age >= 2f) ? 5 : 8)) { flag2 = false; } if (flag) { if (flag2) { Spawn(val - Vector3.up * num3 * 0.45f, Vector3.up, num3 * ((tg.gen >= 3) ? 1.15f : 1f), 0f, big: false, air: true, child: true); } else { Pop(val, num3); } } else { Vector3 ground = default(Vector3); ((Vector3)(ref ground))..ctor(val.x, Mathf.Min(val.y, num + 0.2f), val.z); if (Object.op_Implicit((Object)(object)tg.stuckTo)) { ground = val - Vector3.up * num3 * 0.35f; } if (flag2) { Spawn(ground, normal, num3 * ((tg.gen >= 3) ? 1.15f : 1f), 0f, big: false, (Object)(object)tg.stuckTo != (Object)null && num2 > 1.1f, child: true); } else { Pop(val + Vector3.up * 0.5f, num3); } } if (flag2) { fullCount++; } else { popCount++; } int num4 = ChildCount(tg); int num5 = 0; for (int i = 0; i < num4; i++) { if (Fling(tg, val + Vector3.up * 0.3f, age) != null) { num5++; } } recentPops++; if (tg.gen == 0) { Shake(0.8f, 0.4f); lastShake = Time.time; recentPops = 0; } Kit.Log("TANDEM_BURST gen=" + tg.gen + " t=" + age.ToString("0.000") + " h=" + num2.ToString("0.0") + " r=" + Flat(val - center).ToString("0.0") + (flag ? " AIR" : (Object.op_Implicit((Object)(object)tg.stuckTo) ? " STUCK" : " GROUND")) + ((tg.style != null) ? (" " + tg.style) : "") + " size=" + num3.ToString("0.0") + " kids=" + num5 + (flag2 ? " FULL" : " POP") + " liveFull=" + LiveFull()); } private void Pop(Vector3 c, float size) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0157: 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_0167: 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_0171: 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_01d1: 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_01f5: 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_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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) float num = Water03.CameraFade(c, size * 3.2f, 0.12f) * SightFade(c); Vector3 up = Vector3.up; for (int i = 0; i < 6; i++) { Vector3 insideUnitSphere = Random.insideUnitSphere; StormFx.Emit(flamePs, c + insideUnitSphere * size * 0.2f, insideUnitSphere * size * 0.8f + up * size * 0.3f, size * Random.Range(0.35f, 0.7f), Random.Range(0.35f, 0.55f), new Color(1f, 1f, 1f, num)); } if (airField) { if (Random.value < 0.8f) { StormFx.Emit(smokePs, c + Random.insideUnitSphere * size * 0.25f, up * Random.Range(1.5f, 2.5f), size * Random.Range(0.5f, 0.8f) * 0.9f, 0.5f, new Color(1f, 1f, 1f, 0.35f * num)); } } else { for (int j = 0; j < 2; j++) { StormFx.Emit(smokePs, c + Random.insideUnitSphere * size * 0.25f, up * Random.Range(2f, 3.5f), size * Random.Range(0.5f, 0.8f) * 0.6f, Random.Range(3f, 5f), new Color(1f, 1f, 1f, Mathf.Lerp(0.5f, 1f, num) * 0.6f)); } } for (int k = 0; k < 14; k++) { StormFx.Emit(emberPs, c, Random.onUnitSphere * Random.Range(7f, 16f), Random.Range(0.08f, 0.18f), Random.Range(0.35f, 0.9f), Color.white); } if (num > 0.85f) { StormFx.Emit(glowPs, c, Vector3.zero, size * 1.25f, 0.09f, new Color(1f, 0.95f, 0.78f, 0.85f * num)); } } private void Final() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0150: 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_0177: 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_018a: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01de: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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_02a1: 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_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: 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_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_02f4: 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) //IL_0336: 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_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036d: 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_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: 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) //IL_03c7: 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_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_042a: 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_0471: 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_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: 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_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06af: 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_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_0772: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_077a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) Vector3 normal = Vector3.up; Vector3 val = center; if (!airField) { val.y = Ground(val, out normal); } float s = S; float num = Mathf.Max(0.5f, radius / 20f); float num2 = Mathf.Sqrt(num); FireballPool.Ball ball = Spawn(val, normal, 12f * Mathf.Pow(s, 0.5f), 0f, big: true, airField); ball.scorchSize = radius * 1.2f; ball.scorchT.localScale = Vector3.one * ball.scorchSize; Vector3 up = Vector3.up; float num3 = Water03.CameraFade(val + up * 5f, 16f, 0.12f) * SightFade(val + up * 5f); for (int i = 0; i < 3; i++) { StormFx.Emit(glowPs, val + up * (2.5f + 2.5f * (float)i) * num2, Vector3.up * 4f, (8f + 3f * (float)i) * num, 0.32f, new Color(1f, 1f, 0.82f, 0.95f * num3)); } for (int j = 0; j < 16; j++) { Vector2 val2 = Random.insideUnitCircle * 2.5f * num; StormFx.Emit(flamePs, val + new Vector3(val2.x, Random.Range(0f, 3f) * num2, val2.y), up * Random.Range(9f, 14f) * num2 + new Vector3(val2.x, 0f, val2.y) * 0.6f, Random.Range(5f, 8f) * num, Random.Range(0.9f, 1.15f), new Color(1f, 1f, 1f, num3)); } Vector2 insideUnitCircle; for (int k = 0; k < 14; k++) { insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; StormFx.Emit(flamePs, val + up * Random.Range(6f, 9f) * num2 + new Vector3(normalized.x, 0f, normalized.y) * 2.5f * num, new Vector3(normalized.x, 0f, normalized.y) * Random.Range(4f, 7f) * num + up * Random.Range(4f, 7f) * num2, Random.Range(6f, 9f) * num, Random.Range(0.85f, 1.1f), new Color(1f, 1f, 1f, num3)); } for (int l = 0; l < 8; l++) { insideUnitCircle = Random.insideUnitCircle; Vector2 normalized2 = ((Vector2)(ref insideUnitCircle)).normalized; StormFx.Emit(smokePs, val + up * Random.Range(2f, 8f) * num2 + new Vector3(normalized2.x, 0f, normalized2.y) * Random.Range(4.5f, 6.5f) * num, new Vector3(normalized2.x, 0f, normalized2.y) * 3f * num + up * 3f, Random.Range(6f, 8f) * num, 2.5f, new Color(1f, 1f, 1f, 0.55f)); } for (int m = 0; m < 4; m++) { float num4 = (float)(m * 90) + 45f * R(); Vector3 val3 = center + Quaternion.Euler(0f, num4, 0f) * Vector3.forward * radius * (0.1f + 0.15f * R()); if (airField) { val3.y = center.y + (R() - 0.5f) * 6f; } else { val3.y = Ground(val3, out normal); } Spawn(val3, airField ? Vector3.up : normal, (4.5f + 1.5f * R()) * Mathf.Pow(s, 0.2f), 0.05f + 0.13f * R(), big: false, airField); } for (int n = 0; n < 6; n++) { float num5 = (float)(n * 60) + 30f * R(); Vector3 val4 = center + Quaternion.Euler(0f, num5, 0f) * Vector3.forward * radius * (0.8f + 0.08f * R()); if (airField) { val4.y = center.y + (R() - 0.6f) * 5f; } else { val4.y = Ground(val4, out normal) + 0.6f; } Vector3 c = val4; Vector3 val5 = val4 - center; EdgeLick(c, ((Vector3)(ref val5)).normalized, (3.6f + 1.2f * R()) * Mathf.Pow(num, 0.5f)); } for (int num6 = 0; num6 < 3; num6++) { tierT[num6] = Time.time + 0.12f * (float)(num6 + 1); } for (int num7 = 0; num7 < 10; num7++) { Vector2 val6 = Random.insideUnitCircle * radius * 0.32f; secP[num7] = val + new Vector3(val6.x, Random.Range(2f, 9f) * num2, val6.y); secT[num7] = Time.time + 0.06f + 0.44f * ((float)num7 / 9f) + 0.04f * R(); secS[num7] = (3.2f + 1.6f * R()) * Mathf.Pow(num, 0.5f); } finalAt0 = Time.time; columnDone = false; finalGround = val; ((Component)shockR).transform.position = val + up * 0.25f; ((Component)dustR).transform.position = val + up * 0.15f; Transform transform = ((Component)shockR).transform; Quaternion rotation = (((Component)dustR).transform.rotation = Quaternion.identity); transform.rotation = rotation; ((Component)shockR).gameObject.SetActive(true); ((Component)dustR).gameObject.SetActive(!airField); AnimateShock(); int num8 = 0; foreach (Tag tag in tags) { if (tag.live) { num8++; } tag.live = false; if (Object.op_Implicit((Object)(object)tag.t)) { ((Component)tag.t).gameObject.SetActive(false); } } Shake(3.2f, 0.8f); Kit.Log("TANDEM_SUMMARY airburst=" + airField + " radius=" + radius.ToString("0.0") + " tags=" + tags.Count + " perGen=" + string.Join("/", Array.ConvertAll(genCount, (int x) => x.ToString())) + " air=" + explodedAir + " ground=" + explodedGround + " stuck=" + explodedStuck + " unexploded=" + num8 + " full=" + fullCount + " pops=" + popCount + " final=" + (Object.op_Implicit((Object)(object)Run.instance) ? (FixedTimeStamp.now.t - start) : 0f).ToString("0.000")); } private void AnimateShock() { //IL_005f: 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_026e: 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_02e8: 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_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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_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_0177: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: 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_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_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: 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_03dd: Unknown result type (might be due to invalid IL or missing references) if (finalAt0 < 0f || !Object.op_Implicit((Object)(object)shockR)) { return; } float num = Time.time - finalAt0; for (int i = 0; i < 10; i++) { if (secT[i] > 0f && Time.time >= secT[i]) { secT[i] = 0f; Pop(secP[i], secS[i]); } } for (int j = 0; j < 3; j++) { if (tierT[j] > 0f && Time.time >= tierT[j]) { tierT[j] = 0f; float num2 = radius * (0.35f + 0.2f * (float)j); float num3 = Mathf.Sqrt(Mathf.Max(0.5f, radius / 20f)); float num4 = Water03.CameraFade(finalGround + Vector3.up * num2, 16f, 0.12f); for (int k = 0; k < 7; k++) { Vector2 val = Random.insideUnitCircle * 2.6f * num3 * (1.3f - 0.25f * (float)j); StormFx.Emit(flamePs, finalGround + new Vector3(val.x, num2 + Random.Range(-1.5f, 1.5f), val.y), Vector3.up * Random.Range(3f, 5f) + new Vector3(val.x, 0f, val.y) * 0.8f, Random.Range(5f, 7.5f) * num3 * (1.15f - 0.15f * (float)j), Random.Range(0.6f, 0.8f), new Color(1f, 1f, 1f, num4)); } } } float num5 = radius * (0.08f + 0.92f * StormFx.Ease(Mathf.Clamp01(num / 0.25f))); ((Component)shockR).transform.localScale = new Vector3(num5, 1f, num5); ((Component)dustR).transform.localScale = new Vector3(num5, 1f, num5); StormFx.Tint((Renderer)(object)shockR, new Color(1f, 0.82f, 0.55f, 0.95f * (1f - Mathf.Clamp01((num - 0.22f) / 0.3f)))); StormFx.Tint((Renderer)(object)dustR, new Color(0.42f, 0.36f, 0.3f, 0.4f * (1f - Mathf.Clamp01((num - 0.25f) / 0.55f)))); if (!columnDone && num >= 0.2f) { columnDone = true; for (int l = 0; l < 10; l++) { Vector2 val2 = Random.insideUnitCircle * radius * 0.1f; StormFx.Emit(smokePs, finalGround + new Vector3(val2.x, (8f + (float)l * 1.7f) * Mathf.Sqrt(Mathf.Max(0.5f, radius / 20f)), val2.y), Vector3.up * Random.Range(7f, 11f), Random.Range(7f, 10f) * (1f + (float)l * 0.05f), Random.Range(5f, 6.5f), new Color(1f, 1f, 1f, 0.9f)); } } if (num > 0.9f) { ((Component)shockR).gameObject.SetActive(false); ((Component)dustR).gameObject.SetActive(false); } } private void Shake(float amplitude, float duration) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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_0082: Expected O, but got Unknown GameObject val = new GameObject("Tobirama tandem shake"); val.transform.position = center; ShakeEmitter obj = val.AddComponent(); obj.wave = new Wave { amplitude = amplitude, frequency = 26f, cycleOffset = 0f }; obj.duration = duration; obj.radius = radius * 4.5f; obj.amplitudeTimeDecay = true; obj.shakeOnStart = true; Object.Destroy((Object)val, duration + 0.2f); } private FireballPool.Ball Spawn(Vector3 ground, Vector3 normal, float size, float lag, bool big = false, bool air = false, bool child = false) { //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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: 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_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_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_010e: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0224: 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_024b: 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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_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_0277: 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_02bb: 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_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: 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_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: 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_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: 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_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0334: 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_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: 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_04f6: 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_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0551: 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_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) FireballPool.Ball ball = FireballPool.Rent(); ball.root.SetActive(true); ball.active = true; ball.scorchActive = !air; ball.air = air; ball.born = Time.time + lag; ball.scorchBorn = ball.born; ball.size = size; ball.ringMax = 0f; ball.ground = ground; ball.normal = normal; ball.child = child; ball.root.transform.position = ground; ball.root.transform.rotation = Quaternion.identity; ((Component)ball.scorchT).gameObject.SetActive(!air); ball.scorchT.position = ground + normal * 0.05f; Transform scorchT = ball.scorchT; Vector3 val = -normal; Vector3 val2 = Vector3.Cross(normal, Vector3.right); scorchT.rotation = Quaternion.LookRotation(val, (((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? Vector3.Cross(normal, Vector3.right) : Vector3.forward); ball.scorchT.localScale = Vector3.one * (big ? 13f : (size * 0.6f)); StormFx.Tint((Renderer)(object)ball.scorch, new Color(1f, 1f, 1f, 0f)); ((Renderer)ball.ring).enabled = false; balls.Add(ball); FireballPool.Live++; FireballPool.Peak = Mathf.Max(FireballPool.Peak, FireballPool.Live); Animate(ball); Vector3 up = Vector3.up; Vector3 val3 = ground + up * size * 0.45f; float num = Water03.CameraFade(val3, size * 3.2f, 0.12f) * SightFade(val3); if (num > 0.9f) { StormFx.Emit(glowPs, val3, Vector3.zero, size * 1f, 0.28f, new Color(1f, 1f, 1f, 0.55f * num)); } int num2 = ((!big) ? 10 : 0); for (int i = 0; i < num2; i++) { Vector3 insideUnitSphere = Random.insideUnitSphere; insideUnitSphere.y = Mathf.Abs(insideUnitSphere.y) * 0.8f + 0.2f; StormFx.Emit(flamePs, val3 + insideUnitSphere * size * 0.28f, insideUnitSphere * size * 0.9f + up * size * 0.5f, size * Random.Range(0.45f, 1f), Random.Range(0.5f, 0.8f), new Color(1f, 1f, 1f, num)); } int num3 = ((!big) ? ((airField && air) ? 2 : 5) : 0); for (int j = 0; j < num3; j++) { Vector3 insideUnitSphere2 = Random.insideUnitSphere; insideUnitSphere2.y = Mathf.Abs(insideUnitSphere2.y); float num4 = (child ? 0.6f : 1f); if (airField && air) { StormFx.Emit(smokePs, val3 + insideUnitSphere2 * size * 0.3f + up * size * 0.3f, up * Random.Range(1.5f, 3f) + insideUnitSphere2 * 0.8f, size * Random.Range(0.7f, 1.05f) * num4 * 1.5f, 0.5f, new Color(1f, 1f, 1f, 0.35f * num)); } else { StormFx.Emit(smokePs, val3 + insideUnitSphere2 * size * 0.3f + up * size * 0.3f, up * Random.Range(2.6f, 4.6f) + insideUnitSphere2 * 0.8f, size * Random.Range(0.7f, 1.05f) * num4, Random.Range(4.5f, 7f), new Color(1f, 1f, 1f, Mathf.Lerp(0.5f, 1f, num) * num4)); } } int num5 = (big ? 70 : 14); for (int k = 0; k < num5; k++) { Vector3 insideUnitSphere3 = Random.insideUnitSphere; insideUnitSphere3.y = Mathf.Abs(insideUnitSphere3.y) + 0.3f; StormFx.Emit(emberPs, val3, ((Vector3)(ref insideUnitSphere3)).normalized * Random.Range(6f, 18f) * (big ? (1.5f * Mathf.Sqrt(S)) : 1f), Random.Range(0.08f, 0.2f), Random.Range(0.5f, 1.3f), Color.white); } int num6 = ((!air) ? (big ? 36 : 5) : 0); for (int l = 0; l < num6; l++) { Vector3 insideUnitSphere4 = Random.insideUnitSphere; insideUnitSphere4.y = Mathf.Abs(insideUnitSphere4.y) + 0.6f; StormFx.Emit(debrisPs, ground + up * 0.4f, ((Vector3)(ref insideUnitSphere4)).normalized * Random.Range(7f, 15f) * (big ? Mathf.Sqrt(S) : 1f), Random.Range(0.25f, 0.6f), Random.Range(1f, 1.6f), Color.white); } return ball; } private void EdgeLick(Vector3 c, Vector3 outward, float size) { //IL_0013: 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_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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) outward.y = 0f; ((Vector3)(ref outward)).Normalize(); float num = Water03.CameraFade(c, size * 3.2f, 0.12f) * SightFade(c); Vector3 val; for (int i = 0; i < 4; i++) { val = outward + Random.insideUnitSphere * 0.5f + Vector3.up * 0.5f; Vector3 normalized = ((Vector3)(ref val)).normalized; StormFx.Emit(flamePs, c + normalized * size * 0.2f, normalized * size * 1.1f, size * Random.Range(0.6f, 1f), Random.Range(0.22f, 0.28f), new Color(1f, 1f, 1f, num)); } for (int j = 0; j < 5; j++) { ParticleSystem ps = emberPs; val = outward + Random.onUnitSphere * 0.6f + Vector3.up * 0.4f; StormFx.Emit(ps, c, ((Vector3)(ref val)).normalized * Random.Range(8f, 16f), Random.Range(0.08f, 0.18f), Random.Range(0.4f, 0.9f), Color.white); } } private bool Animate(FireballPool.Ball b) { //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_030e: 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_03ca: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - b.born; float num2 = ((b.size > 10f) ? 1.5f : (b.child ? 0.65f : 0.8f)); if (b.active) { if (num < 0f) { b.root.SetActive(false); } else { b.root.SetActive(true); float num3 = StormFx.Ease(num / 0.22f); float num4 = num * b.size * 0.18f; Mathf.Clamp01((num - 0.3f) / (num2 - 0.3f)); float num5 = Water03.CameraFade(b.ground + Vector3.up * b.size * 0.4f, b.size * 3.2f, 0.1f) * SightFade(b.ground + Vector3.up * b.size * 0.4f); Transform transform = ((Component)b.dome).transform; transform.localPosition = Vector3.up * (b.size * 0.38f + num4); transform.localScale = new Vector3(1f + 0.12f * Mathf.Sin(num * 9f), 1.12f, 1f - 0.1f * Mathf.Sin(num * 7f)) * b.size * 0.56f * (0.35f + 0.65f * num3); transform.localRotation = Quaternion.Euler(0f, num * 40f, 0f); Color val = Color.Lerp(new Color(1f, 0.78f, 0.45f), new Color(0.7f, 0.16f, 0.03f), Mathf.Clamp01(num / (num2 * 0.6f))); val.a = 0f; ((Renderer)b.dome).enabled = false; StormFx.Scroll((Renderer)(object)b.dome, new Vector2(num * 0.25f, (0f - num) * 0.6f), Vector2.one); Transform transform2 = ((Component)b.inner).transform; transform2.localPosition = transform.localPosition; transform2.localScale = transform.localScale * 0.5f; StormFx.Tint((Renderer)(object)b.inner, new Color(1f, 0.8f, 0.5f, ((num5 > 0.9f) ? 0.3f : 0f) * Mathf.Clamp01(1f - num / 0.2f) * num5)); Transform transform3 = ((Component)b.ring).transform; transform3.localPosition = Vector3.up * 0.15f; if (b.ringMax > 0f) { transform3.localScale = new Vector3(1f, 0.5f, 1f) * b.ringMax * (0.12f + 0.88f * StormFx.Ease(num / 0.36f)); StormFx.Tint((Renderer)(object)b.ring, new Color(1f, 0.72f, 0.42f, 0.62f * Mathf.Clamp01(1f - (num - 0.3f) / 0.4f))); } else { transform3.localScale = Vector3.one * b.size * (0.3f + 1.1f * StormFx.Ease(num / 0.4f)); StormFx.Tint((Renderer)(object)b.ring, new Color(1f, 0.7f, 0.4f, (b.air ? 0f : 0.3f) * Mathf.Clamp01(1f - num / 0.4f) * num5)); } if (num > num2) { b.active = false; b.root.SetActive(false); FireballPool.Live--; } } } if (b.scorchActive) { float num6 = Time.time - b.scorchBorn; float num7 = Mathf.Clamp01(num6 / 0.25f) * 0.55f * (1f - Mathf.Clamp01((num6 - 1.5f) / 4.5f)); StormFx.Tint((Renderer)(object)b.scorch, new Color(1f, 1f, 1f, num7)); if (num6 > 6.2f) { b.scorchActive = false; ((Component)b.scorchT).gameObject.SetActive(false); } } if (!b.active) { return b.scorchActive; } return true; } private void End() { foreach (FireballPool.Ball ball in balls) { if (ball.active) { FireballPool.Live--; } ball.active = false; ball.scorchActive = false; if (Object.op_Implicit((Object)(object)ball.root)) { ball.root.SetActive(false); } if (Object.op_Implicit((Object)(object)ball.scorchT)) { ((Component)ball.scorchT).gameObject.SetActive(false); } } balls.Clear(); Transform[] array = pool; foreach (Transform val in array) { if (Object.op_Implicit((Object)(object)val)) { val.SetParent(((Component)this).transform, false); ((Component)val).gameObject.SetActive(false); } } tags.Clear(); ParticleSystem[] array2 = (ParticleSystem[])(object)new ParticleSystem[6] { glowPs, flamePs, emberPs, smokePs, debrisPs, fusePs }; for (int i = 0; i < array2.Length; i++) { array2[i].Stop(true, (ParticleSystemStopBehavior)0); } initialized = false; if (key != null && fields.ContainsKey(key) && (Object)(object)fields[key] == (Object)(object)this) { fields.Remove(key); } key = null; Object.Destroy((Object)(object)((Component)this).gameObject); } } public static class TeleportMirror { public static void Arrive(CharacterBody body) { if (NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { return; } Visual componentInChildren = ((Component)body.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { Afterimage.Spawn(componentInChildren); if (!componentInChildren.skillOverride) { componentInChildren.Play((Object.op_Implicit((Object)(object)body.characterMotor) && body.characterMotor.isGrounded) ? "Land_Heavy" : "Air_Apex", 1.2f, 0f, restart: true, 0.03f); componentInChildren.lockUntil = Time.time + 0.25f; } } } } public static class TobiAudio { public static GameObject cue; public static ConfigEntry VoiceLevel; public static ConfigEntry PrepLevel; public static ConfigEntry EffectLevel; private static uint serial; public static void Init(ConfigFile c) { //IL_014b: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_0180: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown SoundBanks.Add(File.ReadAllBytes(Path.Combine(Visual.Assets, "Audio", "TobiramaShadow0161.bnk"))); VoiceLevel = c.Bind("Audio", "VoiceVolume", 1f, "Voice gain, 0..2. Pitch and playback speed are unchanged."); PrepLevel = c.Bind("Audio", "PreparationVolume", 0.72f, "Independent preparation gain, 0..2."); EffectLevel = c.Bind("Audio", "EffectsVolume", 0.8f, "Shared kunai and teleport effect gain, 0..2."); SoundBanks.Add(File.ReadAllBytes(Path.Combine(Visual.Assets, "Audio", "TobiramaFinal01.bnk"))); SoundBanks.Add(File.ReadAllBytes(Path.Combine(Visual.Assets, "Audio", "TobiramaSelection015.bnk"))); SoundBanks.Add(File.ReadAllBytes(Path.Combine(Visual.Assets, "Audio", "TobiramaMelee04.bnk"))); SoundBanks.Add(File.ReadAllBytes(Path.Combine(Visual.Assets, "Audio", "TobiramaHit10.bnk"))); string[] array = new string[2] { "char_treeBot", "char_Huntress" }; foreach (string text in array) { SoundBanks.Add(File.ReadAllBytes(Path.Combine(Application.streamingAssetsPath, "Audio/GeneratedSoundBanks/Windows", text + ".bnk"))); } GameObject val = new GameObject("TobiramaAudioCue"); val.AddComponent(); val.AddComponent().DoNotPool = true; val.AddComponent(); cue = PrefabAPI.InstantiateClone(val, "TobiramaAudioCue", false); Object.DestroyImmediate((Object)val); KitVfx.effects.Add(new EffectDef(cue)); Kit.WaterReleased = (Action)Delegate.Combine(Kit.WaterReleased, (Action)delegate(CharacterBody b, Vector3 p) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Send(b, 4, p); }); Kit.WaterImpacted = (Action)Delegate.Combine(Kit.WaterImpacted, (Action)delegate(CharacterBody b, Vector3 p) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Send(b, 5, p); }); } public static void Send(CharacterBody b, int kind, Vector3? point = null) { //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_0035: 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_003f: 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_0064: Expected O, but got Unknown if (NetworkServer.active && Object.op_Implicit((Object)(object)b)) { bool flag = VoiceLoadout.Get(b) == VoiceLoadout.Lang.Japanese; EffectData val = new EffectData { origin = (Vector3)(((??)point) ?? b.corePosition), genericUInt = ++serial, genericFloat = kind + (flag ? 16 : 0) }; val.SetNetworkedObjectReference(((Component)b).gameObject); EffectManager.SpawnEffect(cue, val, true); Kit.Log("AUDIO_SEND kind=" + kind + " skin=" + b.skinIndex + " voice=" + (flag ? "JP" : "EN") + " serial=" + serial + " time=" + Time.time); } } } public class TobiAudioCue : MonoBehaviour { private IEnumerator Start() { EffectData d = ((Component)this).GetComponent().effectData; GameObject owner = null; for (int i = 0; i < 10; i++) { if (Object.op_Implicit((Object)(object)owner)) { break; } owner = d.ResolveNetworkedObjectReference(); if (!Object.op_Implicit((Object)(object)owner)) { yield return null; } } if (Object.op_Implicit((Object)(object)owner)) { (owner.GetComponent() ?? owner.AddComponent()).Receive((int)d.genericFloat, d.genericUInt, d.origin); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class TobiVoice : MonoBehaviour { private CharacterBody body; private uint last; private uint voice; private uint prep; private float speechAt = -1f; private float voiceUntil; private string pending; private bool pendingJapanese; private GameObject voiceEmitter; private GameObject prepEmitter; private bool local; private bool lastRaijin; private static bool VerboseMedia { get { if (KitTuning.Verbose != null) { return KitTuning.Verbose.Value; } return false; } } private void Awake() { body = ((Component)this).GetComponent(); local = Object.op_Implicit((Object)(object)body) && body.isPlayerControlled && Util.HasEffectiveAuthority(((Component)this).gameObject); voiceEmitter = Emitter("Voice"); prepEmitter = Emitter("Preparation"); } private GameObject Emitter(string label) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown GameObject val = new GameObject("Tobirama " + label); val.transform.SetParent(((Component)this).transform, false); val.AddComponent(); return val; } private static void Stop(ref uint id, int fade = 60) { if (id != 0) { AkSoundEngine.StopPlayingID(id, fade); } id = 0u; } private uint Play(string name, GameObject emitter, float level) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.SetGameObjectOutputBusVolume(emitter, (GameObject)null, Mathf.Clamp(level, 0f, 2f)); uint result = AkSoundEngine.PostEvent("Play_TBF01_" + name + (local ? "_local" : ""), emitter); Kit.Log("AUDIO_PLAY " + name + " id=" + result + " time=" + Time.time); return result; } public void Receive(int packed, uint sequence, Vector3 point) { //IL_00b7: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01dd: 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_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_0223: Unknown result type (might be due to invalid IL or missing references) if (sequence <= last) { return; } last = sequence; bool flag = packed >= 16; int num = packed % 16; switch (num) { case 0: case 1: lastRaijin = false; Stop(ref prep); Stop(ref voice); prep = Play("prep", prepEmitter, TobiAudio.PrepLevel.Value); pending = (flag ? "jp_" : "en_") + ((num == 0) ? "water" : "tags"); pendingJapanese = flag; speechAt = Time.time + 0.1f; break; case 2: OneShot("whoosh", point, supplied: true); break; case 3: TeleportMirror.Arrive(body); OneShot("Play_huntress_shift_start", point, supplied: false); if (!lastRaijin || Time.time >= voiceUntil) { lastRaijin = true; Stop(ref voice); speechAt = -1f; voice = Play(flag ? "jp_raijin" : "en_raijin", voiceEmitter, TobiAudio.VoiceLevel.Value); voiceUntil = Time.time + (flag ? 2.55f : 2.841f); } else { Kit.Log("AUDIO_RAIJIN_COALESCED second successful teleport; effect retained"); } break; case 4: OneShot("Play_treeBot_m2_launch", point, supplied: false); break; case 5: OneShot("Play_treeBot_m2_impact", point, supplied: false); break; case 6: OneShot("Play_lemurianBruiser_m1_explode", point, supplied: false); break; case 8: OneShot("Play_TBM04_swing1", point, supplied: false); break; case 11: OneShot("Play_TBM04_swing2", point, supplied: false); break; case 12: OneShot("Play_TBM04_swing3", point, supplied: false); break; case 9: OneShot("Play_TBM04_hit1", point, supplied: false); break; case 13: OneShot("Play_TBM04_hit2", point, supplied: false); break; case 10: OneShot("Play_TBM04_hit3", point, supplied: false); break; case 14: OneShot("Play_TBM04_hit3", point, supplied: false); OneShot("Play_TBM04_hit1", point, supplied: false); break; case 7: speechAt = -1f; Stop(ref prep); Stop(ref voice); voiceUntil = 0f; break; } } private void OneShot(string name, Vector3 p, bool supplied) { //IL_001e: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown GameObject val = Emitter("Shared effect"); val.transform.SetParent((Transform)null); val.transform.position = p; if (supplied) { uint num = Play(name, val, TobiAudio.EffectLevel.Value); } else { AkSoundEngine.SetGameObjectOutputBusVolume(val, (GameObject)null, Mathf.Clamp(TobiAudio.EffectLevel.Value * (name.Contains("explode") ? 0.4f : 1f), 0f, 2f)); uint num = ((VerboseMedia && name.StartsWith("Play_TBM04_")) ? AkSoundEngine.PostEvent(name, val, 8u, new EventCallback(MediaLog), (object)name) : AkSoundEngine.PostEvent(name, val)); Kit.Log("AUDIO_SFX " + name + " id=" + num + " time=" + Time.time); } Object.Destroy((Object)(object)val, 3f); } private static void MediaLog(object cookie, AkCallbackType type, AkCallbackInfo info) { AkDurationCallbackInfo val = (AkDurationCallbackInfo)(object)((info is AkDurationCallbackInfo) ? info : null); if (val != null) { Kit.Log("AUDIO_MEDIA " + cookie?.ToString() + " duration=" + val.fDuration.ToString("0") + "ms mediaId=" + val.mediaID); } } private void Update() { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { speechAt = -1f; Stop(ref voice); Stop(ref prep); } else if (speechAt >= 0f && Time.time >= speechAt) { speechAt = -1f; voice = Play(pending, voiceEmitter, TobiAudio.VoiceLevel.Value); voiceUntil = Time.time + ((!pending.EndsWith("water")) ? (pendingJapanese ? 2.76f : 2.43f) : (pendingJapanese ? 3.96f : 3.2f)); } } private void OnDisable() { speechAt = -1f; Stop(ref voice); Stop(ref prep); } } public static class FinalIcons { public static Sprite LoadNamed(string name) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0057: 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) Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, File.ReadAllBytes(Path.Combine(Visual.Assets, "Icons", name + ".png"))); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } public static Sprite Load(int index) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0080: 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) string[] array = new string[4] { "Primary", "WaterDragon", "FlyingRaijin", "TandemBombs" }; Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, File.ReadAllBytes(Path.Combine(Visual.Assets, "Icons", array[index] + ".png"))); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } } public class TobiItemDisplays : MonoBehaviour { public ItemDisplayRuleSet originalRules; private CharacterModel model; private float until; public static void Install(GameObject root) { CharacterModel component = root.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { (root.GetComponent() ?? root.AddComponent()).originalRules = component.itemDisplayRuleSet; component.itemDisplayRuleSet = null; } } private void Start() { model = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)originalRules)) { originalRules = model.itemDisplayRuleSet; } model.itemDisplayRuleSet = null; until = Time.time + 2f; BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; typeof(CharacterModel).GetMethod("DisableAllItemDisplays", bindingAttr)?.Invoke(model, null); if (Object.op_Implicit((Object)(object)model.body) && Object.op_Implicit((Object)(object)model.body.inventory)) { typeof(CharacterModel).GetMethod("SetEquipmentDisplay", bindingAttr)?.Invoke(model, new object[1] { (object)(EquipmentIndex)(-1) }); } RemoveExisting(); } private void RemoveExisting() { ItemDisplay[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (ItemDisplay val in componentsInChildren) { if ((Object)(object)((Component)val).gameObject != (Object)(object)((Component)this).gameObject) { ((Component)val).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)val).gameObject); } } } private void LateUpdate() { if (Object.op_Implicit((Object)(object)model)) { model.itemDisplayRuleSet = null; } if (Time.time < until) { RemoveExisting(); } } } public class TobiRagdoll : MonoBehaviour { private static readonly Queue live = new Queue(); public Rigidbody[] pieces; private float born; private float still; private bool frozen; public unsafe static void Spawn(CharacterBody body, Visual visual) { //IL_0048: 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_0040: 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_006f: 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_009c: 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_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Expected O, but got Unknown //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0554: 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_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: 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_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0679: 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_06c1: 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_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08c0: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: 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_0749: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0927: Unknown result type (might be due to invalid IL or missing references) //IL_093e: 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_0777: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)visual) || !Object.op_Implicit((Object)(object)visual.player) || Object.op_Implicit((Object)(object)((Component)visual).GetComponent())) { return; } TobiramaRemoteMotion tobiramaRemoteMotion = TobiramaRemoteMotion.For(body); Vector3 val = (Object.op_Implicit((Object)(object)tobiramaRemoteMotion) ? Vector3.ClampMagnitude(tobiramaRemoteMotion.Velocity, 9f) : Vector3.zero); visual.player.Stop(); GameObject val2 = Object.Instantiate(((Component)visual).gameObject, ((Component)visual).transform.position, ((Component)visual).transform.rotation); ((Object)val2).name = "Tobirama ragdoll"; val2.transform.localScale = ((Component)visual).transform.lossyScale; Visual component = val2.GetComponent(); ((Behaviour)component).enabled = false; Animation component2 = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.Stop(); ((Behaviour)component2).enabled = false; } Collider[] componentsInChildren = val2.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } TobiRagdoll tobiRagdoll = val2.AddComponent(); tobiRagdoll.born = Time.time; val2.SetActive(true); Renderer[] componentsInChildren2 = val2.GetComponentsInChildren(true); foreach (Renderer obj in componentsInChildren2) { obj.enabled = true; obj.forceRenderingOff = false; } Dictionary nodes = new Dictionary(); Transform[] bones = component.bones; foreach (Transform val3 in bones) { if (Object.op_Implicit((Object)(object)val3) && !nodes.ContainsKey(((Object)val3).name)) { nodes[((Object)val3).name] = val3; } } string[] array = new string[11] { "spine", "spine.002", "spine.006", "upper_arm.L", "forearm.L", "upper_arm.R", "forearm.R", "thigh.L", "shin.L", "thigh.R", "shin.R" }; if (array.Any((string n) => !nodes.ContainsKey(n))) { Object.Destroy((Object)(object)val2); Kit.Log("RAGDOLL skipped: missing bones"); return; } Dictionary dictionary = new Dictionary(); string[] array2 = array; foreach (string text in array2) { Transform val4 = nodes[text]; ((Component)val4).gameObject.layer = LayerIndex.debris.intVal; Rigidbody val5 = ((Component)val4).gameObject.AddComponent(); int num; switch (text) { default: num = (text.StartsWith("thigh") ? 4 : 2); break; case "spine.006": num = 4; break; case "spine": case "spine.002": num = 10; break; } val5.mass = num; val5.drag = 0.2f; val5.angularDrag = 1.5f; val5.maxAngularVelocity = 9f; val5.maxDepenetrationVelocity = 3f; val5.interpolation = (RigidbodyInterpolation)1; val5.collisionDetectionMode = (CollisionDetectionMode)2; val5.solverIterations = 12; val5.solverVelocityIterations = 4; val5.sleepThreshold = 0.08f; dictionary[text] = val5; string text2 = (text.StartsWith("upper_arm") ? text.Replace("upper_arm", "forearm") : (text.StartsWith("forearm") ? text.Replace("forearm", "hand") : (text.StartsWith("thigh") ? text.Replace("thigh", "shin") : (text.StartsWith("shin") ? text.Replace("shin", "foot") : ((text == "spine") ? "spine.002" : ((text == "spine.002") ? "spine.004" : null)))))); float num2 = Mathf.Max(0.0001f, val4.lossyScale.x); GameObject val6 = new GameObject("Ragdoll collider"); val6.layer = LayerIndex.debris.intVal; val6.transform.SetParent(val4, false); float num3 = text switch { "spine" => 0.15f, "spine.002" => 0.17f, "spine.006" => 0.14f, _ => text.StartsWith("thigh") ? 0.09f : (text.StartsWith("shin") ? 0.07f : 0.06f), } / num2; if (text2 != null && nodes.ContainsKey(text2)) { Vector3 val7 = val4.InverseTransformPoint(nodes[text2].position); val6.transform.localPosition = val7 * 0.5f; val6.transform.localRotation = Quaternion.FromToRotation(Vector3.up, ((Vector3)(ref val7)).normalized); CapsuleCollider obj2 = val6.AddComponent(); obj2.direction = 1; obj2.radius = num3; obj2.height = Mathf.Max(num3 * 2f, ((Vector3)(ref val7)).magnitude * 0.94f); } else { val6.transform.localPosition = val4.InverseTransformDirection(Vector3.up) * (0.11f / num2); val6.AddComponent().radius = num3; } } foreach (KeyValuePair item in dictionary) { if (!(item.Key == "spine")) { Transform ancestor = ((Component)item.Value).transform.parent; while (Object.op_Implicit((Object)(object)ancestor) && !dictionary.Values.Any((Rigidbody rb) => (Object)(object)((Component)rb).transform == (Object)(object)ancestor)) { ancestor = ancestor.parent; } if (!Object.op_Implicit((Object)(object)ancestor)) { ancestor = nodes["spine"]; } bool flag = item.Key.StartsWith("shin") || item.Key.StartsWith("forearm"); CharacterJoint obj3 = ((Component)item.Value).gameObject.AddComponent(); ((Joint)obj3).connectedBody = ((Component)ancestor).GetComponent(); ((Joint)obj3).anchor = Vector3.zero; ((Joint)obj3).autoConfigureConnectedAnchor = true; ((Joint)obj3).enableCollision = false; ((Joint)obj3).enablePreprocessing = false; obj3.enableProjection = true; obj3.projectionDistance = 0.03f; obj3.projectionAngle = 8f; ((Joint)obj3).axis = Vector3.right; obj3.swingAxis = Vector3.forward; SoftJointLimit val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = (flag ? (-5) : (-30)); obj3.lowTwistLimit = val8; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = (flag ? 5 : 30); obj3.highTwistLimit = val8; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = (flag ? 70 : ((item.Key == "spine.006") ? 35 : 45)); obj3.swing1Limit = val8; val8 = default(SoftJointLimit); ((SoftJointLimit)(ref val8)).limit = (flag ? 8 : ((item.Key == "spine.006") ? 25 : 30)); obj3.swing2Limit = val8; } } Collider[] array3 = (from c in val2.GetComponentsInChildren() where c.enabled select c).ToArray(); componentsInChildren = array3; foreach (Collider val9 in componentsInChildren) { Collider[] array4 = array3; foreach (Collider val10 in array4) { if ((Object)(object)val9 != (Object)(object)val10) { Physics.IgnoreCollision(val9, val10, true); } } } foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (!Object.op_Implicit((Object)(object)readOnlyInstances)) { continue; } componentsInChildren = ((Component)readOnlyInstances).GetComponentsInChildren(); foreach (Collider val11 in componentsInChildren) { Collider[] array4 = array3; for (int num4 = 0; num4 < array4.Length; num4++) { Physics.IgnoreCollision(array4[num4], val11, true); } } } tobiRagdoll.pieces = dictionary.Values.ToArray(); Vector3 val12 = -(Object.op_Implicit((Object)(object)body.characterDirection) ? body.characterDirection.forward : ((Component)visual).transform.forward); Rigidbody[] array5 = tobiRagdoll.pieces; for (int i = 0; i < array5.Length; i++) { array5[i].velocity = val; } dictionary["spine.002"].AddForce(val12 * 1.6f + Vector3.up * 0.4f, (ForceMode)2); dictionary["spine.006"].AddForce(val12 * 2.2f, (ForceMode)2); ((Component)visual).gameObject.SetActive(false); live.Enqueue(tobiRagdoll); while (live.Count > 4) { TobiRagdoll tobiRagdoll2 = live.Dequeue(); if (Object.op_Implicit((Object)(object)tobiRagdoll2)) { Object.Destroy((Object)(object)((Component)tobiRagdoll2).gameObject); } } string[] obj4 = new string[6] { "RAGDOLL created bodies=", tobiRagdoll.pieces.Length.ToString(), " at=", ((object)((Component)visual).transform.position/*cast due to .constrained prefix*/).ToString(), " velocity=", null }; Vector3 val13 = val; obj4[5] = ((object)(*(Vector3*)(&val13))/*cast due to .constrained prefix*/).ToString(); Kit.Log(string.Concat(obj4)); } private void FixedUpdate() { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_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) if (frozen || pieces == null) { return; } float num = Time.time - born; if (num < 1.5f) { return; } bool flag = true; Rigidbody[] array = pieces; Vector3 val2; foreach (Rigidbody val in array) { if (!Object.op_Implicit((Object)(object)val)) { continue; } val2 = val.velocity; if (!(((Vector3)(ref val2)).sqrMagnitude > 0.04f)) { val2 = val.angularVelocity; if (!(((Vector3)(ref val2)).sqrMagnitude > 0.25f)) { continue; } } flag = false; break; } still = (flag ? (still + Time.fixedDeltaTime) : 0f); if (!(still > 0.4f) && !(num > 6f)) { return; } frozen = true; array = pieces; foreach (Rigidbody val3 in array) { if (Object.op_Implicit((Object)(object)val3)) { val3.velocity = Vector3.zero; val3.angularVelocity = Vector3.zero; val3.isKinematic = true; } } string text = num.ToString("0.00"); object obj; if (!Object.op_Implicit((Object)(object)pieces[0])) { obj = "?"; } else { val2 = pieces[0].position; obj = ((Vector3)(ref val2)).ToString("F2"); } Kit.Log("RAGDOLL settled age=" + text + " pelvis=" + (string?)obj); } private void Update() { if (Time.time - born > 12f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class TobiramaPack { private sealed class Planes { private readonly byte[] b; private readonly int baseAt; private readonly int total; private readonly int[] start; private readonly int[] len; private readonly int[] stride; public Planes(BinaryReader r, byte[] bytes, int[] len, int[] stride) { total = r.ReadInt32(); baseAt = (int)r.BaseStream.Position; if (baseAt + 4L * (long)total > bytes.Length) { throw new EndOfStreamException("TobiramaModels.bin"); } r.BaseStream.Position = baseAt + 4L * (long)total; b = bytes; this.len = len; this.stride = stride; start = new int[len.Length]; int num = 0; for (int i = 0; i < len.Length; i++) { start[i] = num; num += len[i]; } if (num != total) { throw new InvalidDataException("TobiramaModels.bin: pool size"); } } public void Decode(int e, Array dst) { int num = len[e]; int num2 = stride[e]; int num3 = start[e]; uint[] array = new uint[num]; for (int i = 0; i < num; i++) { int num4 = baseAt + num3 + i; array[i] = (uint)(b[num4] | (b[num4 + total] << 8) | (b[num4 + 2 * total] << 16) | (b[num4 + 3 * total] << 24)); } if (num2 > 0) { for (int j = num2; j < num; j++) { array[j] += array[j - num2]; } } Buffer.BlockCopy(array, 0, dst, 0, num * 4); } } public const string FileName = "TobiramaModels.bin"; public static ModelData Model(string jsonName) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(jsonName); if (!Load(Path.Combine(Visual.Assets, "TobiramaModels.bin"), fileNameWithoutExtension).TryGetValue(fileNameWithoutExtension, out var value)) { throw new InvalidDataException("TobiramaModels.bin: model missing: " + fileNameWithoutExtension); } return value; } public static Dictionary Load(string file, string only = null) { byte[] array = File.ReadAllBytes(file); using BinaryReader binaryReader = new BinaryReader(new MemoryStream(array, writable: false), Encoding.UTF8); if (binaryReader.ReadByte() != 89 || binaryReader.ReadByte() != 83 || binaryReader.ReadByte() != 80 || binaryReader.ReadByte() != 49) { throw new InvalidDataException("TobiramaModels.bin: bad magic"); } int num = binaryReader.ReadInt32(); if (num != 1) { throw new InvalidDataException("TobiramaModels.bin: version " + num); } ReadHeads(binaryReader, out var fLen, out var stride); ReadHeads(binaryReader, out var iLen, out var stride2); Planes fPlanes = new Planes(binaryReader, array, fLen, stride); Planes iPlanes = new Planes(binaryReader, array, iLen, stride2); float[][] fPool = new float[fLen.Length][]; int[][] iPool = new int[iLen.Length][]; Dictionary dictionary = new Dictionary(); int num2 = binaryReader.ReadInt32(); for (int i = 0; i < num2; i++) { string text = binaryReader.ReadString(); bool flag = only == null || text == only; ModelData modelData = new ModelData(); modelData.bones = new BoneData[binaryReader.ReadInt32()]; for (int j = 0; j < modelData.bones.Length; j++) { BoneData boneData = new BoneData { name = binaryReader.ReadString(), parent = binaryReader.ReadInt32() }; boneData.rest = new PoseData { p = Floats(binaryReader, 3), q = Floats(binaryReader, 4), s = Floats(binaryReader, 3) }; modelData.bones[j] = boneData; } modelData.meshes = new MeshData[binaryReader.ReadInt32()]; for (int k = 0; k < modelData.meshes.Length; k++) { MeshData meshData = new MeshData { name = binaryReader.ReadString() }; if (binaryReader.ReadByte() != 0) { meshData.texture = binaryReader.ReadString(); } meshData.color = Floats(binaryReader, binaryReader.ReadInt32()); int index = binaryReader.ReadInt32(); int index2 = binaryReader.ReadInt32(); int index3 = binaryReader.ReadInt32(); int index4 = binaryReader.ReadInt32(); int index5 = binaryReader.ReadInt32(); int index6 = binaryReader.ReadInt32(); if (flag) { meshData.v = CopyF(F, index); meshData.n = CopyF(F, index2); meshData.uv = CopyF(F, index3); meshData.bw = CopyF(F, index4); meshData.bi = CopyI(I, index5); meshData.tri = CopyI(I, index6); } modelData.meshes[k] = meshData; } modelData.clips = new ClipData[binaryReader.ReadInt32()]; for (int l = 0; l < modelData.clips.Length; l++) { ClipData clipData = new ClipData { name = binaryReader.ReadString(), duration = binaryReader.ReadSingle(), loop = (binaryReader.ReadByte() != 0) }; int num3 = binaryReader.ReadInt32(); int num4 = binaryReader.ReadInt32(); if (flag) { clipData.frames = new FrameData[num3]; for (int m = 0; m < num3; m++) { FrameData frameData = new FrameData { bones = new PoseData[num4] }; for (int n = 0; n < num4; n++) { frameData.bones[n] = new PoseData { p = new float[3], q = new float[4], s = new float[3] }; } clipData.frames[m] = frameData; } } for (int num5 = 0; num5 < num4; num5++) { for (int num6 = 0; num6 < 10; num6++) { byte num7 = binaryReader.ReadByte(); float num8 = 0f; float[] array2 = null; int num9 = -1; if (num7 == 0) { num8 = binaryReader.ReadSingle(); } else { num9 = binaryReader.ReadInt32(); if (fLen[num9] != num3) { throw new InvalidDataException("TobiramaModels.bin: track length " + clipData.name); } } if (!flag) { continue; } if (num9 >= 0) { array2 = F(num9); } for (int num10 = 0; num10 < num3; num10++) { PoseData poseData = clipData.frames[num10].bones[num5]; float num11 = ((array2 == null) ? num8 : array2[num10]); if (num6 < 3) { poseData.p[num6] = num11; } else if (num6 < 7) { poseData.q[num6 - 3] = num11; } else { poseData.s[num6 - 7] = num11; } } } } modelData.clips[l] = clipData; } if (flag) { dictionary[text] = modelData; } } if (binaryReader.BaseStream.Position != array.Length) { throw new InvalidDataException("TobiramaModels.bin: trailing bytes"); } return dictionary; float[] F(int e) { if (fPool[e] == null) { float[] array3 = new float[fLen[e]]; fPlanes.Decode(e, array3); fPool[e] = array3; } return fPool[e]; } int[] I(int e) { if (iPool[e] == null) { int[] array3 = new int[iLen[e]]; iPlanes.Decode(e, array3); iPool[e] = array3; } return iPool[e]; } } private static void ReadHeads(BinaryReader r, out int[] len, out int[] stride) { int num = r.ReadInt32(); len = new int[num]; stride = new int[num]; for (int i = 0; i < num; i++) { len[i] = r.ReadInt32(); stride[i] = r.ReadInt32(); } } private static float[] Floats(BinaryReader r, int n) { float[] array = new float[n]; for (int i = 0; i < n; i++) { array[i] = r.ReadSingle(); } return array; } private static float[] CopyF(Func pool, int index) { if (index >= 0) { return (float[])pool(index).Clone(); } return null; } private static int[] CopyI(Func pool, int index) { if (index >= 0) { return (int[])pool(index).Clone(); } return null; } } public sealed class TobiramaRemoteMotion : MonoBehaviour { public static bool ForceRemote; private CharacterBody body; private CharacterMotor motor; private Vector3 lastPosition; private bool primed; private Vector3 raw; private Vector3 smooth; private readonly float[] recentVy = new float[8]; private int recentAt; private float lastJumpAt = -10f; private bool wasGrounded = true; public int JumpCount { get; private set; } public int JumpSerial { get; private set; } public float LastJumpAt => lastJumpAt; public bool Owner { get { if (!Object.op_Implicit((Object)(object)motor)) { if (Object.op_Implicit((Object)(object)body)) { return body.hasEffectiveAuthority; } return false; } return motor.hasEffectiveAuthority; } } public bool Remote { get { if (!ForceRemote) { return !Owner; } return true; } } public Vector3 Velocity { get { //IL_0028: 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_0015: Unknown result type (might be due to invalid IL or missing references) if (!Remote) { if (!Object.op_Implicit((Object)(object)motor)) { return Vector3.zero; } return motor.velocity; } return smooth; } } public Vector3 RawVelocity { get { //IL_0028: 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_0015: Unknown result type (might be due to invalid IL or missing references) if (!Remote) { if (!Object.op_Implicit((Object)(object)motor)) { return Vector3.zero; } return motor.velocity; } return raw; } } public bool Grounded { get { if (!Object.op_Implicit((Object)(object)motor)) { return Probe(); } return motor.isGrounded; } } public int Jumps { get { if (!Remote) { if (!Object.op_Implicit((Object)(object)motor)) { return 0; } return motor.jumpCount; } return JumpCount; } } public bool Sprinting { get { if (Object.op_Implicit((Object)(object)body)) { return body.isSprinting; } return false; } } public static TobiramaRemoteMotion For(CharacterBody b) { if (!Object.op_Implicit((Object)(object)b)) { return null; } TobiramaRemoteMotion component = ((Component)b).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return ((Component)b).gameObject.AddComponent(); } return component; } private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); } private bool Probe() { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { return Physics.Raycast(body.footPosition + Vector3.up * 0.3f, Vector3.down, 0.55f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); } return false; } private void OnEnable() { primed = false; } private void FixedUpdate() { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0042: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_013f: 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) float fixedDeltaTime = Time.fixedDeltaTime; if (fixedDeltaTime <= 0f) { return; } Vector3 position = ((Component)this).transform.position; if (!primed) { primed = true; lastPosition = position; raw = (smooth = Vector3.zero); return; } Vector3 val = (position - lastPosition) / fixedDeltaTime; lastPosition = position; if (((Vector3)(ref val)).sqrMagnitude > 22500f) { raw = (smooth = Vector3.zero); return; } raw = val; smooth = Vector3.Lerp(smooth, val, 1f - Mathf.Exp((0f - fixedDeltaTime) * 22f)); bool grounded = Grounded; if (grounded && !wasGrounded) { smooth.y = val.y; } wasGrounded = grounded; float num = float.MaxValue; for (int i = 0; i < recentVy.Length; i++) { num = Mathf.Min(num, recentVy[i]); } if (grounded) { if (Time.time - lastJumpAt > 0.2f) { JumpCount = 0; } } else if (val.y > 2f && val.y - num > 7f && Time.time - lastJumpAt > 0.25f) { JumpCount++; JumpSerial++; lastJumpAt = Time.time; for (int j = 0; j < recentVy.Length; j++) { recentVy[j] = val.y; } } recentVy[recentAt] = val.y; recentAt = (recentAt + 1) % recentVy.Length; } } [Serializable] public class PoseData { public float[] p; public float[] q; public float[] s; } [Serializable] public class BoneData { public string name; public int parent; public PoseData rest; } [Serializable] public class MeshData { public string name; public string texture; public float[] color; public float[] v; public float[] n; public float[] uv; public float[] bw; public int[] bi; public int[] tri; } [Serializable] public class FrameData { public PoseData[] bones; } [Serializable] public class ClipData { public string name; public float duration; public bool loop; public FrameData[] frames; } [Serializable] public class ModelData { public BoneData[] bones; public MeshData[] meshes; public ClipData[] clips; } public class Visual : MonoBehaviour { private static ModelData data; public Animation player; public string current; private CharacterBody body; public Transform[] bones; public float lockUntil; public bool reviewOverride; public bool skillOverride; public float combatUntil; private bool groundedBefore = true; private bool fastFall; private bool dead; private bool deathLanded; private int oldJumps; private int lastStep = -1; private float lastVy; private float airMin; private string lastGait; private FootstepHandler footsteps; private Animator inheritedAnimator; private Vector3 normalModelPosition; public float hitStopUntil; private bool frozen; private float frozenSpeed; private string frozenClip; public static string Assets => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location), "Assets"); private static Vector3 V(float[] a) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return new Vector3(a[0], a[1], a[2]); } private static Quaternion Q(float[] a) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(a[0], a[1], a[2], a[3]); } public static Visual Build(GameObject model, float scale) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_007a: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_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_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: 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_04c7: Expected O, but got Unknown //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_069c: 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_06bc: Expected O, but got Unknown //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Expected O, but got Unknown //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_09da: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Expected O, but got Unknown //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_09b0: Unknown result type (might be due to invalid IL or missing references) //IL_09b2: Unknown result type (might be due to invalid IL or missing references) Stopwatch stopwatch = Stopwatch.StartNew(); if (data == null) { data = TobiramaPack.Model("Tobirama.json"); } Renderer[] componentsInChildren = model.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } GameObject root = new GameObject("TobiramaPurchasedModel"); root.transform.SetParent(model.transform, false); root.transform.localScale = Vector3.one * scale; root.transform.localPosition = new Vector3(0f, 0.2283651f * scale, 0f); Visual visual = root.AddComponent(); visual.player = root.AddComponent(); visual.player.cullingType = (AnimationCullingType)0; visual.bones = (Transform[])(object)new Transform[data.bones.Length]; for (int j = 0; j < visual.bones.Length; j++) { visual.bones[j] = new GameObject(data.bones[j].name).transform; } for (int k = 0; k < visual.bones.Length; k++) { BoneData boneData = data.bones[k]; Transform obj = visual.bones[k]; obj.SetParent((boneData.parent < 0) ? root.transform : visual.bones[boneData.parent], false); obj.localPosition = V(boneData.rest.p); obj.localRotation = Q(boneData.rest.q); obj.localScale = V(boneData.rest.s); } List list = new List(); MeshData[] meshes = data.meshes; foreach (MeshData meshData in meshes) { GameObject val = new GameObject(meshData.name); val.transform.SetParent(root.transform, false); SkinnedMeshRenderer val2 = val.AddComponent(); Mesh val3 = new Mesh(); ((Object)val3).name = "Tobirama_" + meshData.name; val3.indexFormat = (IndexFormat)1; int num = meshData.v.Length / 3; Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; Vector2[] array3 = (Vector2[])(object)new Vector2[num]; BoneWeight[] array4 = (BoneWeight[])(object)new BoneWeight[num]; for (int l = 0; l < num; l++) { array[l] = new Vector3(meshData.v[l * 3], meshData.v[l * 3 + 1], meshData.v[l * 3 + 2]); array2[l] = new Vector3(meshData.n[l * 3], meshData.n[l * 3 + 1], meshData.n[l * 3 + 2]); array3[l] = new Vector2(meshData.uv[l * 2], meshData.uv[l * 2 + 1]); int num2 = l; BoneWeight val4 = default(BoneWeight); ((BoneWeight)(ref val4)).boneIndex0 = meshData.bi[l * 4]; ((BoneWeight)(ref val4)).boneIndex1 = meshData.bi[l * 4 + 1]; ((BoneWeight)(ref val4)).boneIndex2 = meshData.bi[l * 4 + 2]; ((BoneWeight)(ref val4)).boneIndex3 = meshData.bi[l * 4 + 3]; ((BoneWeight)(ref val4)).weight0 = meshData.bw[l * 4]; ((BoneWeight)(ref val4)).weight1 = meshData.bw[l * 4 + 1]; ((BoneWeight)(ref val4)).weight2 = meshData.bw[l * 4 + 2]; ((BoneWeight)(ref val4)).weight3 = meshData.bw[l * 4 + 3]; array4[num2] = val4; } val3.vertices = array; val3.normals = array2; val3.uv = array3; val3.triangles = meshData.tri; val3.boneWeights = array4; val3.bindposes = visual.bones.Select((Transform b) => b.worldToLocalMatrix * root.transform.localToWorldMatrix).ToArray(); val3.RecalculateBounds(); val2.sharedMesh = val3; val2.bones = visual.bones; val2.rootBone = visual.bones[0]; ((Renderer)val2).localBounds = new Bounds(new Vector3(0f, 1.3f, 0f), new Vector3(5f, 5f, 5f)); val2.updateWhenOffscreen = true; Material val5 = new Material(Shader.Find("Hopoo Games/Deferred/Standard") ?? Shader.Find("Standard")); ((Object)val5).name = "Tobirama_" + meshData.name; Color val6 = new Color(meshData.color[0], meshData.color[1], meshData.color[2], 1f); val5.color = ((Color)(ref val6)).gamma; if (val5.HasProperty("_SpecularStrength")) { val5.SetFloat("_SpecularStrength", 0.1f); } if (val5.HasProperty("_Cull")) { val5.SetInt("_Cull", 0); } if (!string.IsNullOrEmpty(meshData.texture)) { Texture2D val7 = new Texture2D(2, 2); ImageConversion.LoadImage(val7, File.ReadAllBytes(Path.Combine(Assets, meshData.texture))); val5.mainTexture = (Texture)(object)val7; val5.EnableKeyword("CUTOUT"); val5.EnableKeyword("_ALPHATEST_ON"); if (val5.HasProperty("_Cutoff")) { val5.SetFloat("_Cutoff", 0.45f); } val5.renderQueue = 2450; } ((Renderer)val2).sharedMaterial = val5; list.Add(new RendererInfo { renderer = (Renderer)(object)val2, defaultMaterial = val5, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }); } StormFollow.Attach(visual, root.transform, list, list.Select((RendererInfo x) => ((Component)x.renderer).gameObject).ToList()); CharacterModel component = model.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseRendererInfos = list.ToArray(); } ClipData[] clips = data.clips; foreach (ClipData clipData in clips) { AnimationClip val8 = new AnimationClip { legacy = true, frameRate = 30f, wrapMode = (WrapMode)(clipData.loop ? 2 : 8) }; for (int num3 = 0; num3 < visual.bones.Length; num3++) { string text = ((Object)visual.bones[num3]).name; for (int parent = data.bones[num3].parent; parent >= 0; parent = data.bones[parent].parent) { text = data.bones[parent].name + "/" + text; } for (int num4 = 0; num4 < 10; num4++) { string text2 = ((num4 < 3) ? ("localPosition." + "xyz"[num4]) : ((num4 < 7) ? ("localRotation." + "xyzw"[num4 - 3]) : ("localScale." + "xyz"[num4 - 7]))); Keyframe[] array5 = (Keyframe[])(object)new Keyframe[clipData.frames.Length]; for (int num5 = 0; num5 < array5.Length; num5++) { PoseData poseData = clipData.frames[num5].bones[num3]; float num6 = ((num4 < 3) ? poseData.p[num4] : ((num4 < 7) ? poseData.q[num4 - 3] : poseData.s[num4 - 7])); array5[num5] = new Keyframe((float)num5 / 30f, num6); } if (clipData.name.StartsWith("Primary_") || new string[25] { "Ninja_Sprint", "Raijin_Three_Throws", "Raijin_Swipe", "Raijin_Slash", "Tandem_Throw", "Primary_03_Heavy", "Combat_Idle", "Walk", "Run", "Backward", "Strafe_Left", "Strafe_Right", "Jump_Takeoff", "Air_Rise", "Air_Apex", "Fast_Fall", "Additional_Jump", "Move_Start", "Move_Stop", "Land_Soft", "Land_Heavy", "Relaxed_Idle", "Selection_Idle", "Water_Dragon", "Water_Dragon_Air" }.Contains(clipData.name)) { for (int num7 = 0; num7 < array5.Length; num7++) { Keyframe val9 = array5[num7]; ((Keyframe)(ref val9)).inTangent = ((num7 > 0) ? ((((Keyframe)(ref array5[num7])).value - ((Keyframe)(ref array5[num7 - 1])).value) * 30f) : 0f); ((Keyframe)(ref val9)).outTangent = ((num7 + 1 < array5.Length) ? ((((Keyframe)(ref array5[num7 + 1])).value - ((Keyframe)(ref array5[num7])).value) * 30f) : 0f); array5[num7] = val9; } } val8.SetCurve(text, typeof(Transform), text2, new AnimationCurve(array5)); } } val8.EnsureQuaternionContinuity(); visual.player.AddClip(val8, clipData.name); } visual.Play("Combat_Idle"); stopwatch.Stop(); Plugin.instance.Log.LogInfo((object)("TOBIRAMA_BUILD_MS=" + stopwatch.ElapsedMilliseconds + " triangles=" + data.meshes.Sum((MeshData m) => m.tri.Length / 3) + " renderers=" + list.Count)); return visual; } private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) normalModelPosition = ((Component)this).transform.localPosition; player = ((Component)this).GetComponent(); CharacterModel componentInParent = ((Component)this).GetComponentInParent(); body = (Object.op_Implicit((Object)(object)componentInParent) ? componentInParent.body : null); current = null; Play(Object.op_Implicit((Object)(object)body) ? "Relaxed_Idle" : "Selection_Idle"); inheritedAnimator = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)inheritedAnimator)) { ((Behaviour)inheritedAnimator).enabled = false; } footsteps = ((Component)this).GetComponentInParent(); ChildLocator componentInParent2 = ((Component)this).GetComponentInParent(); if (!Object.op_Implicit((Object)(object)componentInParent2)) { return; } List list = componentInParent2.transformPairs.ToList(); string[] array = new string[2] { "L", "R" }; foreach (string side in array) { Transform val = ((IEnumerable)((Component)this).GetComponentsInChildren()).FirstOrDefault((Func)((Transform t) => ((Object)t).name == "foot." + side)); if (Object.op_Implicit((Object)(object)val)) { list.Add(new NameTransformPair { name = "TobiramaFoot" + side, transform = val }); } } componentInParent2.transformPairs = list.ToArray(); } public void Play(string name, float speed = 1f, float hold = 0f, bool restart = false, float blend = 0.1f) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)player) || !TrackedReference.op_Implicit((TrackedReference)(object)player[name])) { return; } player[name].speed = speed; if (current != name || restart) { if (restart || (int)player[name].wrapMode == 8) { player[name].time = 0f; } if (blend <= 0f) { player.Play(name); } else { player.CrossFade(name, blend); } current = name; } if (hold > 0f) { lockUntil = Time.time + hold; } } public void ClearOverride() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) lockUntil = 0f; reviewOverride = false; skillOverride = false; fastFall = false; ((Component)this).transform.localRotation = Quaternion.identity; } public void BeginDeath() { if (dead) { return; } if (!Object.op_Implicit((Object)(object)body)) { CharacterModel componentInParent = ((Component)this).GetComponentInParent(); body = (Object.op_Implicit((Object)(object)componentInParent) ? componentInParent.body : null); } if (Object.op_Implicit((Object)(object)body)) { ((Component)body).GetComponent()?.DetachForTeleport(); } ClearOverride(); dead = true; deathLanded = false; try { if (Object.op_Implicit((Object)(object)body)) { TobiRagdoll.Spawn(body, this); } } catch (Exception ex) { Plugin.instance.Log.LogWarning((object)("Tobirama ragdoll failed: " + ex.Message)); } } private void LateUpdate() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_011a: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { WallRun component = ((Component)body).GetComponent(); Quaternion val = ((Object.op_Implicit((Object)(object)component) && component.ViewRunning) ? Quaternion.LookRotation(component.ViewTravel, component.ViewNormal) : ((Component)this).transform.parent.rotation); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val, 1f - Mathf.Exp((0f - Time.deltaTime) * 18f)); ((Component)this).transform.localPosition = normalModelPosition; if (Object.op_Implicit((Object)(object)component) && component.ViewRunning) { Transform val2 = ((IEnumerable)bones).FirstOrDefault((Func)((Transform t) => ((Object)t).name == "foot.L")); Transform val3 = ((IEnumerable)bones).FirstOrDefault((Func)((Transform t) => ((Object)t).name == "foot.R")); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3)) { float num = Vector3.Dot(component.ViewContact + component.ViewNormal * 0.1f - (val2.position + val3.position) * 0.5f, component.ViewNormal); Transform transform = ((Component)this).transform; transform.position += component.ViewNormal * Mathf.Clamp(num, -1.2f, 1.2f); } } } if (Object.op_Implicit((Object)(object)inheritedAnimator)) { ((Behaviour)inheritedAnimator).enabled = false; } } private void HitStop() { if (Time.time < hitStopUntil && current != null && TrackedReference.op_Implicit((TrackedReference)(object)player[current])) { if (!frozen || frozenClip != current) { frozen = true; frozenClip = current; frozenSpeed = player[current].speed; player[current].speed = 0f; } } else if (frozen) { frozen = false; if (frozenClip != null && TrackedReference.op_Implicit((TrackedReference)(object)player[frozenClip])) { player[frozenClip].speed = frozenSpeed; } } } private void Update() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_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_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_0477: 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_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_049b: 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_04ed: 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) HitStop(); if (!Object.op_Implicit((Object)(object)body)) { CharacterModel componentInParent = ((Component)this).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent)) { body = componentInParent.body; } } if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.characterMotor) || reviewOverride) { return; } CharacterMotor characterMotor = body.characterMotor; TobiramaRemoteMotion tobiramaRemoteMotion = TobiramaRemoteMotion.For(body); Vector3 velocity = tobiramaRemoteMotion.Velocity; bool isGrounded = characterMotor.isGrounded; float y = velocity.y; bool flag = isGrounded && !groundedBefore; bool flag2 = !isGrounded && groundedBefore; groundedBefore = isGrounded; if (dead || !body.healthComponent.alive) { if (!dead) { BeginDeath(); } if (isGrounded && !deathLanded) { deathLanded = true; Play("Death_Ground", 1f, 0f, restart: true); } else if (!deathLanded) { Play("Death_Air"); } return; } if (skillOverride) { oldJumps = tobiramaRemoteMotion.Jumps; return; } WallRun component = ((Component)body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.ViewRunning) { oldJumps = tobiramaRemoteMotion.Jumps; lockUntil = 0f; lastGait = null; string name = (component.ViewStanding ? "Selection_Idle" : "Ninja_Sprint"); float speed; if (!component.ViewStanding) { Vector3 val = Vector3.ProjectOnPlane(velocity, component.ViewNormal); speed = Mathf.Clamp(((Vector3)(ref val)).magnitude / 10.15f, 0.25f, 3f); } else { speed = 1f; } Play(name, speed); return; } bool num = tobiramaRemoteMotion.Jumps > oldJumps && tobiramaRemoteMotion.Jumps > 1; oldJumps = tobiramaRemoteMotion.Jumps; if (num) { Play("Additional_Jump", 1f, player["Additional_Jump"].length, restart: true, 0f); lastVy = y; return; } if (flag) { fastFall = false; lockUntil = 0f; Play((airMin < -12f) ? "Land_Heavy" : "Land_Soft", 1f, 0.12f, restart: true, (current == "Additional_Jump") ? 0f : 0.06f); lastVy = 0f; airMin = 0f; return; } lastVy = y; if (!isGrounded) { airMin = Mathf.Min(airMin, y); } if (Time.time < lockUntil) { if (!(body.isSprinting && isGrounded) || (!(current == "Move_Start") && !(current == "Move_Stop"))) { return; } lockUntil = 0f; } if (flag2 && y > 0.5f) { Play("Jump_Takeoff", 1f, 0.23f, restart: true, 0.06f); return; } if (!isGrounded) { if (fastFall) { if (y > Plugin.FallExit.Value) { fastFall = false; } } else if (y < Plugin.FallEnter.Value) { fastFall = true; } Play(fastFall ? "Fast_Fall" : ((y > 0.7f) ? "Air_Rise" : "Air_Apex")); return; } Vector2 val2 = new Vector2(velocity.x, velocity.z); float magnitude = ((Vector2)(ref val2)).magnitude; if (magnitude < 0.15f) { if (lastGait != null) { lastGait = null; lockUntil = 0f; } Play((Time.time < combatUntil) ? "Combat_Idle" : "Relaxed_Idle"); lastStep = -1; return; } string text = (body.isSprinting ? "Ninja_Sprint" : ((magnitude < 3.2f) ? "Walk" : "Run")); float num2 = ((text == "Walk") ? 1.6f : 10.15f); Vector3 val3 = Quaternion.Inverse(Quaternion.LookRotation(body.characterDirection.forward)) * velocity; if (!body.isSprinting && Mathf.Abs(val3.x) > Mathf.Abs(val3.z) * 1.4f) { text = ((val3.x > 0f) ? "Strafe_Right" : "Strafe_Left"); num2 = 5.69f; } else if (!body.isSprinting && val3.z < -0.4f) { text = "Backward"; num2 = 5.69f; } lastGait = text; Play(text, Mathf.Clamp(magnitude / num2, 0.35f, 3f)); int num3 = Mathf.FloorToInt(player[text].time / (player[text].length * 0.5f)); if (num3 != lastStep) { if (lastStep >= 0 && Object.op_Implicit((Object)(object)footsteps)) { footsteps.Footstep((num3 % 2 == 0) ? "TobiramaFootL" : "TobiramaFootR", (GameObject)null); } lastStep = num3; } } } public class TobiramaDeath : GenericCharacterDeath { public override bool shouldAutoDestroy => ((EntityState)this).fixedAge > 10f; public override void PlayDeathAnimation(float duration) { Visual componentInChildren = ((Component)((EntityState)this).characterBody.modelLocator.modelTransform).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.BeginDeath(); } TobiBody component = ((Component)((EntityState)this).characterBody).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.Clear(); } } } public static class VoiceLoadout { public enum Lang { Japanese, English } private sealed class Entry { public GameObject prefab; public SkillFamily family; public string titleToken; public int slot = -1; } private static readonly List entries = new List(); private static bool hooked; private static Row lastSkinRow; private static readonly List voiceRows = new List(); public static GenericSkill Register(GameObject bodyPrefab, string tokenPrefix, Sprite japaneseIcon, Sprite englishIcon, Action addFamily, Action addSkillDef) { //IL_00cd: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown string text = tokenPrefix.ToUpperInvariant() + "_VOICELOADOUT_"; LanguageAPI.Add(text + "TITLE", "Voices"); LanguageAPI.Add(text + "JP_NAME", "Japanese"); LanguageAPI.Add(text + "JP_DESC", "Japanese voice lines (Storm 4)."); LanguageAPI.Add(text + "EN_NAME", "English"); LanguageAPI.Add(text + "EN_DESC", "English voice lines (Storm 4)."); SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = ((Object)bodyPrefab).name + "VoiceLoadoutFamily"; val.variants = (Variant[])(object)new Variant[2] { Variant(Def(((Object)bodyPrefab).name + "VoiceJapanese", text + "JP_NAME", text + "JP_DESC", japaneseIcon, addSkillDef)), Variant(Def(((Object)bodyPrefab).name + "VoiceEnglish", text + "EN_NAME", text + "EN_DESC", englishIcon, addSkillDef)) }; val.defaultVariantIndex = 0u; addFamily(val); GenericSkill obj = bodyPrefab.AddComponent(); obj.skillName = "VoiceLoadout"; obj._skillFamily = val; obj.hideInCharacterSelect = true; obj.loadoutTitleToken = text + "TITLE"; entries.Add(new Entry { prefab = bodyPrefab, family = val, titleToken = text + "TITLE" }); if (!hooked) { hooked = true; Row.FromSkin += new hook_FromSkin(FromSkin); Row.FromSkillSlot += new hook_FromSkillSlot(FromSkillSlot); LoadoutPanelController.Rebuild += new hook_Rebuild(Rebuild); } return obj; } private static Variant Variant(SkillDef d) { //IL_0002: 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_0024: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) Variant result = new Variant { skillDef = d }; ((Variant)(ref result)).viewableNode = new Node(d.skillNameToken, false, (Node)null); return result; } private static SkillDef Def(string name, string nameToken, string descToken, Sprite icon, Action add) { //IL_0034: 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_00a7: Unknown result type (might be due to invalid IL or missing references) SkillDef val = ScriptableObject.CreateInstance(); val.skillName = name; ((Object)val).name = name; val.skillNameToken = nameToken; val.skillDescriptionToken = descToken; val.icon = icon; val.activationState = new SerializableEntityStateType(typeof(Idle)); val.activationStateMachineName = "Body"; val.baseMaxStock = 1; val.rechargeStock = 0; val.baseRechargeInterval = 0f; val.requiredStock = 1000000; val.stockToConsume = 0; val.isCombatSkill = false; val.canceledFromSprinting = false; val.cancelSprintingOnActivation = false; val.fullRestockOnAssign = false; val.dontAllowPastMaxStocks = true; val.mustKeyPress = true; val.beginSkillCooldownOnSkillEnd = false; val.interruptPriority = (InterruptPriority)0; add(val); return val; } private static Entry For(BodyIndex bodyIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0006: 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) if ((int)bodyIndex == -1) { return null; } GameObject bodyPrefab = BodyCatalog.GetBodyPrefab(bodyIndex); if (!Object.op_Implicit((Object)(object)bodyPrefab)) { return null; } foreach (Entry entry in entries) { if ((Object)(object)entry.prefab != (Object)(object)bodyPrefab && ((Object)bodyPrefab).name != ((Object)entry.prefab).name) { continue; } if (entry.slot < 0) { GenericSkill[] bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(bodyIndex); for (int i = 0; i < bodyPrefabSkillSlots.Length; i++) { if (Object.op_Implicit((Object)(object)bodyPrefabSkillSlots[i]) && (Object)(object)bodyPrefabSkillSlots[i].skillFamily == (Object)(object)entry.family) { entry.slot = i; } } } return entry; } return null; } public static int SlotIndex(BodyIndex bodyIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return For(bodyIndex)?.slot ?? (-1); } public static Lang Get(Loadout loadout, BodyIndex bodyIndex) { //IL_0000: 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) Entry entry = For(bodyIndex); if (entry == null || entry.slot < 0 || loadout == null) { return Lang.Japanese; } if (loadout.bodyLoadoutManager.GetSkillVariant(bodyIndex, entry.slot) != 1) { return Lang.Japanese; } return Lang.English; } public static Lang Get(CharacterBody body) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return Lang.Japanese; } Entry entry = For(body.bodyIndex); if (entry == null) { return Lang.Japanese; } if (Object.op_Implicit((Object)(object)body.master) && body.master.loadout != null && entry.slot >= 0) { return Get(body.master.loadout, body.bodyIndex); } GenericSkill[] components = ((Component)body).GetComponents(); foreach (GenericSkill val in components) { if ((Object)(object)val.skillFamily == (Object)(object)entry.family) { if (!((Object)(object)val.baseSkill == (Object)(object)entry.family.variants[1].skillDef)) { return Lang.Japanese; } return Lang.English; } } return Lang.Japanese; } private static Row FromSkin(orig_FromSkin orig, LoadoutPanelController owner, BodyIndex bodyIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return lastSkinRow = orig.Invoke(owner, bodyIndex); } private static Row FromSkillSlot(orig_FromSkillSlot orig, LoadoutPanelController owner, BodyIndex bodyIndex, int slotIndex, GenericSkill slot) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Row val = orig.Invoke(owner, bodyIndex, slotIndex, slot); foreach (Entry entry in entries) { if (!Object.op_Implicit((Object)(object)slot) || !((Object)(object)slot.skillFamily == (Object)(object)entry.family)) { continue; } voiceRows.Add(val); try { LanguageTextMeshController[] componentsInChildren = ((Component)val.rowPanelTransform).GetComponentsInChildren(true); foreach (LanguageTextMeshController val2 in componentsInChildren) { if (val2.token != null && val2.token.StartsWith("LOADOUT_SKILL")) { val2.token = entry.titleToken; } } } catch { } } return val; } private static void Rebuild(orig_Rebuild orig, LoadoutPanelController self) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_004f: Unknown result type (might be due to invalid IL or missing references) lastSkinRow = null; voiceRows.Clear(); orig.Invoke(self); try { BodyIndex bodyIndex = self.currentDisplayData.bodyIndex; Entry entry = For(bodyIndex); if (entry == null || entry.slot < 0) { return; } if (voiceRows.Count == 0) { GenericSkill[] bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(bodyIndex); Row item = Row.FromSkillSlot(self, bodyIndex, entry.slot, bodyPrefabSkillSlots[entry.slot]); self.rows.Add(item); } Row val = ((voiceRows.Count > 0) ? voiceRows[voiceRows.Count - 1] : null); if (val != null) { if (lastSkinRow != null && self.rows.Contains(lastSkinRow)) { self.rows.Remove(val); self.rows.Insert(self.rows.IndexOf(lastSkinRow) + 1, val); int siblingIndex = ((Transform)lastSkinRow.rowPanelTransform).GetSiblingIndex(); int siblingIndex2 = ((Transform)val.rowPanelTransform).GetSiblingIndex(); ((Transform)val.rowPanelTransform).SetSiblingIndex((siblingIndex2 < siblingIndex) ? siblingIndex : (siblingIndex + 1)); } Plugin.instance.Log.LogInfo((object)("TOBIRAMA_VOICELOADOUT row placed sibling=" + ((Transform)val.rowPanelTransform).GetSiblingIndex() + " skinSibling=" + ((lastSkinRow != null) ? ((Transform)lastSkinRow.rowPanelTransform).GetSiblingIndex() : (-1)) + " rows=" + self.rows.Count)); } } catch (Exception ex) { Plugin.instance.Log.LogError((object)("VoiceLoadout row: " + ex)); } } } public sealed class WallRun : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PreMove <>9__61_0; internal void b__61_0(orig_PreMove orig, CharacterMotor motor, float deltaTime) { orig.Invoke(motor, deltaTime); WallRun component = ((Component)motor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && motor.hasEffectiveAuthority) { component.Drive(deltaTime); } } } private TobiramaRemoteMotion rm; private bool vRun; private float vSince; private float vLost; private float vSpeed; private float prevVy; private float ay; private Vector3 vNormal = Vector3.forward; private Vector3 vTravel = Vector3.up; private Vector3 vContact; private CharacterBody body; private CharacterMotor motor; private InputBankTest input; private Vector3 wallNormal; private Vector3 surfaceUp; private float detachUntil; private float lastContact; private float decisionAt = -1f; private bool waitForRelease; private bool consumeJumpThisFrame; private float travelInput = 1f; private bool ViewRemote { get { if (Object.op_Implicit((Object)(object)(Object.op_Implicit((Object)(object)rm) ? rm : (rm = TobiramaRemoteMotion.For(body))))) { return rm.Remote; } return false; } } public bool ViewRunning { get { if (!ViewRemote) { return Running; } return vRun; } } public bool ViewStanding { get { if (!ViewRemote) { return Standing; } if (vRun) { return vSpeed < 1.2f; } return false; } } public Vector3 ViewNormal { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!ViewRemote) { return wallNormal; } return vNormal; } } public Vector3 ViewTravel { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!ViewRemote) { return TravelDirection; } return vTravel; } } public Vector3 ViewContact { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!ViewRemote) { return ContactPoint; } return vContact; } } public string SurfaceName { get; private set; } public float ContactAge => Time.fixedTime - lastContact; public bool Running { get; private set; } public Vector3 Normal => wallNormal; public Vector3 TravelDirection { get; private set; } = Vector3.up; public bool Standing { get { if (Running) { return travelInput < 0.1f; } return false; } } public Vector3 ContactPoint { get; private set; } public static float MinimumTravelAngle => -8f; private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)body) || !ViewRemote) { vRun = false; vSince = (vLost = 0f); } else { DeriveWall(); } } private void DeriveWall() { //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_0019: 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_0055: 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_0075: 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_0272: 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_028f: 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_0263: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0122: 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_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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0350: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) float fixedDeltaTime = Time.fixedDeltaTime; Vector3 velocity = rm.Velocity; ay = Mathf.Lerp(ay, (velocity.y - prevVy) / fixedDeltaTime, 1f - Mathf.Exp((0f - fixedDeltaTime) * 12f)); prevVy = velocity.y; bool flag = false; RaycastHit val = default(RaycastHit); bool flag2 = velocity.y < -3f || (ay < -20f && velocity.y < -0.5f); bool flag3 = ay > -12f && ay < 12f && Time.time - rm.LastJumpAt > 0.3f; if (!rm.Grounded && !flag2 && (vRun || flag3)) { Vector3 val2 = Vector3.ProjectOnPlane(velocity, Vector3.up); Vector3 val3 = (Object.op_Implicit((Object)(object)body.characterDirection) ? body.characterDirection.forward : ((Component)this).transform.forward); Vector3[] array = (Vector3[])(object)new Vector3[3] { vRun ? (-vNormal) : ((((Vector3)(ref val2)).sqrMagnitude > 0.04f) ? ((Vector3)(ref val2)).normalized : val3), val3, -vNormal }; float num = float.MaxValue; RaycastHit val4 = default(RaycastHit); for (int i = 0; i < array.Length; i++) { if (!(((Vector3)(ref array[i])).sqrMagnitude < 0.5f) && (i != 2 || vRun) && Physics.SphereCast(body.corePosition, 0.22f, ((Vector3)(ref array[i])).normalized, ref val4, 1.25f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !(((RaycastHit)(ref val4)).normal.y < -0.65f) && !(((RaycastHit)(ref val4)).normal.y > 0.7f) && ((RaycastHit)(ref val4)).distance < num) { num = ((RaycastHit)(ref val4)).distance; val = val4; flag = true; } } } Vector3 val6; if (flag) { vSince += fixedDeltaTime; vLost = 0f; Vector3 val5; if (!vRun) { val5 = ((RaycastHit)(ref val)).normal; } else { val6 = Vector3.Slerp(vNormal, ((RaycastHit)(ref val)).normal, 1f - Mathf.Exp((0f - fixedDeltaTime) * 20f)); val5 = ((Vector3)(ref val6)).normalized; } vNormal = val5; vContact = ((RaycastHit)(ref val)).point; } else { vLost += fixedDeltaTime; vSince = 0f; } if (!vRun && vSince >= 0.08f) { vRun = true; } if (vRun && vLost >= 0.1f) { vRun = false; } if (vRun) { Vector3 val7 = Vector3.ProjectOnPlane(velocity, vNormal); vSpeed = ((Vector3)(ref val7)).magnitude; Vector3 normalized; if (!(vSpeed > 0.6f)) { val6 = Vector3.ProjectOnPlane(Vector3.up, vNormal); normalized = ((Vector3)(ref val6)).normalized; } else { normalized = ((Vector3)(ref val7)).normalized; } vTravel = normalized; if (((Vector3)(ref vTravel)).sqrMagnitude < 0.1f) { vTravel = Vector3.up; } } } private Vector2 MoveAxes() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(input.aimDirection, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = body.characterDirection.forward; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(Vector3.up, val); return new Vector2(Vector3.Dot(input.moveVector, val2), Vector3.Dot(input.moveVector, val)); } private bool SetTravel(Vector3 normal, Vector2 axes) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_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_011a: 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_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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00f2: 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_0102: 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_0112: Unknown result type (might be due to invalid IL or missing references) Vector3 val; Vector3 normalized; if (!Running) { val = Vector3.ProjectOnPlane(Vector3.up, normal); normalized = ((Vector3)(ref val)).normalized; } else { val = Vector3.ProjectOnPlane(Quaternion.FromToRotation(wallNormal, normal) * surfaceUp, normal); normalized = ((Vector3)(ref val)).normalized; } Vector3 val2 = normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.1f) { return false; } val = Vector3.Cross(normal, val2); Vector3 val3 = ((Vector3)(ref val)).normalized; if (!Running && Vector3.Dot(val3, Vector3.Cross(Vector3.up, input.aimDirection)) < 0f) { val3 = -val3; } Vector3 val4 = val2 * axes.y + val3 * axes.x; travelInput = Mathf.Clamp01(((Vector3)(ref val4)).magnitude); if (travelInput < 0.1f) { if (!Running) { return false; } surfaceUp = val2; val = Vector3.ProjectOnPlane(TravelDirection, normal); TravelDirection = ((Vector3)(ref val)).normalized; val = TravelDirection; if (((Vector3)(ref val)).sqrMagnitude < 0.1f) { TravelDirection = val2; } return true; } if (Mathf.Abs(normal.y) < 0.3f && Vector3.Dot(val2, Vector3.up) > 0.7f && Mathf.Asin(Mathf.Clamp(axes.y / Mathf.Max(0.01f, ((Vector2)(ref axes)).magnitude), -1f, 1f)) * 57.29578f < MinimumTravelAngle) { return false; } surfaceUp = val2; TravelDirection = ((Vector3)(ref val4)).normalized; return true; } public static void Install() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__61_0; if (obj == null) { hook_PreMove val = delegate(orig_PreMove orig, CharacterMotor motor, float deltaTime) { orig.Invoke(motor, deltaTime); WallRun component = ((Component)motor).GetComponent(); if (Object.op_Implicit((Object)(object)component) && motor.hasEffectiveAuthority) { component.Drive(deltaTime); } }; <>c.<>9__61_0 = val; obj = (object)val; } CharacterMotor.PreMove += (hook_PreMove)obj; } private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); input = ((Component)this).GetComponent(); } private bool Wall(out RaycastHit hit) { //IL_0001: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_00f6: 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_00ee: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_01b5: 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_01d4: Unknown result type (might be due to invalid IL or missing references) hit = default(RaycastHit); Vector3 val; if (!Running) { val = Vector3.ProjectOnPlane(input.moveVector, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.5f && Physics.SphereCast(body.corePosition, 0.22f, normalized, ref hit, 1.05f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return Mathf.Abs(((RaycastHit)(ref hit)).normal.y) < 0.55f; } return false; } float num = float.MaxValue; bool result = false; RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 5; i++) { Vector3 val2 = body.corePosition + wallNormal * 0.12f + ((i == 1) ? (TravelDirection * 0.5f) : Vector3.zero); val = -wallNormal + (Vector3)(i switch { 4 => surfaceUp * 0.35f, 3 => -TravelDirection * 0.45f, 2 => TravelDirection * 0.6f, _ => Vector3.zero, }); Vector3 normalized2 = ((Vector3)(ref val)).normalized; if (Physics.SphereCast(val2, 0.22f, normalized2, ref val3, 1.35f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && !(((RaycastHit)(ref val3)).normal.y < -0.65f) && !(((RaycastHit)(ref val3)).normal.y > 0.7f) && !(Vector3.Dot(((RaycastHit)(ref val3)).normal, wallNormal) < 0.45f)) { float num2 = ((RaycastHit)(ref val3)).distance + (1f - Vector3.Dot(((RaycastHit)(ref val3)).normal, wallNormal)) * 0.35f; if (num2 < num) { num = num2; hit = val3; result = true; } } } return result; } private void Decide() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_014c: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0231: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: 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) if (decisionAt == Time.fixedTime) { return; } decisionAt = Time.fixedTime; consumeJumpThisFrame = false; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)motor) || !Object.op_Implicit((Object)(object)input) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { Detach(push: false); } else if (!input.jump.down) { waitForRelease = false; if (Running) { Detach(push: false); } } else { if (waitForRelease || Time.fixedTime < detachUntil) { return; } Vector2 val = MoveAxes(); RaycastHit hit; if (Running && val.y < -0.65f && Mathf.Abs(val.x) < 0.35f) { Detach(push: true); consumeJumpThisFrame = true; } else if (!Wall(out hit)) { if (Running && Time.fixedTime - lastContact > 0.12f) { bool num = Vector3.Dot(TravelDirection, Vector3.up) > 0.2f; Vector3 val2 = -wallNormal; Detach(push: false); if (num) { motor.velocity = Vector3.up * 4f + val2 * Mathf.Min(body.moveSpeed, 7f); } consumeJumpThisFrame = true; waitForRelease = true; } } else { if (!Running && Vector3.Dot(input.moveVector, -((RaycastHit)(ref hit)).normal) < 0.35f) { return; } if (Running && Vector3.Dot(wallNormal, ((RaycastHit)(ref hit)).normal) < 0.45f) { Detach(push: false); waitForRelease = true; return; } Vector3 val3; if (!Running) { val3 = ((RaycastHit)(ref hit)).normal; } else { Vector3 val4 = Vector3.Slerp(wallNormal, ((RaycastHit)(ref hit)).normal, 1f - Mathf.Exp((0f - Time.fixedDeltaTime) * 20f)); val3 = ((Vector3)(ref val4)).normalized; } Vector3 normal = val3; if (!SetTravel(normal, val)) { Detach(push: false); waitForRelease = true; consumeJumpThisFrame = true; return; } if (!Running) { ((BaseCharacterController)motor).Motor.ForceUnground(0.1f); } wallNormal = normal; ContactPoint = ((RaycastHit)(ref hit)).point; SurfaceName = ((Object)((RaycastHit)(ref hit)).collider).name; lastContact = Time.fixedTime; Running = true; consumeJumpThisFrame = true; } } } public bool OwnsJump() { if (!Object.op_Implicit((Object)(object)motor) || !motor.hasEffectiveAuthority) { return false; } Decide(); if (!Running) { return consumeJumpThisFrame; } return true; } private void Drive(float deltaTime) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_005f: 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) Decide(); if (Running) { float num = 9f * Mathf.Max(0f, body.moveSpeed / 7f) * travelInput; motor.velocity = TravelDirection * num - wallNormal * 1.8f; motor.lastVelocity = motor.velocity; } } public void DetachForTeleport() { Detach(push: false); waitForRelease = true; detachUntil = Time.fixedTime + 0.3f; decisionAt = -1f; } public void Detach(bool push) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (Running) { Running = false; detachUntil = Time.fixedTime + 0.28f; if (push && Object.op_Implicit((Object)(object)motor)) { ((BaseCharacterController)motor).Motor.ForceUnground(0.1f); motor.velocity = wallNormal * Mathf.Max(7f, body.moveSpeed) + Vector3.up * Mathf.Min(11f, body.jumpPower * 0.6f); motor.lastVelocity = motor.velocity; waitForRelease = true; } } } private void OnDisable() { Detach(push: false); } } public sealed class TobiramaMain : GenericCharacterMain { public override void ProcessJump() { WallRun component = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.OwnsJump()) { base.jumpInputReceived = false; } else { ((GenericCharacterMain)this).ProcessJump(); } } } public static class Tex03 { public static Texture2D ring; public static Texture2D column; public static Texture2D droplet; public static Texture2D foam; public static Texture2D sealRing; public static Texture2D decal; public static Texture2D Crop(Texture2D src, int x, int y, int w, int h) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0029: Expected O, but got Unknown Texture2D val = new Texture2D(w, h, (TextureFormat)4, false); val.SetPixels(src.GetPixels(x, y, w, h)); ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(); return val; } public static void Prepare() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_0085: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) ring = new Texture2D(128, 32, (TextureFormat)4, false); for (int i = 0; i < 32; i++) { for (int j = 0; j < 128; j++) { float num = Mathf.Exp(0f - Mathf.Pow(((float)i / 31f - 0.55f) / 0.22f, 2f)); float num2 = Mathf.PerlinNoise((float)j * 0.11f, (float)i * 0.25f); float num3 = Mathf.Clamp01(num * (0.55f + 0.6f * num2)); ring.SetPixel(j, i, new Color(1f, 1f, 1f, num3)); } } ((Texture)ring).wrapMode = (TextureWrapMode)0; ring.Apply(); column = new Texture2D(64, 128, (TextureFormat)4, false); for (int k = 0; k < 128; k++) { for (int l = 0; l < 64; l++) { float num4 = Mathf.PerlinNoise((float)l * 0.21f, (float)k * 0.035f) * 0.7f + Mathf.PerlinNoise((float)l * 0.5f + 7f, (float)k * 0.09f) * 0.3f; float num5 = Mathf.Clamp01(0.35f + 0.75f * num4); float num6 = Mathf.Clamp01((num4 - 0.55f) * 3f); column.SetPixel(l, k, new Color(0.75f + 0.25f * num6, 0.9f + 0.1f * num6, 1f, num5)); } } ((Texture)column).wrapMode = (TextureWrapMode)0; column.Apply(); Texture2D val = StormFx.Tex("Water/awa01.png", (TextureWrapMode)1); droplet = ((((Texture)val).width >= 64 && ((Texture)val).height >= 128) ? Crop(val, 0, ((Texture)val).height - 64, 64, 64) : StormFx.soft); foam = Masked(StormFx.Tex("Water/eff20.png", (TextureWrapMode)0)); decal = new Texture2D(64, 64, (TextureFormat)4, false); for (int m = 0; m < 64; m++) { for (int n = 0; n < 64; n++) { float num7 = ((float)n - 31.5f) / 31.5f; float num8 = ((float)m - 31.5f) / 31.5f; float num9 = Mathf.Sqrt(num7 * num7 + num8 * num8); float num10 = Mathf.PerlinNoise((float)n * 0.12f, (float)m * 0.12f); float num11 = Mathf.Clamp01((1f - num9) * 1.6f - 0.1f + (num10 - 0.5f) * 0.6f); num11 = num11 * num11 * (3f - 2f * num11); decal.SetPixel(n, m, new Color(1f, 1f, 1f, num11)); } } ((Texture)decal).wrapMode = (TextureWrapMode)1; decal.Apply(); sealRing = Seal(StormFx.Tex("Raijin/mark.png", (TextureWrapMode)1)); } public static Texture2D Masked(Texture2D src) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(((Texture)src).width, ((Texture)src).height, (TextureFormat)4, false); Color[] pixels = src.GetPixels(); int width = ((Texture)src).width; int height = ((Texture)src).height; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { float num = ((float)j + 0.5f) / (float)width * 2f - 1f; float num2 = ((float)i + 0.5f) / (float)height * 2f - 1f; float num3 = Mathf.Clamp01(1f - Mathf.Sqrt(num * num + num2 * num2)); num3 = num3 * num3 * (3f - 2f * num3); Color val2 = pixels[i * width + j]; val2.a *= num3; pixels[i * width + j] = val2; } } val.SetPixels(pixels); ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(); return val; } private static Texture2D Seal(Texture2D glyphs) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_019a: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_0237: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(192, 192, (TextureFormat)4, true); Color[] array = (Color[])(object)new Color[36864]; int width = ((Texture)glyphs).width; int num = Mathf.Max(1, ((Texture)glyphs).height / 4); for (int i = 0; i < 192; i++) { for (int j = 0; j < 192; j++) { float num2 = ((float)j + 0.5f) / 192f * 2f - 1f; float num3 = ((float)i + 0.5f) / 192f * 2f - 1f; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = 0f; num5 = Mathf.Max(num5, Mathf.Clamp01(1f - Mathf.Abs(num4 - 0.93f) / 0.022f)); num5 = Mathf.Max(num5, Mathf.Clamp01(1f - Mathf.Abs(num4 - 0.42f) / 0.018f) * 0.9f); int num6 = Mathf.RoundToInt(Mathf.Atan2(num3, num2) / (MathF.PI / 2f)); float num7 = (float)num6 * MathF.PI / 2f; Vector2 val2 = new Vector2(Mathf.Cos(num7), Mathf.Sin(num7)) * 0.675f; Vector2 val3 = new Vector2(num2, num3) - val2; float num8 = 0f - (num7 - MathF.PI / 2f); Vector2 val4 = new Vector2(val3.x * Mathf.Cos(num8) - val3.y * Mathf.Sin(num8), val3.x * Mathf.Sin(num8) + val3.y * Mathf.Cos(num8)) / 0.2f; if (Mathf.Abs(val4.x) < 1f && Mathf.Abs(val4.y) < 1f) { int num9 = (num6 % 4 + 4) % 4; int num10 = Mathf.Clamp((int)((val4.x * 0.5f + 0.5f) * (float)width), 0, width - 1); int num11 = Mathf.Clamp((int)((val4.y * 0.5f + 0.5f) * (float)num), 0, num - 1) + num9 * num; Color pixel = glyphs.GetPixel(num10, num11); num5 = Mathf.Max(num5, pixel.a * Mathf.Max(pixel.r, pixel.g)); } array[i * 192 + j] = new Color(1f, 0.86f, 0.32f, num5); } } val.SetPixels(array); ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(); return val; } public static Mesh Profile(int sides, int rows, Func radius, float fadeTop, float fadeBottom) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); for (int i = 0; i <= rows; i++) { float num = (float)i / (float)rows; float num2 = radius(num); for (int j = 0; j <= sides; j++) { float num3 = (float)j / (float)sides * MathF.PI * 2f; list.Add(new Vector3(Mathf.Cos(num3) * num2, num, Mathf.Sin(num3) * num2)); list2.Add(new Vector2((float)j / (float)sides * 3f, num * 1.5f)); float num4 = Mathf.Clamp01((1f - num) / Mathf.Max(0.01f, fadeTop)) * Mathf.Clamp01(num / Mathf.Max(0.01f, fadeBottom)); list3.Add(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(255f * num4))); } } for (int k = 0; k < rows; k++) { for (int l = 0; l < sides; l++) { int num5 = k * (sides + 1) + l; int num6 = num5 + sides + 1; list4.AddRange(new int[6] { num5, num6, num5 + 1, num5 + 1, num6, num6 + 1 }); } } val.SetVertices(list); val.SetUVs(0, list2); val.SetColors(list3); val.SetTriangles(list4, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } public static Mesh Splash(int sides, int rows, Func radius, int repeats) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0096: 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_00ec: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); for (int i = 0; i <= rows; i++) { float num = (float)i / (float)rows; float num2 = radius(num); for (int j = 0; j <= sides; j++) { float num3 = (float)j / (float)sides * MathF.PI * 2f; float num4 = 1f + 0.08f * Mathf.Sin(num3 * 5f + num * 3f); list.Add(new Vector3(Mathf.Cos(num3) * num2 * num4, num, Mathf.Sin(num3) * num2 * num4)); list2.Add(new Vector2((float)j / (float)sides * (float)repeats, num * 0.98f + 0.01f)); list3.Add(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(255f * Mathf.Clamp01(num * 6f + 0.2f)))); } } for (int k = 0; k < rows; k++) { for (int l = 0; l < sides; l++) { int num5 = k * (sides + 1) + l; int num6 = num5 + sides + 1; list4.AddRange(new int[6] { num5, num6, num5 + 1, num5 + 1, num6, num6 + 1 }); } } val.SetVertices(list); val.SetUVs(0, list2); val.SetColors(list3); val.SetTriangles(list4, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } public static Texture2D SoftCrown() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(128, 128, (TextureFormat)4, true); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = (float)i / 127f; float num2 = Mathf.PerlinNoise((float)j * 0.09f, 3.1f) * 0.6f + Mathf.PerlinNoise((float)j * 0.23f, 7.7f) * 0.4f; float num3 = 0.62f + 0.3f * num2; float num4 = 1f - Mathf.SmoothStep(num3 - 0.22f, num3 + 0.06f, num); float num5 = Mathf.PerlinNoise((float)j * 0.3f, (float)i * 0.04f); float num6 = 0.7f + 0.3f * num5 + 0.2f * Mathf.SmoothStep(num3 - 0.25f, num3, num) * num4; val.SetPixel(j, i, new Color(Mathf.Clamp01(0.55f * num6 + 0.2f), Mathf.Clamp01(0.82f * num6 + 0.1f), 1f, num4 * (0.55f + 0.45f * num5))); } } ((Texture)val).wrapMode = (TextureWrapMode)0; val.Apply(); return val; } public static Mesh Cylinder(int sides, int rows, float topAlpha) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0075: 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_00ec: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); for (int i = 0; i <= rows; i++) { float num = (float)i / (float)rows; float num2 = Mathf.Lerp(1f, 0.62f, num); for (int j = 0; j <= sides; j++) { float num3 = (float)j / (float)sides * MathF.PI * 2f; list.Add(new Vector3(Mathf.Cos(num3) * num2, num, Mathf.Sin(num3) * num2)); list2.Add(new Vector2((float)j / (float)sides * 3f, num * 2f)); float num4 = Mathf.Clamp01(1f - Mathf.Pow(num, 2.2f) * (1f - topAlpha)) * Mathf.Clamp01(num * 8f + 0.25f); list3.Add(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(255f * num4))); } } for (int k = 0; k < rows; k++) { for (int l = 0; l < sides; l++) { int num5 = k * (sides + 1) + l; int num6 = num5 + sides + 1; list4.AddRange(new int[6] { num5, num6, num5 + 1, num5 + 1, num6, num6 + 1 }); } } val.SetVertices(list); val.SetUVs(0, list2); val.SetColors(list3); val.SetTriangles(list4, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } } public static class Water03 { public static Material column; public static Material columnRim; public static Material ring; public static Material droplet; public static Material foam; public static Material mist; public static Material decal; public static Material mass; public static Material massRim; public static Material sheet; public static Material crownMat; public static Material splash; public static Mesh cyl; public static Mesh geyser; public static Mesh crown; public static Mesh skirt; public static Mesh splashCrown; public static Mesh splashSpout; public static Material wave; public static Material splashUp; public static Material splashCrownSprite; public static Mesh ringThin; public static void Prepare() { //IL_00db: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: 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_0344: 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_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Expected O, but got Unknown //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: 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_04f5: Unknown result type (might be due to invalid IL or missing references) Tex03.Prepare(); cyl = Tex03.Cylinder(22, 10, 0f); geyser = Tex03.Profile(24, 12, (float h) => Mathf.Lerp(1f, 0.72f, h) + 0.3f * Mathf.Pow(h, 5f), 0.35f, 0.02f); crown = Tex03.Profile(24, 6, (float h) => Mathf.Lerp(0.75f, 2.3f, Mathf.Pow(h, 0.7f)), 0.55f, 0.15f); skirt = Tex03.Profile(28, 6, (float h) => Mathf.Lerp(2.4f, 0.9f, Mathf.Pow(h, 0.6f)), 0.6f, 0.02f); column = StormFx.Mat((Texture)(object)StormFx.Tex("Water/eff04.png", (TextureWrapMode)0), additive: false, new Color(0.85f, 0.96f, 1f, 0.82f), 1.15f, 3002); crownMat = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd00.png", (TextureWrapMode)0), additive: false, new Color(0.9f, 0.98f, 1f, 0.85f), 1.2f, 3003); columnRim = StormFx.Mat((Texture)(object)DragonWaterLook.FoamTex(StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0)), additive: true, new Color(0.9f, 0.97f, 1f, 0.45f), 1.3f, 3003); ring = StormFx.Mat((Texture)(object)Tex03.ring, additive: false, new Color(0.7f, 0.9f, 1f, 0.5f), 1.1f, 3003); droplet = StormFx.Mat((Texture)(object)StormFx.soft, additive: false, new Color(0.58f, 0.84f, 1f, 0.7f), 1.2f, 3004); foam = StormFx.Mat((Texture)(object)Tex03.foam, additive: false, new Color(0.9f, 0.97f, 1f, 0.8f), 1.15f, 3004); mist = StormFx.Mat((Texture)(object)Tex03.Masked(StormFx.Tex("Tandem/smoke.png", (TextureWrapMode)1)), additive: false, new Color(0.85f, 0.94f, 1f, 0.32f), 1f, 3005); decal = StormFx.Mat((Texture)(object)Tex03.decal, additive: false, new Color(0.05f, 0.15f, 0.22f, 0.5f), 1f, 2999); mass = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd07.png", (TextureWrapMode)0), additive: false, new Color(0.5f, 0.8f, 1f, 0.7f), 1.15f, 3002); massRim = StormFx.Mat((Texture)(object)DragonWaterLook.FoamTex(StormFx.Tex("Water/sjh_wtr02.png", (TextureWrapMode)0)), additive: true, new Color(0.95f, 0.99f, 1f, 0.6f), 1.3f, 3003); sheet = StormFx.Mat((Texture)(object)Tex03.Masked(StormFx.Tex("Water/eff12.png", (TextureWrapMode)1)), additive: false, new Color(0.82f, 0.95f, 1f, 0.85f), 1.2f, 3004); splash = StormFx.Mat((Texture)(object)Tex03.SoftCrown(), additive: false, new Color(0.72f, 0.9f, 1f, 0.85f), 1.1f, 3003); splashCrown = Tex03.Splash(30, 6, (float h) => Mathf.Lerp(0.45f, 2.7f, Mathf.Pow(h, 1.2f)), 5); splashSpout = Tex03.Splash(20, 8, (float h) => Mathf.Lerp(1f, 0.35f, h), 2); wave = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd07.png", (TextureWrapMode)0), additive: false, new Color(0.62f, 0.86f, 1f, 0.9f), 1.15f, 3003); splashUp = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd02.png", (TextureWrapMode)1), additive: false, new Color(0.86f, 0.95f, 1f, 0.92f), 1.1f, 3004); splashCrownSprite = StormFx.Mat((Texture)(object)StormFx.Tex("Water/srd06.png", (TextureWrapMode)1), additive: false, new Color(0.86f, 0.95f, 1f, 0.9f), 1.1f, 3004); ringThin = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val = default(Vector3); for (int num = 0; num <= 48; num++) { float num2 = (float)num * MathF.PI * 2f / 48f; ((Vector3)(ref val))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); list.Add(val * 0.94f); list.Add(val); list2.Add(new Vector2((float)num / 12f, 0f)); list2.Add(new Vector2((float)num / 12f, 1f)); if (num < 48) { int num3 = num * 2; list3.AddRange(new int[6] { num3, num3 + 1, num3 + 2, num3 + 1, num3 + 3, num3 + 2 }); } } ringThin.SetVertices(list); ringThin.SetUVs(0, list2); ringThin.SetTriangles(list3, 0); StormFx.White(ringThin); ringThin.RecalculateNormals(); ringThin.RecalculateBounds(); } public static void Strip(ParticleSystem ps, int rows) { //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_004f: 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) TextureSheetAnimationModule textureSheetAnimation = ps.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).mode = (ParticleSystemAnimationMode)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 1; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = rows; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).animation = (ParticleSystemAnimationType)0; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0f, 1f, 1f)); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).cycleCount = 1; RotationOverLifetimeModule rotationOverLifetime = ps.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = false; } public static void EmitUpright(ParticleSystem ps, Vector3 p, Vector3 v, float size, float life, Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_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_004c: 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) EmitParams val = default(EmitParams); ((EmitParams)(ref val)).position = p; ((EmitParams)(ref val)).velocity = v; ((EmitParams)(ref val)).startSize = size; ((EmitParams)(ref val)).startLifetime = life; ((EmitParams)(ref val)).startColor = Color32.op_Implicit(c); ((EmitParams)(ref val)).rotation = 0f; ((EmitParams)(ref val)).applyShapeToPosition = false; EmitParams val2 = val; ps.Emit(val2, 1); } public static void Cap(ParticleSystem ps, float max) { ((Component)ps).GetComponent().maxParticleSize = max; } public static Camera Cam() { foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.sceneCam)) { return readOnlyInstances.sceneCam; } } return Camera.main; } public static float CameraFade(Vector3 p, float near, float floor) { //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) Camera val = Cam(); if (!Object.op_Implicit((Object)(object)val)) { return 1f; } float num = Vector3.Distance(((Component)val).transform.position, p); return Mathf.Lerp(floor, 1f, Mathf.Clamp01((num - 2f) / Mathf.Max(0.1f, near - 2f))); } } public class WaterLaunchFx : MonoBehaviour { public Renderer mass; public Renderer massRim; public Renderer ringIn; public Renderer ringOut; public Renderer column; public Renderer decal; public ParticleSystem streams; public ParticleSystem drops; public ParticleSystem mist; public ParticleSystem foam; private float born; private float release; private float scale; private bool init; private bool surged; public static void Build(GameObject g) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) WaterLaunchFx waterLaunchFx = g.AddComponent(); waterLaunchFx.mass = (Renderer)(object)StormFx.Part(g, "Mass", StormFx.sphere, Water03.mass); waterLaunchFx.massRim = (Renderer)(object)StormFx.Part(g, "MassRim", StormFx.sphere, Water03.massRim); waterLaunchFx.ringIn = (Renderer)(object)StormFx.Part(g, "Gather", StormFx.ring, Water03.ring); waterLaunchFx.ringOut = (Renderer)(object)StormFx.Part(g, "Splash", StormFx.ring, Water03.ring); waterLaunchFx.column = (Renderer)(object)StormFx.Part(g, "Surge", Water03.geyser, Water03.column); waterLaunchFx.decal = (Renderer)(object)StormFx.Part(g, "Wet", StormFx.quad, Water03.decal); waterLaunchFx.streams = StormFx.System(g, "Streams", Water03.droplet, 200, -0.1f, stretch: true); StormFx.Fade(waterLaunchFx.streams, new Color(0.8f, 0.92f, 1f), new Color(0.7f, 0.9f, 1f), 0.6f, 0.5f, 0.55f); Water03.Cap(waterLaunchFx.streams, 0.016f); WaterBurstFx.Streak(waterLaunchFx.streams, 1.1f, 0.04f); waterLaunchFx.drops = StormFx.System(g, "Drops", Water03.droplet, 120, 1.6f, stretch: true); StormFx.Fade(waterLaunchFx.drops, new Color(0.8f, 0.92f, 1f), new Color(0.7f, 0.9f, 1f), 0.6f, 0.45f, 0.7f); Water03.Cap(waterLaunchFx.drops, 0.016f); WaterBurstFx.Streak(waterLaunchFx.drops, 1.1f, 0.04f); waterLaunchFx.mist = StormFx.System(g, "Mist", Water03.mist, 30, -0.04f, stretch: false, 0.8f); StormFx.Fade(waterLaunchFx.mist, Color.white, Color.white, 0.45f, 0.3f, 2f); Water03.Cap(waterLaunchFx.mist, 0.16f); waterLaunchFx.foam = StormFx.System(g, "Foam", Water03.foam, 40, 0.4f, stretch: false, 0.6f); StormFx.Fade(waterLaunchFx.foam, Color.white, Color.white, 0.85f, 0.6f, 1.5f); Water03.Cap(waterLaunchFx.foam, 0.12f); } private void OnEnable() { born = Time.time; init = false; surged = false; } private void Update() { //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_00d6: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0152: 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_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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: 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_01c9: 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_01e4: 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_01ee: 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_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_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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: 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_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_028c: 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_029f: 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_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: 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_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0456: 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_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0471: 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_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) if (!init) { init = true; EffectComponent component = ((Component)this).GetComponent(); scale = ((Object.op_Implicit((Object)(object)component) && component.effectData != null) ? Mathf.Max(0.3f, component.effectData.scale) : 1f); release = ((Object.op_Implicit((Object)(object)component) && component.effectData != null && component.effectData.genericFloat > 0f) ? component.effectData.genericFloat : 0f); ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Play(); } Animate(0f); } float num = Time.time - born; Vector3 up = Vector3.up; Vector3 forward = ((Component)this).transform.forward; _ = ((Component)this).transform.right; Vector3 val = ((Component)this).transform.position + up * 1.1f * scale; if (num < release + 0.05f) { int num2 = Mathf.CeilToInt(Time.deltaTime * 110f * scale); for (int j = 0; j < num2; j++) { Vector3 val2 = Quaternion.AngleAxis(Random.Range(0f, 360f), up) * forward; Vector3 val3 = ((Component)this).transform.position + val2 * Random.Range(1.4f, 3.4f) * scale + up * Random.Range(0f, 1.2f) * scale; float num3 = Random.Range(0.25f, 0.4f); Vector3 val4 = val + up * Random.Range(-0.3f, 1.2f) * scale; StormFx.Emit(streams, val3, (val4 - val3) / num3 + Vector3.Cross(up, val2) * 2.5f, Random.Range(0.07f, 0.13f) * scale, num3, Color.white); } } if (!surged && num >= release) { surged = true; for (int k = 0; k < 50; k++) { Vector3 val5 = Quaternion.AngleAxis(Random.Range(0f, 360f), up) * forward; StormFx.Emit(drops, ((Component)this).transform.position + val5 * Random.Range(0.3f, 1.4f) * scale + up * Random.Range(0.5f, 2.5f) * scale, (val5 * Random.Range(1.5f, 4f) + up * Random.Range(5f, 11f)) * scale, Random.Range(0.1f, 0.2f) * scale, Random.Range(0.6f, 1f), Color.white); } for (int l = 0; l < 16; l++) { Vector3 val6 = Quaternion.AngleAxis((float)l * 22.5f, up) * forward; StormFx.Emit(foam, ((Component)this).transform.position + val6 * 1.2f * scale + up * 0.3f, val6 * Random.Range(3f, 6f) * scale + up * 1.5f, Random.Range(0.9f, 1.5f) * scale, Random.Range(0.5f, 0.8f), Color.white); } for (int m = 0; m < 3; m++) { StormFx.Emit(mist, ((Component)this).transform.position + Random.insideUnitSphere * 1.5f * scale + up * 1.2f * scale, Random.insideUnitSphere * 2f + up * 1.5f, Random.Range(1.6f, 2.4f) * scale, Random.Range(0.5f, 0.8f), new Color(1f, 1f, 1f, 0.45f)); } } Animate(num); if (num > release + 2.2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Animate(float t) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01dd: 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_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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: 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_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: 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_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) float num = scale * 0.72f; float num2 = Water03.CameraFade(((Component)this).transform.position + Vector3.up * 1.5f, 10f, 0.05f); float num3 = StormFx.Ease(t / Mathf.Max(0.15f, release)); float num4 = t - release; float num5 = Mathf.Clamp01((num4 - 0.25f) / 0.6f); ((Component)mass).transform.localPosition = Vector3.up * (0.35f + 0.4f * num3) * num; ((Component)mass).transform.localRotation = Quaternion.Euler(0f, t * 260f, 0f); ((Component)mass).transform.localScale = new Vector3(2f, 0.9f + ((num4 > 0f) ? (0.7f * Mathf.Sin(Mathf.Clamp01(num4 / 0.3f) * MathF.PI)) : 0f), 2f) * Mathf.Lerp(0.15f, 1f, num3) * (1f - 0.8f * num5) * num; ((Component)massRim).transform.localPosition = ((Component)mass).transform.localPosition; ((Component)massRim).transform.localRotation = Quaternion.Euler(0f, (0f - t) * 200f, 0f); ((Component)massRim).transform.localScale = ((Component)mass).transform.localScale * 1.06f; float num6 = (1f - num5) * num2; StormFx.Tint(mass, new Color(0.22f, 0.5f, 0.95f, 0.8f * num6)); StormFx.Tint(massRim, new Color(1f, 1f, 1f, 0.95f * num6)); StormFx.Scroll(mass, new Vector2(t * 0.2f, (0f - t) * 1.2f), Vector2.one); StormFx.Scroll(massRim, new Vector2((0f - t) * 0.3f, (0f - t) * 1.8f), Vector2.one); ((Component)ringIn).gameObject.SetActive(t < release + 0.1f); ((Component)ringIn).transform.localPosition = Vector3.up * 0.07f; ((Component)ringIn).transform.localRotation = Quaternion.Euler(0f, t * 140f, 0f); ((Component)ringIn).transform.localScale = Vector3.one * Mathf.Lerp(2.4f, 1f, num3) * num; StormFx.Tint(ringIn, new Color(0.95f, 0.98f, 1f, 0.65f * Mathf.Clamp01(t / 0.1f) * num2)); StormFx.Scroll(ringIn, new Vector2(t * 0.6f, 0f), new Vector2(3f, 1f)); bool flag = num4 > 0.2f; ((Component)ringOut).gameObject.SetActive(flag); if (flag) { float num7 = (num4 - 0.2f) / 0.8f; ((Component)ringOut).transform.localPosition = Vector3.up * 0.08f; ((Component)ringOut).transform.localScale = Vector3.one * (1.2f + 2.6f * StormFx.Ease(num7)) * num; StormFx.Tint(ringOut, new Color(1f, 1f, 1f, 0.75f * Mathf.Clamp01(1f - num7) * num2)); } bool flag2 = num4 > -0.03f && num4 < 1f; ((Component)column).gameObject.SetActive(flag2); if (flag2) { float num8 = StormFx.Ease((num4 + 0.03f) / 0.16f); float num9 = Mathf.Clamp01((num4 - 0.3f) / 0.6f); ((Component)column).transform.localPosition = Vector3.up * 0.05f; ((Component)column).transform.localScale = new Vector3(0.55f * (1f - 0.5f * num9), 3.6f * num8 * (1f - 0.85f * num9) + 0.01f, 0.55f * (1f - 0.5f * num9)) * num; StormFx.Tint(column, new Color(0.65f, 0.88f, 1f, 0.75f * (1f - num9) * num2)); StormFx.Scroll(column, new Vector2(t * 0.15f, (0f - t) * 2.8f), Vector2.one); } ((Component)decal).transform.localPosition = Vector3.up * 0.05f; ((Component)decal).transform.localRotation = Quaternion.Euler(90f, 0f, 0f); ((Component)decal).transform.localScale = Vector3.one * 3.6f * num; StormFx.Tint(decal, new Color(0.05f, 0.15f, 0.22f, 0.5f * Mathf.Clamp01(t / 0.3f) * (1f - Mathf.Clamp01((num4 - 1f) / 1f)))); } } public class WaterBurstFx : MonoBehaviour { public Renderer ringA; public Renderer ringB; public Renderer decal; public Renderer rip1; public Renderer rip2; public Renderer rip3; public Renderer waveR; public ParticleSystem drops; public ParticleSystem splashA; public ParticleSystem splashB; public ParticleSystem foamPs; public ParticleSystem mist; public ParticleSystem lipSpray; private float born; private float scale; private float far = 1f; private float lipAcc; private bool init; private bool crownDone; private Vector3 fwd; private Vector3 rightV; private const int ANG = 72; private const int RAD = 18; private Mesh waveMesh; private Vector3[] wv; private Vector3[] wn; private Color[] wc; private Vector2[] wuv; public const float WaveR0 = 1f; public const float WaveRMax = 7.5f; public const float WaveDir = 0.6f; public const float WaveTau = 0.35f; public const float CrestH = 1.4f; public const float CrestDir = 0.5f; public const float CrestU = 0.82f; public const float CrestW = 0.16f; public const float MoundH = 1.6f; public const float MoundT = 0.3f; public static void Build(GameObject g) { //IL_0160: 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_01f3: 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_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_02e0: 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_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_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) WaterBurstFx waterBurstFx = g.AddComponent(); waterBurstFx.waveR = (Renderer)(object)StormFx.Part(g, "Wave", null, Water03.wave); waterBurstFx.ringA = (Renderer)(object)StormFx.Part(g, "Shock", StormFx.ring, Water03.ring); waterBurstFx.ringB = (Renderer)(object)StormFx.Part(g, "Foam", StormFx.ring, Water03.ring); waterBurstFx.decal = (Renderer)(object)StormFx.Part(g, "Wet", StormFx.quad, Water03.decal); waterBurstFx.rip1 = (Renderer)(object)StormFx.Part(g, "Ripple1", Water03.ringThin, Water03.ring); waterBurstFx.rip2 = (Renderer)(object)StormFx.Part(g, "Ripple2", Water03.ringThin, Water03.ring); waterBurstFx.rip3 = (Renderer)(object)StormFx.Part(g, "Ripple3", Water03.ringThin, Water03.ring); Renderer[] array = (Renderer[])(object)new Renderer[6] { waterBurstFx.waveR, waterBurstFx.ringA, waterBurstFx.ringB, waterBurstFx.rip1, waterBurstFx.rip2, waterBurstFx.rip3 }; for (int i = 0; i < array.Length; i++) { ((Component)array[i]).gameObject.SetActive(false); } waterBurstFx.decal.enabled = false; waterBurstFx.drops = StormFx.System(g, "Drops", Water03.droplet, 460, 1.8f, stretch: true); StormFx.Fade(waterBurstFx.drops, new Color(0.93f, 0.98f, 1f), new Color(0.7f, 0.9f, 1f), 0.85f, 0.55f, 0.6f); Water03.Cap(waterBurstFx.drops, 0.016f); Streak(waterBurstFx.drops, 1.1f, 0.04f); Streak(waterBurstFx.drops, 1.1f, 0.03f); waterBurstFx.lipSpray = StormFx.System(g, "LipSpray", Water03.droplet, 260, 1.2f, stretch: true); StormFx.Fade(waterBurstFx.lipSpray, Color.white, new Color(0.85f, 0.95f, 1f), 0.95f, 0.6f, 0.8f); Water03.Cap(waterBurstFx.lipSpray, 0.04f); Streak(waterBurstFx.lipSpray, 1f, 0.025f); waterBurstFx.splashA = StormFx.System(g, "SplashUp", Water03.splashUp, 40, 0.8f, stretch: false); StormFx.Fade(waterBurstFx.splashA, Color.white, new Color(0.85f, 0.95f, 1f), 1f, 0.9f, 1.25f); Water03.Strip(waterBurstFx.splashA, 8); Water03.Cap(waterBurstFx.splashA, 0.3f); waterBurstFx.splashB = StormFx.System(g, "SplashCrown", Water03.splashCrownSprite, 30, 0.5f, stretch: false); StormFx.Fade(waterBurstFx.splashB, Color.white, new Color(0.85f, 0.95f, 1f), 1f, 0.9f, 1.2f); Water03.Strip(waterBurstFx.splashB, 8); Water03.Cap(waterBurstFx.splashB, 0.25f); waterBurstFx.foamPs = StormFx.System(g, "FoamSkim", Water03.foam, 90, 0.3f, stretch: false, 1.2f); StormFx.Fade(waterBurstFx.foamPs, Color.white, Color.white, 0.32f, 0.22f, 2.2f); Water03.Cap(waterBurstFx.foamPs, 0.12f); waterBurstFx.mist = StormFx.System(g, "Mist", Water03.mist, 40, -0.05f, stretch: false, 0.9f); StormFx.Fade(waterBurstFx.mist, Color.white, Color.white, 0.3f, 0.2f, 2.4f); Water03.Cap(waterBurstFx.mist, 0.18f); } public static void Streak(ParticleSystem ps, float len, float vel) { ParticleSystemRenderer component = ((Component)ps).GetComponent(); component.lengthScale = len; component.velocityScale = vel; } private void OnEnable() { born = Time.time; init = false; crownDone = false; } private void Update() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0236: 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) if (!init) { init = true; EffectComponent component = ((Component)this).GetComponent(); scale = ((Object.op_Implicit((Object)(object)component) && component.effectData != null) ? Mathf.Max(1f, component.effectData.scale) : 9f); fwd = Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up); if (((Vector3)(ref fwd)).sqrMagnitude < 0.01f) { fwd = Vector3.forward; } ((Vector3)(ref fwd)).Normalize(); rightV = Vector3.Cross(Vector3.up, fwd); Camera val = Water03.Cam(); far = (Object.op_Implicit((Object)(object)val) ? (Mathf.Clamp(Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) / 18f, 1f, 1.6f) + 1.4f * Mathf.Clamp01((Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) - 29f) / 90f)) : 1f); waveMesh = new Mesh(); ((Object)waveMesh).name = "Tobirama crash wave"; waveMesh.MarkDynamic(); int num = 1387; wv = (Vector3[])(object)new Vector3[num]; wn = (Vector3[])(object)new Vector3[num]; wc = (Color[])(object)new Color[num]; wuv = (Vector2[])(object)new Vector2[num]; List list = new List(); for (int i = 0; i < 18; i++) { for (int j = 0; j < 72; j++) { int num2 = i * 73 + j; int num3 = num2 + 72 + 1; list.AddRange(new int[6] { num2, num2 + 1, num3 + 1, num2, num3 + 1, num3 }); } } waveMesh.vertices = wv; waveMesh.uv = wuv; waveMesh.colors = wc; waveMesh.triangles = list.ToArray(); waveMesh.bounds = new Bounds(Vector3.zero, Vector3.one * 60f); ((Component)waveR).GetComponent().sharedMesh = waveMesh; ((Component)waveR).gameObject.SetActive(true); decal.enabled = true; ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren.Length; k++) { componentsInChildren[k].Play(); } Erupt(); } float num4 = Time.time - born; Animate(num4); if (!crownDone && num4 > 0.12f) { crownDone = true; } if (num4 < 0.75f) { Lip(num4); } if (num4 > 0.3f && num4 < 0.34f) { Mist(); } if (num4 > 4.2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private static float Smooth(float x) { x = Mathf.Clamp01(x); return x * x * (3f - 2f * x); } private static float Front(float a, float t) { float num = Mathf.Cos(a); float num2 = 1f + 7.5f * (1f + 0.6f * num) * (1f - Mathf.Exp((0f - t) / 0.35f)); float num3 = 1f + 0.07f * Mathf.Sin(5f * a + 2f * t) + 0.05f * Mathf.Sin(9f * a - 3f * t + 1f) + 0.04f * Mathf.Sin(14f * a + 5f * t); return num2 * num3; } private static float Height(float a, float u, float t) { float num = Mathf.Cos(a); float num2 = 1f + 0.2f * Mathf.Sin(3f * a + 2f * t) + 0.1f * Mathf.Sin(5f * a - t + 2f); float num3 = 1.4f * (1f + 0.5f * num) * num2 * Smooth(t / 0.15f) * (1f - Smooth((t - 0.25f) / 0.75f)) * Mathf.Exp(0f - Sq((u - 0.82f) / 0.16f)); float num4 = 1.6f * (1f - Smooth(t / 0.3f)) * (1f - u) * (1f - u); float num5 = 0.2f * (1f - Smooth((t - 0.2f) / 0.4f)) * (1f - u) * u * 4f; return num3 + num4 + num5; } private static float Lean(float u, float t) { return 0.9f * Smooth((u - 0.55f) / 0.4f) * (1f + 0.6f * Smooth((t - 0.2f) / 0.5f)); } private static float Alpha(float a, float u, float t) { float num = 1f - Smooth((t - 0.4f) / 0.35f); float num2 = 1f - Smooth((t - 0.15f) / 0.45f) * (1f - u); float num3 = 1f - Smooth((u - 0.8f) / 0.2f); float num4 = 0.85f + 0.15f * Mathf.Sin(4f * a + 2f * t); return (0.45f + 0.25f * Smooth((u - 0.3f) / 0.4f)) * num3 * num4 * num * num2; } private static float Sq(float x) { return x * x; } private void Wave(float t, float cam) { //IL_0026: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0101: 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_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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_01ea: 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_0227: 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_0231: 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_0256: 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_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_02d7: 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_040c: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //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_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0532: 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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) float num = scale / 9f; bool flag = t < 1.15f; waveR.enabled = flag; if (!flag) { return; } Vector3 val = Vector3.up * 0.05f; Camera val2 = Water03.Cam(); Vector3 val3 = (Object.op_Implicit((Object)(object)val2) ? ((Component)this).transform.InverseTransformPoint(((Component)val2).transform.position) : (Vector3.up * 10f)); float num2 = num * (1f + 0.4f * (far - 1f)); float num3 = num * far; Vector3 val4 = default(Vector3); for (int i = 0; i <= 18; i++) { float num4 = (float)i / 18f; for (int j = 0; j <= 72; j++) { float num5 = (float)j / 72f * MathF.PI * 2f; int num6 = i * 73 + j; ((Vector3)(ref val4))..ctor(Mathf.Sin(num5), 0f, Mathf.Cos(num5)); float num7 = Height(num5, num4, t) * num3; wv[num6] = val + val4 * (Front(num5, t) * num4 * num2 + num7 * Lean(num4, t)) + Vector3.up * num7; wuv[num6] = new Vector2((float)j / 72f * 4f + t * 0.1f, num4 * 2.5f - t * 0.9f); } } for (int k = 0; k <= 18; k++) { for (int l = 0; l <= 72; l++) { int num8 = k * 73 + l; Vector3 val5 = wv[Mathf.Min(k + 1, 18) * 73 + l] - wv[Mathf.Max(k - 1, 0) * 73 + l]; Vector3 val6 = Vector3.Cross(wv[k * 73 + ((l + 1 > 72) ? 1 : (l + 1))] - wv[k * 73 + ((l - 1 < 0) ? 71 : (l - 1))], val5); if (((Vector3)(ref val6)).sqrMagnitude < 1E-08f) { val6 = Vector3.up; } ((Vector3)(ref val6)).Normalize(); if (val6.y < 0f) { val6 = -val6; } wn[num8] = val6; float num9 = (float)k / 18f; float num10 = (float)l / 72f * MathF.PI * 2f; Vector3 val7 = val3 - wv[num8]; float magnitude = ((Vector3)(ref val7)).magnitude; val7 /= Mathf.Max(0.01f, magnitude); float num11 = 1f - Mathf.Abs(Vector3.Dot(val6, val7)); float num12 = Alpha(num10, num9, t) * cam * Mathf.SmoothStep(0f, 1f, (magnitude - 2.5f) / 4f); Mathf.Exp(0f - Sq((num9 - 0.86f) / 0.09f)); Smooth(t / 0.12f); Mathf.Sin(6f * num10 + 3f * t); float num13 = Mathf.SmoothStep(0f, 1f, (num11 - 0.5f) / 0.32f); float num14 = Mathf.PerlinNoise(num10 * 5f + t * 1.5f, num9 * 5f - t * 3f); float num15 = Mathf.Clamp01(Mathf.Exp(0f - Sq((num9 - 0.7f) / 0.13f)) * 4f * Smooth(t / 0.1f) + Mathf.SmoothStep(0f, 1f, (num11 - 0.6f) / 0.26f) * 0.8f) * Mathf.SmoothStep(0f, 1f, (num14 - 0.3f) / 0.12f); Vector3 val8 = val7 + Vector3.up; Vector3 normalized = ((Vector3)(ref val8)).normalized; float num16 = Mathf.Pow(Mathf.Max(0f, Vector3.Dot(val6, normalized)), 24f) * Mathf.SmoothStep(0f, 1f, (Mathf.PerlinNoise(num10 * 9f - t * 2f, num9 * 7f + t * 2.5f) - 0.45f) / 0.2f); Color val9 = Color.Lerp(new Color(Mathf.Lerp(0.03f, 0.6f, num13), Mathf.Lerp(0.17f, 0.9f, num13), Mathf.Lerp(0.55f, 1f, num13)), Color.white, Mathf.Clamp01(num15 + num16)); wc[num8] = new Color(val9.r, val9.g, val9.b, Mathf.Clamp01((0.62f + 0.3f * num13 + 0.3f * num16) * num12 + 0.9f * num15 * Alpha(num10, Mathf.Min(num9, 0.78f), t) * cam)); } } waveMesh.vertices = wv; waveMesh.normals = wn; waveMesh.colors = wc; waveMesh.uv = wuv; waveMesh.RecalculateBounds(); } private float Dir(Vector3 d) { //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) return Vector3.Dot(d, fwd); } private void Erupt() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_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_01be: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) Vector3 up = Vector3.up; float num = scale / 9f; float num2 = Mathf.Sqrt(num); for (int i = 0; i < 360; i++) { Vector3 val = Quaternion.AngleAxis(Random.Range(0f, 360f), up) * fwd; float num3 = Dir(val); float num4 = Random.Range(7f, 20f) * (1f + 0.5f * num3) * num2; float num5 = Random.Range(10f, 45f) * (MathF.PI / 180f); StormFx.Emit(drops, ((Component)this).transform.position + val * Random.Range(0.3f, 1.5f) * num + up * Random.Range(0.3f, 1.2f) * num, val * (num4 * Mathf.Cos(num5)) + up * (num4 * Mathf.Sin(num5)), Random.Range(0.08f, 0.2f) * num * far, Random.Range(0.8f, 1.4f), Color.white); } for (int j = 0; j < 30; j++) { Vector3 val2 = Quaternion.AngleAxis((float)j * 12f + Random.Range(-5f, 5f), up) * fwd; float num6 = Dir(val2); StormFx.Emit(foamPs, ((Component)this).transform.position + val2 * Random.Range(1.2f, 2.5f) * num + up * 0.15f, val2 * Random.Range(9f, 15f) * (1f + 0.45f * num6) * num, Random.Range(1.2f, 2f) * num, Random.Range(0.6f, 1f), Color.white); } } private void Lip(float t) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_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_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_017f: Unknown result type (might be due to invalid IL or missing references) float num = scale / 9f; lipAcc += Time.deltaTime * 220f * (1f - Smooth((t - 0.3f) / 0.45f)); Vector3 up = Vector3.up; Vector3 val = default(Vector3); while (lipAcc >= 1f) { lipAcc -= 1f; float num2 = Random.Range(0f, MathF.PI * 2f); ((Vector3)(ref val))..ctor(Mathf.Sin(num2), 0f, Mathf.Cos(num2)); Vector3 val2 = ((Component)this).transform.TransformDirection(val); float num3 = Mathf.Cos(num2); float num4 = Front(num2, t) * 0.82f * num * (1f + 0.4f * (far - 1f)); float num5 = Height(num2, 0.82f, t) * num * far; StormFx.Emit(lipSpray, ((Component)this).transform.position + val2 * (num4 + num5 * Lean(0.82f, t)) + up * num5, val2 * Random.Range(4f, 9f) * (1f + 0.4f * num3) + up * Random.Range(2.5f, 6f), Random.Range(0.05f, 0.12f) * num * far, Random.Range(0.45f, 0.8f), Color.white); } } private void Crown() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) Vector3 up = Vector3.up; float num = scale / 9f; for (int i = 0; i < 8; i++) { Vector3 val = Quaternion.AngleAxis((float)i * 45f + Random.Range(-14f, 14f), up) * fwd; float num2 = Dir(val); float num3 = (1f + 7.5f * (1f + 0.6f * num2) * (1f - Mathf.Exp(-12f / 35f))) * 0.82f * num; float num4 = Random.Range(1.8f, 2.8f) * (1f + 0.25f * num2) * num; Water03.EmitUpright(splashB, ((Component)this).transform.position + val * num3 + up * (0.2f + num4 * 0.3f), val * (9f * (1f + 0.45f * num2)) * Mathf.Sqrt(num) + up * 2.5f, num4, Random.Range(0.4f, 0.5f), new Color(0.72f, 0.88f, 1f, 0.45f)); } } private void Mist() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_011e: Unknown result type (might be due to invalid IL or missing references) Vector3 up = Vector3.up; float num = scale / 9f; for (int i = 0; i < 7; i++) { Vector3 val = Quaternion.AngleAxis((float)i * 36f + Random.Range(-16f, 16f), up) * fwd; float num2 = Dir(val); StormFx.Emit(mist, ((Component)this).transform.position + val * Random.Range(2f, 7f) * (1f + 0.3f * num2) * num + up * Random.Range(0.2f, 2.4f) * num, val * Random.Range(1f, 3.5f) + up * Random.Range(0.3f, 1.4f), Random.Range(1.6f, 4.6f) * num, Random.Range(0.7f, 2.1f), new Color(1f, 1f, 1f, Random.Range(0.5f, 1f))); } } private void Animate(float t) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0148: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) float num = scale / 9f; float cam = Water03.CameraFade(((Component)this).transform.position + Vector3.up * 2f, 12f, 0.3f); Wave(t, cam); float num2 = (1f + 7.5f * (1f - Mathf.Exp((0f - t) / 0.35f))) * num; Ring(ringA, t, 0f, 0.8f, 0.5f, cam, num2 * 1.02f); Ring(ringB, t, 0.08f, 0.9f, 0.35f, cam, num2 * 0.92f); Ripple(rip1, t, 0.45f, 1.1f, cam); Ripple(rip2, t, 0.7f, 1.2f, cam); Ripple(rip3, t, 0.95f, 1.3f, cam); float num3 = 1f - Mathf.Clamp01((t - 2.4f) / 1.6f); ((Component)decal).transform.localPosition = Vector3.up * 0.05f; ((Component)decal).transform.localRotation = Quaternion.Euler(90f, 0f, 0f); ((Component)decal).transform.localScale = Vector3.one * scale * 2f; StormFx.Tint(decal, new Color(0.05f, 0.15f, 0.22f, 0.55f * num3 * Mathf.Clamp01(t / 0.25f))); } private void Ring(Renderer r, float t, float delay, float life, float alpha, float cam, float radius) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) float num = (t - delay) / life; ((Component)r).gameObject.SetActive(num > 0f && num < 1f); if (!(num <= 0f) && !(num >= 1f)) { ((Component)r).transform.localPosition = Vector3.up * 0.1f; ((Component)r).transform.localRotation = Quaternion.Euler(0f, t * 30f, 0f); ((Component)r).transform.localScale = Vector3.one * Mathf.Max(0.5f, radius); StormFx.Tint(r, new Color(0.78f, 0.94f, 1f, alpha * (1f - num) * cam)); StormFx.Scroll(r, new Vector2(t * 0.3f, 0f), new Vector2(4f, 1f)); } } private void Ripple(Renderer r, float t, float start, float life, float cam) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0087: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) float num = (t - start) / life; ((Component)r).gameObject.SetActive(num > 0f && num < 1f); if (!(num <= 0f) && !(num >= 1f)) { ((Component)r).transform.localPosition = Vector3.up * 0.06f; ((Component)r).transform.localRotation = Quaternion.identity; ((Component)r).transform.localScale = Vector3.one * Mathf.Lerp(1.5f, scale * 1.5f, StormFx.Ease(num)); StormFx.Tint(r, new Color(0.75f, 0.92f, 1f, 0.28f * (1f - num) * (1f - num) * cam)); StormFx.Scroll(r, new Vector2(0f, 0f), new Vector2(6f, 1f)); } } } public static class WaterRelay { public static ConfigEntry Range; public static ConfigEntry Life; public static ConfigEntry Cooldown; public static ConfigEntry Damage; public static ConfigEntry Proc; public static ConfigEntry MeleeDamage; public static ConfigEntry MeleeProc; public static GameObject prefab; public static GameObject dragon; public static SkillDef skill; public static SkillFamily family; public static void Init(ConfigFile c, float scale) { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown RelayKeys.Install(); MeleeDamage = c.Bind("Water Clone Relay", "MeleeDamageFraction", 0.7f, "Owner primary strike damage fraction; applied once."); MeleeProc = c.Bind("Water Clone Relay", "MeleeProcFraction", 0.7f, "Owner primary proc fraction; no duplicated inventory."); Range = c.Bind("Water Clone Relay", "PlacementRange", 20f, "Maximum distance from owner to selected surface."); Life = c.Bind("Water Clone Relay", "Lifetime", 14f, "Seconds from successful deployment."); Cooldown = c.Bind("Water Clone Relay", "Cooldown", 18f, "Recharge starts on successful deployment."); Damage = c.Bind("Water Clone Relay", "DamageFraction", 0.7f, "Fraction of the player's captured Water Dragon damage."); Proc = c.Bind("Water Clone Relay", "ProcFraction", 0.7f, "Fraction of normal Water Dragon proc coefficient."); dragon = PrefabAPI.InstantiateClone(Kit.water, "TobiramaRelayDragon"); dragon.GetComponent().procCoefficient = KitTuning.WaterProc.Value * Proc.Value; Kit.projectiles.Add(dragon); GameObject val = new GameObject("TobiramaRelayTemplate"); val.SetActive(false); val.AddComponent(); val.AddComponent(); GameObject val2 = new GameObject("RelayModel"); val2.transform.SetParent(val.transform, false); Visual.Build(val2, scale).reviewOverride = true; prefab = PrefabAPI.InstantiateClone(val, "TobiramaWaterRelayClone", true); Object.DestroyImmediate((Object)(object)val); RelaySmoke.Prepare(); } public static void AddSkill(GameObject body, List defs, List families) { //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_00fe: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_01f9: 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) body.AddComponent(); GenericSkill val = body.AddComponent(); body.AddComponent().extraFirst = val; skill = (SkillDef)(object)ScriptableObject.CreateInstance(); ((Object)skill).name = "TobiramaWaterCloneRelay"; skill.skillName = "TobiramaWaterCloneRelay"; skill.skillNameToken = "TOBI_RELAY_NAME"; skill.skillDescriptionToken = "TOBI_RELAY_DESC"; skill.icon = RelaySmoke.Icon(); skill.activationState = new SerializableEntityStateType(typeof(RelayDeploy)); skill.activationStateMachineName = "Weapon"; skill.baseMaxStock = 1; skill.rechargeStock = 1; skill.requiredStock = 1; skill.stockToConsume = 0; skill.baseRechargeInterval = Cooldown.Value; skill.beginSkillCooldownOnSkillEnd = false; skill.mustKeyPress = true; skill.isCombatSkill = true; skill.interruptPriority = (InterruptPriority)1; skill.cancelSprintingOnActivation = false; LanguageAPI.Add(skill.skillNameToken, "Shadow Clone Relay"); LanguageAPI.Add(skill.skillDescriptionToken, $"Place a shadow clone on clear terrain within {Range.Value:0}m for {Life.Value:0}s. Stationary taijutsu deals {MeleeDamage.Value * 100f:0}% of your strike damage. Water Dragon takes priority. Each Water Dragon is mirrored toward your target for {Damage.Value * 100f:0}% damage. One clone; invalid placement costs nothing. {Cooldown.Value:0}s recharge."); family = ScriptableObject.CreateInstance(); ((Object)family).name = "TobiramaWaterCloneRelayFamily"; SkillFamily obj = family; Variant[] array = new Variant[1]; Variant val2 = new Variant { skillDef = skill }; ((Variant)(ref val2)).viewableNode = new Node(skill.skillName, false, (Node)null); array[0] = val2; obj.variants = (Variant[])(object)array; typeof(GenericSkill).GetField("_skillFamily", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(val, family); defs.Add(skill); families.Add(family); } public static bool Placement(CharacterBody b, out Vector3 foot, out string reason) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_007a: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_020d: 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_021e: 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_022d: Unknown result type (might be due to invalid IL or missing references) foot = Vector3.zero; reason = "no surface"; if (!Object.op_Implicit((Object)(object)b) || !Object.op_Implicit((Object)(object)b.inputBank)) { return false; } Ray val = default(Ray); ((Ray)(ref val))..ctor(b.inputBank.aimOrigin, b.inputBank.aimDirection); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, Range.Value + 2f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return false; } if (Vector3.Distance(b.corePosition, ((RaycastHit)(ref val2)).point) > Range.Value) { reason = "out of range"; return false; } if (((RaycastHit)(ref val2)).normal.y < 0.7f) { reason = "steep surface"; return false; } foot = ((RaycastHit)(ref val2)).point + Vector3.up * 0.08f; float num = (Object.op_Implicit((Object)(object)b.characterMotor) ? ((BaseCharacterController)b.characterMotor).Motor.Capsule.radius : 0.5f); float num2 = (Object.op_Implicit((Object)(object)b.characterMotor) ? ((BaseCharacterController)b.characterMotor).Motor.Capsule.height : 2f); if (Physics.CheckCapsule(foot + Vector3.up * (num + 0.08f), foot + Vector3.up * Mathf.Max(num + 0.08f, num2 - num), num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { reason = "clearance"; return false; } if (Physics.OverlapCapsule(foot + Vector3.up * num, foot + Vector3.up * Mathf.Max(num, num2 - num), num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2).Any((Collider c) => Object.op_Implicit((Object)(object)((Component)c).GetComponent()))) { reason = "occupied"; return false; } if (Physics.Linecast(((Ray)(ref val)).origin, ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * 0.05f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { reason = "obstruction"; return false; } reason = "valid"; return true; } public static Vector3 Target(CharacterBody b, Ray aim) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) foreach (RaycastHit item in from x in Physics.RaycastAll(aim, 150f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2) orderby ((RaycastHit)(ref x)).distance select x) { RaycastHit current = item; if (!((Component)((RaycastHit)(ref current)).collider).transform.IsChildOf(b.transform) && ((LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) & (1 << ((Component)((RaycastHit)(ref current)).collider).gameObject.layer)) != 0 || Kit.AttackTarget(b, ((Component)((RaycastHit)(ref current)).collider).GetComponent()))) { return ((RaycastHit)(ref current)).point; } } return ((Ray)(ref aim)).GetPoint(Mathf.Max(30f, KitTuning.WaterSpeed.Value * KitTuning.WaterLife.Value)); } } public class RelaySkillDef : SkillDef { private float nextFeedback; public override bool CanExecute(GenericSkill s) { return ((SkillDef)this).CanExecute(s); } public override void OnExecute(GenericSkill s) { if (!WaterRelay.Placement(s.characterBody, out var _, out var reason)) { if (Time.unscaledTime > nextFeedback) { nextFeedback = Time.unscaledTime + 0.7f; Util.PlaySound("Play_UI_error", ((Component)s).gameObject); } Kit.Log("RELAY_REJECT " + reason); } else { ((SkillDef)this).OnExecute(s); } } } public class RelayDeploy : TobiCast { public override void OnEnter() { base.OnEnter(); Play(((EntityState)this).characterMotor.isGrounded ? "Water_Dragon" : "Water_Dragon_Air", 1.7f); if (NetworkServer.active) { ((Component)((EntityState)this).characterBody).GetComponent().Deploy(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.28f) { completed = true; ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { completed = true; base.OnExit(); } } public class RelayOwner : MonoBehaviour { public RelayClone clone; public uint generation; public uint castId; public uint paidGeneration; private CharacterBody body; public GenericSkill Slot => ((Component)this).GetComponent().extraFirst; private void Awake() { body = ((Component)this).GetComponent(); } public void Pay(uint id) { if (id > paidGeneration) { paidGeneration = id; Slot.stock = Mathf.Max(0, Slot.stock - 1); Slot.rechargeStopwatch = 0f; } } public unsafe bool Deploy() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !body.healthComponent.alive || Slot.stock < 1 || !WaterRelay.Placement(body, out var foot, out var _)) { return false; } GameObject obj = Object.Instantiate(WaterRelay.prefab, foot, Quaternion.identity); RelayClone component = obj.GetComponent(); component.ownerId = ((NetworkBehaviour)body).netId; component.owner = body; component.generation = ++generation; component.expires = FixedTimeStamp.now.t + WaterRelay.Life.Value; component.target = WaterRelay.Target(body, new Ray(body.inputBank.aimOrigin, body.inputBank.aimDirection)); obj.SetActive(true); NetworkServer.Spawn(obj); RelayClone relayClone = clone; clone = component; Pay(generation); if (Object.op_Implicit((Object)(object)relayClone)) { relayClone.End(dissolve: true); } RelaySmoke.Emit(foot); string[] obj2 = new string[6] { "RELAY_DEPLOY generation=", generation.ToString(), " foot=", null, null, null }; Vector3 val = foot; obj2[3] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); obj2[4] = " expiry="; obj2[5] = component.expires.ToString(); Kit.Log(string.Concat(obj2)); return true; } public uint Begin(float speed) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) uint num = ++castId; if (NetworkServer.active && Object.op_Implicit((Object)(object)clone)) { clone.Begin(num, speed, WaterRelay.Target(body, new Ray(body.inputBank.aimOrigin, body.inputBank.aimDirection))); } return num; } public void Release(uint id, Vector3 target, float damage, bool crit) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)clone)) { clone.Release(id, target, damage, crit); } } public void Cancel(uint id) { if (NetworkServer.active && Object.op_Implicit((Object)(object)clone) && clone.cast == id) { clone.CancelCast(); } } private void FixedUpdate() { if (NetworkServer.active && Object.op_Implicit((Object)(object)clone) && (!Object.op_Implicit((Object)(object)body) || !body.healthComponent.alive || !Object.op_Implicit((Object)(object)Run.instance))) { clone.End(dissolve: false); } } private void OnDestroy() { if (NetworkServer.active && Object.op_Implicit((Object)(object)clone)) { clone.End(dissolve: false); } } }