using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EntityStates; using GojoSatoruMod.Components; using GojoSatoruMod.Content; using GojoSatoruMod.States; using GojoSatoruMod.Visuals; using KinematicCharacterController; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RoR2; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [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("AoiTodo")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.1.0")] [assembly: AssemblyInformationalVersion("1.2.1+fd97d1e734adcd9e1245285b6bc69f1c40353929")] [assembly: AssemblyProduct("AoiTodo")] [assembly: AssemblyTitle("AoiTodo")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.1.0")] [module: UnverifiableCode] namespace GojoSatoruMod.Visuals { internal static class TodoExtraSkins { private sealed class Part { internal string Name; internal int Outfit; internal string Texture; internal bool IsCutout; internal Vector3[] Vertices; internal Vector3[] Normals; internal Vector2[] Uvs; internal BoneWeight[] Weights; internal int[] Triangles; } private const string ModelFileName = "todo-skins.model"; private const string TextureDirectoryName = "todo-skins"; private static readonly string[] SkinNames = new string[2] { "OFFDUTY", "JACKETOFF" }; private static readonly (Color Primary, Color Secondary)[] SkinIconColors = new(Color, Color)[3] { (new Color(0.07f, 0.07f, 0.09f), new Color(0.88f, 0.88f, 0.9f)), (new Color(0.43f, 0.59f, 0.42f), new Color(0.18f, 0.23f, 0.27f)), (new Color(0.74f, 0.69f, 0.62f), new Color(0.05f, 0.05f, 0.08f)) }; private static readonly Dictionary textureCache = new Dictionary(); private static string[] boneNames; private static Matrix4x4[] rest; private static List parts; private static readonly HashSet applied = new HashSet(); internal static void RegisterOnPrefab(GameObject bodyPrefab) { try { ModelSkinController val = (Object.op_Implicit((Object)(object)bodyPrefab) ? bodyPrefab.GetComponentInChildren(true) : null); if (!Object.op_Implicit((Object)(object)val)) { return; } if (!File.Exists(JujutsuAssetPaths.Find(new string[2] { "assets", "todo-skins.model" }))) { Plugin.Log.LogInfo((object)"Todo extra skins: todo-skins.model is absent, so only his own outfit is offered."); return; } Transform val2 = (Object.op_Implicit((Object)(object)val.characterModel) ? ((Component)val.characterModel).transform : ((Component)val).transform); GameObject[] array = (GameObject[])(object)new GameObject[SkinNames.Length]; for (int i = 0; i < array.Length; i++) { array[i] = MakeGroup(val2, "TodoOutfit" + SkinNames[i]); array[i].SetActive(false); } GameObject val3 = MakeGroup(val2, "TodoOutfitDEFAULT"); val3.SetActive(true); SkinnedMeshRenderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val4 in componentsInChildren) { if ((Object)(object)((Component)val4).gameObject != (Object)(object)val3 && !IsInside(((Component)val4).transform, array) && !((Component)val4).transform.IsChildOf(val3.transform)) { ((Component)val4).transform.SetParent(val3.transform, true); } } List ownMeshes = new List { val3 }; List list = new List { BuildSkin("DEFAULT", -1, 0, ((Component)val2).gameObject, array, ownMeshes) }; for (int k = 0; k < array.Length; k++) { list.Add(BuildSkin(SkinNames[k], k, k + 1, ((Component)val2).gameObject, array, ownMeshes)); } val.skins = list.ToArray(); Plugin.Log.LogInfo((object)($"Todo extra skins: registered {list.Count} skins on " + ((Object)bodyPrefab).name + ".")); } catch (Exception arg) { Plugin.Log.LogError((object)$"Todo extra skins could not be registered: {arg}"); } } private static GameObject MakeGroup(Transform root, string name) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) Transform val = root.Find(name); object obj = (Object.op_Implicit((Object)(object)val) ? ((object)((Component)val).gameObject) : ((object)new GameObject(name))); ((GameObject)obj).layer = ((Component)root).gameObject.layer; ((GameObject)obj).transform.SetParent(root, false); return (GameObject)obj; } private static bool IsInside(Transform candidate, GameObject[] groups) { foreach (GameObject val in groups) { if (candidate.IsChildOf(val.transform)) { return true; } } return false; } private static SkinDef BuildSkin(string skinName, int shown, int colorIndex, GameObject root, GameObject[] groups, List ownMeshes) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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) SkinDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "skinTodo" + skinName; val.nameToken = "CODEX_TODO_SKIN_" + skinName + "_NAME"; int index = Mathf.Clamp(colorIndex, 0, SkinIconColors.Length - 1); val.icon = GojoAssets.LoadIcon("todo-skin-" + skinName.ToLowerInvariant(), (Func)(() => GojoAssets.CreateSkinIcon("texTodoSkin" + skinName, SkinIconColors[index].Primary, SkinIconColors[index].Secondary))); val.rootObject = root; val.baseSkins = Array.Empty(); val.unlockableDef = null; SkinDefParams val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "skinParamsTodo" + skinName; val2.rendererInfos = Array.Empty(); val2.meshReplacements = Array.Empty(); val2.projectileGhostReplacements = Array.Empty(); val2.minionSkinReplacements = Array.Empty(); List list = new List(); for (int num = 0; num < groups.Length; num++) { list.Add(new GameObjectActivation { gameObject = groups[num], shouldActivate = (num == shown) }); } foreach (GameObject ownMesh in ownMeshes) { list.Add(new GameObjectActivation { gameObject = ownMesh, shouldActivate = (shown < 0) }); } val2.gameObjectActivations = list.ToArray(); val.skinDefParams = val2; val.Bake(); return val; } internal static void Apply(CharacterModel characterModel) { try { if (!Object.op_Implicit((Object)(object)characterModel)) { return; } GameObject[] array = FindGroups(characterModel); if (array == null || !Load() || !applied.Add(((Object)characterModel).GetInstanceID())) { return; } SkinnedMeshRenderer val = FindTemplate(characterModel); if (!Object.op_Implicit((Object)(object)val)) { Plugin.Log.LogWarning((object)"Todo extra skins: the rig has no skinned renderer to take a material from. Skipped."); return; } int found; Transform[] bones = ResolveBones(characterModel, out found); Plugin.Log.LogInfo((object)($"Todo extra skins: {found} of {boneNames.Length} bones " + "found on the live rig by name.")); if (found < boneNames.Length / 2) { Plugin.Log.LogWarning((object)"Todo extra skins: too few bones resolved. Skipped."); return; } MeasureAgainstRig(bones, ((Component)characterModel).transform, out var bindPoses, out var offsets, out var scale); int num = 0; foreach (Part part in parts) { if ((uint)part.Outfit < (uint)array.Length) { BuildRenderer(part, bones, bindPoses, offsets, scale, val, array[part.Outfit].transform); num++; } } Plugin.Log.LogInfo((object)($"Todo extra skins: built {num} outfit renderers on " + ((Object)characterModel).name + ".")); } catch (Exception arg) { Plugin.Log.LogError((object)$"Todo extra skins could not be applied: {arg}"); } } private static SkinnedMeshRenderer FindTemplate(CharacterModel characterModel) { SkinnedMeshRenderer val = null; SkinnedMeshRenderer[] componentsInChildren = ((Component)characterModel).GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2.sharedMesh) && !((Object)(object)((Renderer)val2).sharedMaterial == (Object)null) && ((Object)(object)val == (Object)null || val2.sharedMesh.vertexCount > val.sharedMesh.vertexCount)) { val = val2; } } return val; } private static GameObject[] FindGroups(CharacterModel characterModel) { GameObject[] array = (GameObject[])(object)new GameObject[SkinNames.Length]; for (int i = 0; i < array.Length; i++) { Transform val = ((Component)characterModel).transform.Find("TodoOutfit" + SkinNames[i]); if (!Object.op_Implicit((Object)(object)val)) { return null; } array[i] = ((Component)val).gameObject; } return array; } private static Transform[] ResolveBones(CharacterModel characterModel, out int found) { Dictionary dictionary = new Dictionary(StringComparer.Ordinal); Transform[] componentsInChildren = ((Component)characterModel).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (!dictionary.ContainsKey(((Object)val).name)) { dictionary[((Object)val).name] = val; } } found = 0; Transform[] array = (Transform[])(object)new Transform[boneNames.Length]; for (int j = 0; j < boneNames.Length; j++) { if (dictionary.TryGetValue(boneNames[j], out var value)) { array[j] = value; found++; continue; } foreach (KeyValuePair item in dictionary) { if (item.Key.EndsWith(boneNames[j], StringComparison.Ordinal)) { array[j] = item.Value; found++; break; } } if (!Object.op_Implicit((Object)(object)array[j])) { array[j] = ((Component)characterModel).transform; } } return array; } private static Vector3 ToRigSpace(Vector3 stored) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return new Vector3(stored.x, stored.z, 0f - stored.y); } private static float MeasureScale(Transform[] bones, Matrix4x4 toRoot) { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) int num = Array.IndexOf(boneNames, "mixamorig:Hips"); int num2 = Array.IndexOf(boneNames, "mixamorig:Head"); if (num < 0 || num2 < 0 || !Object.op_Implicit((Object)(object)bones[num]) || !Object.op_Implicit((Object)(object)bones[num2])) { return 1f; } float num3 = Vector3.Distance(((Matrix4x4)(ref toRoot)).MultiplyPoint3x4(bones[num].position), ((Matrix4x4)(ref toRoot)).MultiplyPoint3x4(bones[num2].position)); float num4 = Vector3.Distance(Vector4.op_Implicit(((Matrix4x4)(ref rest[num])).GetColumn(3)), Vector4.op_Implicit(((Matrix4x4)(ref rest[num2])).GetColumn(3))); if (!(num4 > 0.0001f)) { return 1f; } return num3 / num4; } private static void MeasureAgainstRig(Transform[] bones, Transform root, out Matrix4x4[] bindPoses, out Vector3[] offsets, out float scale) { //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_001e: 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_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_003c: 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_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_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_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_0099: Unknown result type (might be due to invalid IL or missing references) bindPoses = (Matrix4x4[])(object)new Matrix4x4[bones.Length]; offsets = (Vector3[])(object)new Vector3[bones.Length]; Matrix4x4 worldToLocalMatrix = root.worldToLocalMatrix; scale = MeasureScale(bones, worldToLocalMatrix); float num = 0f; for (int i = 0; i < bones.Length; i++) { Matrix4x4 val = (Object.op_Implicit((Object)(object)bones[i]) ? (worldToLocalMatrix * bones[i].localToWorldMatrix) : Matrix4x4.identity); bindPoses[i] = ((Matrix4x4)(ref val)).inverse; offsets[i] = Vector4.op_Implicit(((Matrix4x4)(ref val)).GetColumn(3)) - ToRigSpace(Vector4.op_Implicit(((Matrix4x4)(ref rest[i])).GetColumn(3))) * scale; num = Mathf.Max(num, ((Vector3)(ref offsets[i])).magnitude); } Plugin.Log.LogInfo((object)($"Todo extra skins: outfits scaled by {scale:0.000} onto the " + $"rig, worst joint shift {num * 100f:0.0} cm.")); } private static void BuildRenderer(Part part, Transform[] bones, Matrix4x4[] bindPoses, Vector3[] offsets, float scale, SkinnedMeshRenderer template, Transform parent) { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //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_0064: 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_007d: 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_009b: 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_00b9: 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_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_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_01b5: 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_0122: 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_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_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) int num = part.Vertices.Length; Mesh val = new Mesh { name = "meshTodo_" + part.Name, indexFormat = (IndexFormat)(num > 65000) }; Vector3[] array = (Vector3[])(object)new Vector3[num]; Vector3[] array2 = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { BoneWeight val2 = part.Weights[i]; Vector3 val3 = offsets[((BoneWeight)(ref val2)).boneIndex0] * ((BoneWeight)(ref val2)).weight0 + offsets[((BoneWeight)(ref val2)).boneIndex1] * ((BoneWeight)(ref val2)).weight1 + offsets[((BoneWeight)(ref val2)).boneIndex2] * ((BoneWeight)(ref val2)).weight2 + offsets[((BoneWeight)(ref val2)).boneIndex3] * ((BoneWeight)(ref val2)).weight3; float num2 = ((BoneWeight)(ref val2)).weight0 + ((BoneWeight)(ref val2)).weight1 + ((BoneWeight)(ref val2)).weight2 + ((BoneWeight)(ref val2)).weight3; array[i] = ToRigSpace(part.Vertices[i]) * scale + ((num2 > 0.0001f) ? (val3 / num2) : Vector3.zero); array2[i] = ToRigSpace(part.Normals[i]); } val.vertices = array; val.normals = array2; val.uv = part.Uvs; val.boneWeights = part.Weights; val.bindposes = bindPoses; val.triangles = part.Triangles; val.RecalculateBounds(); GameObject val4 = new GameObject(part.Name) { layer = ((Component)parent).gameObject.layer }; val4.transform.SetParent(parent, false); SkinnedMeshRenderer obj = val4.AddComponent(); obj.sharedMesh = val; obj.bones = bones; obj.rootBone = ((bones.Length != 0 && Object.op_Implicit((Object)(object)bones[0])) ? bones[0] : parent); ((Renderer)obj).sharedMaterial = BuildMaterial(template, part); obj.quality = (SkinQuality)4; obj.updateWhenOffscreen = true; } private static Material BuildMaterial(SkinnedMeshRenderer template, Part part) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) Material val = Object.Instantiate(((Renderer)template).sharedMaterial); ((Object)val).name = "matTodoSkin_" + part.Name; Texture2D val2 = LoadTexture(part.Texture); if (val.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)val2); } if (val.HasProperty("_Color")) { val.SetColor("_Color", Color.white); } if (part.IsCutout && val.HasProperty("_EnableCutout")) { val.SetFloat("_EnableCutout", 1f); val.EnableKeyword("CUTOUT"); } return val; } private static Texture2D LoadTexture(string textureName) { if (string.IsNullOrEmpty(textureName)) { return Texture2D.whiteTexture; } if (textureCache.TryGetValue(textureName, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } string text = JujutsuAssetPaths.Find(new string[3] { "assets", "todo-skins", textureName }); bool flag = File.Exists(text); TextureAudit.Record("todo-skins", textureName, flag); if (!flag) { Plugin.Log.LogWarning((object)("Todo skin texture was not found: " + text)); return Texture2D.whiteTexture; } Texture2D val = JujutsuTextures.Load(text, "texTodoSkin_" + Path.GetFileNameWithoutExtension(textureName), (TextureWrapMode)1, false); if (!Object.op_Implicit((Object)(object)val)) { Plugin.Log.LogWarning((object)("Todo skin texture could not be decoded: " + text)); return Texture2D.whiteTexture; } textureCache[textureName] = val; return val; } private static bool Load() { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0111: 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_014c: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0231: 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_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_0265: 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_02d5: Unknown result type (might be due to invalid IL or missing references) if (parts != null) { return parts.Count > 0; } parts = new List(); string path = JujutsuAssetPaths.Find(new string[2] { "assets", "todo-skins.model" }); if (!File.Exists(path)) { Plugin.Log.LogInfo((object)"Todo extra skins: todo-skins.model is absent."); return false; } using FileStream input = File.OpenRead(path); using BinaryReader binaryReader = new BinaryReader(input); if (new string(binaryReader.ReadChars(8)) != "SUKNMDL1") { throw new InvalidDataException("Todo skin model header is invalid."); } int num = binaryReader.ReadInt32(); if (num != 2) { throw new InvalidDataException($"Unsupported Todo skin model version {num}."); } int num2 = binaryReader.ReadInt32(); boneNames = new string[num2]; int[] array = new int[num2]; Matrix4x4[] array2 = (Matrix4x4[])(object)new Matrix4x4[num2]; for (int i = 0; i < num2; i++) { boneNames[i] = binaryReader.ReadString(); array[i] = binaryReader.ReadInt32(); Vector3 val = ReadVector3(binaryReader); Quaternion val2 = ReadQuaternion(binaryReader); Vector3 val3 = ReadVector3(binaryReader); array2[i] = Matrix4x4.TRS(val, val2, val3); } rest = (Matrix4x4[])(object)new Matrix4x4[num2]; for (int j = 0; j < num2; j++) { rest[j] = ((array[j] < 0) ? array2[j] : (rest[array[j]] * array2[j])); } int num3 = binaryReader.ReadInt32(); for (int k = 0; k < num3; k++) { Part part = new Part { Name = binaryReader.ReadString(), Outfit = binaryReader.ReadInt32() }; binaryReader.ReadString(); part.Texture = binaryReader.ReadString(); part.IsCutout = binaryReader.ReadBoolean(); int num4 = binaryReader.ReadInt32(); part.Vertices = (Vector3[])(object)new Vector3[num4]; part.Normals = (Vector3[])(object)new Vector3[num4]; part.Uvs = (Vector2[])(object)new Vector2[num4]; part.Weights = (BoneWeight[])(object)new BoneWeight[num4]; for (int l = 0; l < num4; l++) { part.Vertices[l] = ReadVector3(binaryReader); part.Normals[l] = ReadVector3(binaryReader); part.Uvs[l] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); BoneWeight[] weights = part.Weights; int num5 = l; BoneWeight val4 = default(BoneWeight); ((BoneWeight)(ref val4)).boneIndex0 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex1 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex2 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex3 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).weight0 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight1 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight2 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight3 = binaryReader.ReadSingle(); weights[num5] = val4; } int num6 = binaryReader.ReadInt32(); part.Triangles = new int[num6]; for (int m = 0; m < num6; m++) { part.Triangles[m] = binaryReader.ReadInt32(); } if ((uint)part.Outfit < (uint)SkinNames.Length) { parts.Add(part); } } Plugin.Log.LogInfo((object)($"Todo extra skins: loaded {parts.Count} mesh part(s) over " + $"{num2} bones.")); return parts.Count > 0; } private static Vector3 ReadVector3(BinaryReader reader) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); } private static Quaternion ReadQuaternion(BinaryReader reader) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); } } } namespace GojoSatoruMod.Todo { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency("dev.marmennz.satorugojo", "1.2.1")] [BepInPlugin("dev.marmennz.aoitodo", "Aoi Todo", "1.2.1")] public sealed class TodoPlugin : BaseUnityPlugin { public const string PluginGuid = "dev.marmennz.aoitodo"; public const string PluginVersion = "1.2.1"; public const string PluginName = "Aoi Todo"; private void Awake() { JujutsuStartup.UseHost((MonoBehaviour)(object)this); JujutsuAssetPaths.AddPlugin(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); JujutsuStartup.Step("Todo's text", (Action)TodoLanguage.Register); JujutsuStartup.Step("Todo's assets", (Action)TodoAssets.Initialize); JujutsuStartup.Step("Todo's sounds", (Func)TodoAssets.LoadSounds); JujutsuStartup.Step("Todo's clap networking", (Action)TodoStoneSync.Initialize); JujutsuStartup.Step("Todo's target HUD", (Action)TodoTargetHud.Initialize); JujutsuStartup.Step("Todo's rhythm", (Action)TodoRhythm.Initialize); JujutsuStartup.Survivor("Todo", (Action)TodoSurvivor.Initialize); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Aoi Todo 1.2.1 loaded."); } } internal static class GeneratedVersion { internal const string Value = "1.2.1"; } } namespace GojoSatoruMod.States { public sealed class TodoConsecutiveState : BaseSkillState { private static readonly float[] StepDurations = new float[4] { 0.4f, 0.38f, 0.42f, 0.58f }; private static readonly float[] StepDamage = new float[4] { 2.5f, 2.6f, 2.9f, 4f }; private static readonly float[] StepRadius = new float[4] { 2.9f, 2.9f, 3f, 3.6f }; private static readonly float[] StepContact = new float[4] { 0.5f, 0.42f, 0.44f, 0.52f }; private const int FinisherStep = 3; private float duration; private Vector3 aimDirection; private bool struck; private bool rightHand; private int step; internal static float Coefficient { get { float num = 0f; for (int i = 0; i < StepDamage.Length; i++) { num += StepDamage[i]; } return num; } } internal static int Steps => StepDurations.Length; internal static float RunSeconds { get { float num = 0f; for (int i = 0; i < StepDurations.Length; i++) { num += StepDurations[i]; } return num; } } public override void OnEnter() { //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_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_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_0101: 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_011b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); TodoRhythm component = ((Component)((EntityState)this).characterBody).GetComponent(); step = Mathf.Clamp(Object.op_Implicit((Object)(object)component) ? component.ConsumeComboStep() : 0, 0, StepDurations.Length - 1); duration = StepDurations[step] / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; aimDirection = ((Vector3)(ref direction)).normalized; rightHand = step % 2 == 1; ((EntityState)this).characterBody.SetAimTimer(duration + 0.2f); if (((EntityState)this).isAuthority) { CursedEnergyController component2 = ((Component)((EntityState)this).characterBody).GetComponent(); if (component2 != null) { component2.DrainPriced(2f); } } GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerPunch(rightHand, duration, step, StepContact[step]); } JujutsuSfxAssets.PlayMeleeLight(((EntityState)this).characterBody.corePosition); if (step == 3) { JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.7f); } else { JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.55f); } } public override void FixedUpdate() { //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_005c: 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_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_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_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_01be: 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_01c0: 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_00f7: 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_01f7: 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_01f9: 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_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_0148: 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_015e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.7f); if (!struck && ((EntityState)this).fixedAge >= duration * StepContact[step]) { struck = true; Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = ((EntityState)this).characterBody.transform.forward; } Vector3 val3 = ((EntityState)this).characterBody.corePosition + val2 * 2.3f; if (((EntityState)this).isAuthority) { Prepared val4 = BlackFlash.Roll(1f, ((EntityState)this).characterBody); if (GojoMeleeAttackUtility.Fire(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), val3, StepRadius[step], ((BaseState)this).damageStat * StepDamage[step] * ((Prepared)(ref val4)).Multiplier, val2 * ((step == 3) ? 4600f : 900f) + Vector3.up * ((step == 3) ? 1100f : 120f), ((BaseState)this).RollCrit() || ((Prepared)(ref val4)).Landed, DamageTypeCombo.GenericPrimary) > 0) { if (((Prepared)(ref val4)).Landed) { BlackFlash.Land(val3, "Todo", true); } TodoRhythm.ReportHit(((EntityState)this).characterBody); JujutsuSfxAssets.PlayMeleeHeavy(val3); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee((step == 3) ? 14f : 9f); } } } float num = TodoFx.Reach(((EntityState)this).characterBody, StepRadius[step]); JujutsuImpact.Strike(val3, val2, TodoLanguage.Colour, num, JujutsuFxScale.Weight(StepDamage[step]), false); if (step == 3) { JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.06f, false); JujutsuMotes.Burst(val3, val2, TodoLanguage.Colour, num * 0.7f, (JujutsuMoteKind)0, 12); } GojoStateUtils.StepIntoBlow(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, aimDirection, (step == 3) ? 2.6f : 1.4f); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class TodoOverheadState : BaseSkillState { internal const float Coefficient = 13f; internal const float Radius = 8.5f; internal const float DiveRadius = 9.5f; internal const float FullFall = 18f; internal const float FallBonus = 0.25f; private const float GroundDuration = 0.72f; private const float GroundContact = 0.42f; private const float Hang = 0.16f; private const float DiveSpeed = 42f; private const float MaximumDive = 1.5f; private const float DiveLean = 0.55f; private const float DiveCatch = 2.6f; private const float LandingRecovery = 0.34f; private const int StallTicks = 3; private const float StallFraction = 0.25f; private bool airborne; private float planted; private bool smashed; private float smashedAt; private Vector3 heading; private Vector3 dive; private float startedFalling; private Vector3 lastPoint; private bool gravityHeld; private bool fallsIgnored; private int stalled; private int trailTick; private bool fromWire; private bool entered; public override void OnEnter() { //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_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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00c7: 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) ((BaseState)this).OnEnter(); Vector3 val; if (!fromWire) { Ray aimRay = ((BaseState)this).GetAimRay(); val = Vector3.ProjectOnPlane(((Ray)(ref aimRay)).direction, Vector3.up); heading = ((Vector3)(ref val)).normalized; if (((Vector3)(ref heading)).sqrMagnitude < 0.01f) { heading = ((EntityState)this).characterBody.transform.forward; } airborne = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded; } entered = true; planted = 0.72f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(1.86f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = heading; } JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true); fallsIgnored = true; startedFalling = ((EntityState)this).characterBody.footPosition.y; lastPoint = ((EntityState)this).characterBody.corePosition; val = Vector3.down + heading * 0.55f; dive = ((Vector3)(ref val)).normalized; Announce(); } private void Announce() { //IL_00a9: 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_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) if (airborne) { if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = false; gravityHeld = true; ((EntityState)this).characterMotor.velocity = Vector3.zero; } GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerPunch(true, 1.66f, 4, 0.92f); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.6f); } else { GojoModelAnimator val2 = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val2)) { val2.TriggerPunch(true, planted, 4, 0.42f); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.8f); } } public override void OnSerialize(NetworkWriter writer) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(airborne); writer.Write(heading); } public override void OnDeserialize(NetworkReader reader) { //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_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) //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_0049: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); bool flag = airborne; airborne = reader.ReadBoolean(); heading = reader.ReadVector3(); Vector3 val = Vector3.down + heading * 0.55f; dive = ((Vector3)(ref val)).normalized; fromWire = true; if (entered && airborne != flag) { Announce(); } } public override void FixedUpdate() { //IL_004e: 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) ((EntityState)this).FixedUpdate(); if (airborne) { Dive(); return; } GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.2f); if (!smashed && ((EntityState)this).fixedAge >= planted * 0.42f) { Smash(((EntityState)this).characterBody.footPosition, 8.5f, 1f); GojoStateUtils.StepIntoBlow(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, heading, 1.2f); } if (((EntityState)this).fixedAge >= planted && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Dive() { //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_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_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_0068: 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_00f8: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0169: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01de: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) if (smashed) { if (((EntityState)this).fixedAge >= smashedAt + 0.34f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } if (((EntityState)this).fixedAge < 0.16f) { if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.moveDirection = Vector3.zero; } return; } if (++trailTick % 5 == 0) { JujutsuMotes.Burst(((EntityState)this).characterBody.corePosition, -dive, TodoLanguage.Colour, TodoFx.Reach(((EntityState)this).characterBody, 0.9f), (JujutsuMoteKind)0, 4); } if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } Vector3 corePosition = ((EntityState)this).characterBody.corePosition; ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = dive * 42f; Vector3 val = corePosition - lastPoint; float magnitude = ((Vector3)(ref val)).magnitude; stalled = ((magnitude < 42f * Time.fixedDeltaTime * 0.25f) ? (stalled + 1) : 0); float num = Mathf.Max(0f, startedFalling - ((EntityState)this).characterBody.footPosition.y); bool flag = BlackFlash.AnythingToHit(((BaseState)this).GetTeam(), lastPoint, corePosition, 2.6f); lastPoint = corePosition; if (flag || (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded) || stalled >= 3 || ((EntityState)this).fixedAge >= 1.66f) { Vector3 centre = (flag ? (corePosition - Vector3.up * 0.4f) : ((EntityState)this).characterBody.footPosition); float num2 = Mathf.Clamp01(num / 18f); Smash(centre, 9.5f * (1f + num2 * 0.25f * 0.8f), 1f + num2 * 0.25f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.useGravity = true; gravityHeld = false; } } } private void Smash(Vector3 centre, float radius, float scale) { //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_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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_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_0075: 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_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_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_008b: 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) smashed = true; smashedAt = ((EntityState)this).fixedAge; if (((EntityState)this).isAuthority) { Prepared val = BlackFlash.Roll(1f, ((EntityState)this).characterBody); if (GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), centre, radius, ((BaseState)this).damageStat * 13f * scale * ((Prepared)(ref val)).Multiplier, 2800f, 1400f, ((BaseState)this).RollCrit() || ((Prepared)(ref val)).Landed, DamageTypeCombo.GenericSecondary) > 0) { if (((Prepared)(ref val)).Landed) { BlackFlash.Land(centre, "Todo", true); } TodoRhythm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(12f); } } } if (airborne) { GojoModelAnimator val2 = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val2)) { val2.TriggerPunch(true, 0.34f, 4, 0.18f); } } float num = TodoFx.Reach(((EntityState)this).characterBody, radius); float num2 = JujutsuFxScale.Weight(13f); JujutsuImpact.Detonate(centre, TodoLanguage.Colour, num, num2, false); TodoFx.GroundWave(((EntityState)this).characterBody.footPosition, TodoLanguage.Colour, num, 0.6f); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, airborne ? 0.09f : 0.08f, false); JujutsuSfxAssets.PlayMeleeHeavy(centre); JujutsuFxScorch.Mark(((EntityState)this).characterBody.footPosition, TodoLanguage.Colour, num * 0.78f, 9f, true); JujutsuMotes.Burst(((EntityState)this).characterBody.footPosition, Vector3.up, TodoLanguage.Colour, num * 0.5f, (JujutsuMoteKind)1, airborne ? 22 : 14); if (NetworkServer.active) { JujutsuImpact.Surface(((EntityState)this).characterBody.footPosition, Vector3.up, num, true); } } public override void OnExit() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (gravityHeld && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.useGravity = true; } gravityHeld = false; if (fallsIgnored) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false); fallsIgnored = false; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class TodoPlusUltraState : BaseSkillState, IPosedState { internal const float Coefficient = 13f; internal const float KickRadius = 4.4f; private const float KickForward = 2.4f; internal const float MinimumDistance = 7f; internal const float MaximumDistance = 26f; private const float Speed = 52f; private const float SweepReach = 3.4f; private const float KickDuration = 0.46f; private const float KickContact = 0.34f; internal const float ZoneDistanceBonus = 0.35f; internal const float ZoneDamageBonus = 0.25f; internal const float ZoneRadiusBonus = 0.2f; private const int StallTicks = 3; private const float StallFraction = 0.25f; private Vector3 heading; private bool zone; private float reachLimit; private float travelled; private Vector3 lastPoint; private bool dashing = true; private bool kicked; private float kickedAt; private bool gravityHeld; private bool fallsIgnored; private int stalled; private int trailTick; bool IPosedState.DrivesPose => dashing; GojoCpuPose IPosedState.Pose => (GojoCpuPose)24; float IPosedState.PosePhase => Mathf.Clamp01(((EntityState)this).fixedAge / Mathf.Max(0.01f, reachLimit / 52f)); float IPosedState.PoseBob => 0.1f; float IPosedState.PosePitch => -12f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 35; public override void OnEnter() { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0027: 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_00d4: 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_017c: 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_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) ((BaseState)this).OnEnter(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = Vector3.ProjectOnPlane(((Ray)(ref aimRay)).direction, Vector3.up); heading = ((Vector3)(ref val)).normalized; if (((Vector3)(ref heading)).sqrMagnitude < 0.01f) { heading = ((EntityState)this).characterBody.transform.forward; } TodoRhythm component = ((Component)((EntityState)this).characterBody).GetComponent(); zone = Object.op_Implicit((Object)(object)component) && component.Stacks >= 6; reachLimit = 26f * (zone ? 1.35f : 1f); ((EntityState)this).characterBody.SetAimTimer(reachLimit / 52f + 0.46f + 0.2f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = heading; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = false; gravityHeld = true; KinematicCharacterMotor motor = ((BaseCharacterController)((EntityState)this).characterMotor).Motor; if (motor != null) { motor.ForceUnground(0.1f); } ((EntityState)this).characterMotor.velocity = heading * 52f; } JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true); fallsIgnored = true; lastPoint = ((EntityState)this).characterBody.corePosition; GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.ClearAttackPose(); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.85f); TodoFx.Gather(((EntityState)this).characterBody, 1.2f, 0.2f, 7f / 52f, TodoFx.Reach(((EntityState)this).characterBody, 1.7600001f)); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (dashing) { Travel(); return; } GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.15f); if (!kicked && ((EntityState)this).fixedAge >= kickedAt + 0.15640001f) { Kick(); } if (((EntityState)this).fixedAge >= kickedAt + 0.46f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Travel() { //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_006e: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_0101: 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) if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = heading * 52f; } if (++trailTick % 4 == 0) { JujutsuMotes.Burst(((EntityState)this).characterBody.footPosition, -heading, TodoLanguage.Colour, TodoFx.Reach(((EntityState)this).characterBody, 1.1f), (JujutsuMoteKind)1, 3); } if (!((EntityState)this).isAuthority) { return; } Vector3 corePosition = ((EntityState)this).characterBody.corePosition; Vector3 val = corePosition - lastPoint; float magnitude = ((Vector3)(ref val)).magnitude; bool flag = BlackFlash.AnythingToHit(((BaseState)this).GetTeam(), lastPoint, corePosition, 3.4f); travelled += magnitude; stalled = ((magnitude < 52f * Time.fixedDeltaTime * 0.25f) ? (stalled + 1) : 0); lastPoint = corePosition; if (stalled >= 3) { Stop(); } else if (!(travelled < 7f) || flag) { bool flag2 = Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.skill4.down; if (flag || travelled >= reachLimit || !flag2) { Stop(); } } } private void Stop() { //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_0078: Unknown result type (might be due to invalid IL or missing references) dashing = false; kickedAt = ((EntityState)this).fixedAge; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = heading * 10.400001f; ((EntityState)this).characterMotor.useGravity = true; gravityHeld = false; } GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerSpinKick(0.46f, 0.34f); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.9f); } private Vector3 ImpactPoint() { //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_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) return ((EntityState)this).characterBody.corePosition + heading * 2.4f; } private void Kick() { //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_0036: 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_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_0061: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0102: Unknown result type (might be due to invalid IL or missing references) kicked = true; Vector3 val = ImpactPoint(); float num = 4.4f * (zone ? 1.2f : 1f); float num2 = TodoFx.Reach(((EntityState)this).characterBody, num); JujutsuImpact.Strike(val, heading, TodoLanguage.Colour, num2, JujutsuFxScale.Weight(13f), true); GojoTechniqueVisuals.CreateBurst(val, TodoLanguage.Colour, num2, 0.32f, (GojoTechniqueStyle)5, heading); JujutsuSfxAssets.PlayMeleeHeavy(val); if (!((EntityState)this).isAuthority) { return; } float num3 = Mathf.Max(1f, JujutsuConfig.BlackFlashMultiplier.Value); float num4 = ((BaseState)this).damageStat * 13f * num3 * (zone ? 1.25f : 1f); int num5 = GojoMeleeAttackUtility.Fire(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), val, num, num4, heading * 4600f + Vector3.up * 1400f, true, DamageTypeCombo.GenericSpecial); if (num5 > 0) { BlackFlash.Land(val, "Todo", true); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.07f, false); TodoRhythm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(12f); } JujutsuCharacters.ForBody(((EntityState)this).characterBody)?.RewardFlash?.Invoke(((EntityState)this).characterBody, num5); } } public override void OnExit() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (gravityHeld && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = heading * 10.400001f; ((EntityState)this).characterMotor.useGravity = true; } gravityHeld = false; if (fallsIgnored) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false); fallsIgnored = false; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class TodoThrowStoneState : BaseSkillState { private const float Duration = 0.45f; private const float MaximumHold = 2.5f; private TodoThrowPreview preview; private JujutsuAimWheel wheel; private TodoBoogieWoogie boogie; private bool released; private float releasedAt; private bool thrown; private float Reach { get { if (!Object.op_Implicit((Object)(object)boogie)) { return 70f; } return boogie.ThrowReach; } } public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(0.65f); boogie = ((Component)((EntityState)this).characterBody).GetComponent(); if (((EntityState)this).isAuthority) { preview = TodoThrowPreview.Attach(((EntityState)this).characterBody); wheel = JujutsuAimWheel.Attach(((Component)((EntityState)this).characterBody).gameObject); JujutsuAimWheel obj = wheel; if (obj != null) { obj.Begin(); } } } public override void FixedUpdate() { //IL_0050: 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) ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority) { return; } if (!released) { Aim(); return; } float num = ((EntityState)this).fixedAge - releasedAt; if (!thrown && num >= 0.17999999f) { thrown = true; boogie?.PlaceStone(TodoBoogieWoogie.ThrowDestination(((BaseState)this).GetAimRay(), Reach)); } if (num >= 0.45f) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Aim() { //IL_0065: 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) ((EntityState)this).characterBody.SetAimTimer(0.3f); float num = (Object.op_Implicit((Object)(object)wheel) ? wheel.Consume() : 0f); if (num != 0f && Object.op_Implicit((Object)(object)boogie)) { boogie.AimThrow(num); } preview?.Aim(((EntityState)this).characterBody, ((BaseState)this).GetAimRay(), Reach); if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || !((EntityState)this).inputBank.skill3.down || !(((EntityState)this).fixedAge < 2.5f)) { released = true; releasedAt = ((EntityState)this).fixedAge; preview?.Hide(); JujutsuSfxAssets.PlayMeleeLight(((EntityState)this).characterBody.corePosition); Let(); } } private void Let() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 val = TodoBoogieWoogie.ThrowOrigin(((EntityState)this).characterBody); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Vector3 normalized = ((Vector3)(ref direction)).normalized; float num = TodoFx.Reach(((EntityState)this).characterBody, 1.1f); JujutsuImpact.Strike(val, normalized, TodoLanguage.Colour, num, 0.12f, true); JujutsuMotes.Burst(val, normalized, TodoLanguage.Colour, num, (JujutsuMoteKind)0, 8); } public override void OnExit() { preview?.Hide(); JujutsuAimWheel obj = wheel; if (obj != null) { obj.End(); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class TodoCycleTargetState : BaseSkillState { public override void OnEnter() { ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { Choose(); } ((EntityState)this).outer.SetNextStateToMain(); } private void Choose() { //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_003c: 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) TodoBoogieWoogie component = ((Component)((EntityState)this).characterBody).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { TodoBoogieWoogie.ClapTarget mark = component.Mark; Vector3 foot = component.PositionOf(mark); component.MarkAimed(); TodoBoogieWoogie.ClapTarget mark2 = component.Mark; if (mark2.Exists) { TodoFx.Seal(component.PositionOf(mark2), set: true); } else if (mark.Exists) { TodoFx.Seal(foot, set: false); } } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } } public sealed class TodoSwapState : BaseSkillState { private const float Duration = 0.3f; public override void OnEnter() { //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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); TodoBoogieWoogie component = ((Component)((EntityState)this).characterBody).GetComponent(); TodoFx.SealAt(((EntityState)this).characterBody.corePosition + ((EntityState)this).characterBody.transform.forward * 0.55f, set: true); if (Object.op_Implicit((Object)(object)component) && ((EntityState)this).isAuthority && component.Swap()) { TodoAssets.PlayClap(((EntityState)this).characterBody.corePosition); } else if (((EntityState)this).isAuthority) { Plugin.Log.LogInfo((object)("Boogie Woogie refused: " + Excuse(component))); } } private static string Excuse(TodoBoogieWoogie boogie) { if (!Object.op_Implicit((Object)(object)boogie)) { return "the technique is not on this body at all."; } return boogie.LastRefusal switch { TodoBoogieWoogie.ClapRefusal.NothingChosen => "nothing was marked and nothing was under the crosshair.", TodoBoogieWoogie.ClapRefusal.NoStone => "the far end fell back to the stone and there is no stone out.", TodoBoogieWoogie.ClapRefusal.NotAffordable => "not enough cursed energy for that pairing; nothing was spent.", TodoBoogieWoogie.ClapRefusal.NoRoom => "one of the two ends had nowhere to stand, so neither travelled and nothing was spent.", _ => "no reason was recorded, which is itself a fault.", }; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.3f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace GojoSatoruMod.Content { internal static class TodoAssets { private enum Shape { Blow, Slam, Stone, Cycle, Swap, Ultra, StancePair, StanceCrowd } private const int Size = 128; private static readonly Color Backing = new Color(0.06f, 0.04f, 0.1f, 1f); private static readonly Color Ink = new Color(0.72f, 0.55f, 0.94f, 1f); private static DecodedAttackSound clap; private static DecodedAttackSound[] voiceLines; private static DecodedAttackSound bestFriend; private static float nextVoiceAllowedTime = -1000f; private const float VoiceInterval = 12f; internal static Sprite BlowIcon { get; private set; } internal static Sprite SlamIcon { get; private set; } internal static Sprite StoneIcon { get; private set; } internal static Sprite CycleIcon { get; private set; } internal static Sprite SwapIcon { get; private set; } internal static Sprite UltraIcon { get; private set; } internal static Sprite StancePairIcon { get; private set; } internal static Sprite StanceCrowdIcon { get; private set; } private static float ClapVolume => GameVolume.VoiceLevel; internal static DecodedAttackSound SpawnVoice { get; private set; } internal static IEnumerator LoadSounds() { clap = GojoAssets.LoadSound("todo-boogie-woogie.mp3", 1f, "Todo", 0f); yield return null; SpawnVoice = GojoAssets.LoadSound("todo-spawn.mp3", 1f, "Todo", 0f); yield return null; bestFriend = GojoAssets.LoadSound("besto-friendo.mp3", 1f, "Todo", 0f); yield return null; string[] chatter = new string[9] { "todo-voice1.mp3", "todo-voice2.mp3", "todo-voice3.mp3", "todo-voice4.mp3", "todo-voice5.mp3", "todo-voice6.mp3", "todo-voice7.mp3", "todo-voice8.mp3", "todo-voice9.mp3" }; DecodedAttackSound[] lines = (DecodedAttackSound[])(object)new DecodedAttackSound[chatter.Length]; for (int index = 0; index < chatter.Length; index++) { lines[index] = GojoAssets.LoadSound(chatter[index], 1f, "Todo", 0f); yield return null; } voiceLines = lines; } internal static void TryPlayVoice(Vector3 position, float chance) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (voiceLines != null && voiceLines.Length != 0 && !(Time.realtimeSinceStartup < nextVoiceAllowedTime) && !(Random.value > Mathf.Clamp01(chance))) { DecodedAttackSound val = GojoAssets.PickVoice(voiceLines); if (val != null) { GojoAssets.PlayAttackSound(val, position, 1f, 0f, "Todo", true, false); nextVoiceAllowedTime = Time.realtimeSinceStartup + 12f; } } } internal static void PlayBestFriend(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) GojoAssets.PlayAttackSound(bestFriend, position, 1f, 0f, "Todo", true, false); } internal static void PlayClap(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) GojoAssets.PlayAttackSound(clap, position, ClapVolume, 0.08f, "Todo", false, false); } internal static void Initialize() { BlowIcon = GojoAssets.LoadIcon("todo-blow", (Func)(() => Draw("texTodoBlow", Shape.Blow))); SlamIcon = GojoAssets.LoadIcon("todo-slam", (Func)(() => Draw("texTodoSlam", Shape.Slam))); StoneIcon = GojoAssets.LoadIcon("todo-stone", (Func)(() => Draw("texTodoStone", Shape.Stone))); CycleIcon = GojoAssets.LoadIcon("todo-cycle", (Func)(() => Draw("texTodoCycle", Shape.Cycle))); SwapIcon = GojoAssets.LoadIcon("todo-swap", (Func)(() => Draw("texTodoSwap", Shape.Swap))); UltraIcon = GojoAssets.LoadIcon("todo-ultra", (Func)(() => Draw("texTodoUltra", Shape.Ultra))); StancePairIcon = GojoAssets.LoadIcon("todo-stance-pair", (Func)(() => Draw("texTodoStancePair", Shape.StancePair))); StanceCrowdIcon = GojoAssets.LoadIcon("todo-stance-crowd", (Func)(() => Draw("texTodoStanceCrowd", Shape.StanceCrowd))); } private static Sprite Draw(string name, Shape shape) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00be: 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_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) Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); ((Object)val).name = name; ((Texture)val).wrapMode = (TextureWrapMode)1; Color[] array = (Color[])(object)new Color[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float u = ((float)j + 0.5f) / 128f * 2f - 1f; float v = ((float)i + 0.5f) / 128f * 2f - 1f; array[i * 128 + j] = Sample(shape, u, v); } } val.SetPixels(array); val.Apply(); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 100f); ((Object)obj).name = "sprite" + name; GojoAssets.PreparePersistentSprite(obj); return obj; } private static Color Sample(Shape shape, float u, float v) { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_044e: 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_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_01a7: 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_0222: 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_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_0227: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: 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_0285: 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_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Max(Mathf.Abs(u), Mathf.Abs(v)) > 0.94f) { return Color.clear; } Color result = Backing; switch (shape) { case Shape.Blow: { float num3 = 0.1f + 0.26f * (u + 0.7f); if (u > -0.7f && u < 0.62f && Mathf.Abs(v - (u * 0.55f - 0.05f)) < num3 * 0.5f) { result = Ink; } break; } case Shape.Slam: { float num7 = Mathf.Sqrt(u * u + (v + 0.3f) * (v + 0.3f)); if (num7 < 0.17f) { result = Ink; } else if (Mathf.Abs(num7 - 0.4f) < 0.07f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.8f); } else if (Mathf.Abs(num7 - 0.66f) < 0.05f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.5f); } break; } case Shape.Stone: if (Mathf.Sqrt(u * u + (v + 0.42f) * (v + 0.42f)) < 0.2f) { result = Ink; } else if (Mathf.Abs(u) < 0.05f && v > -0.16f && v < 0.62f) { result = Ink; } break; case Shape.Cycle: { for (int j = 0; j < 4; j++) { float num4 = MathF.PI / 2f * (float)j + MathF.PI / 4f; float num5 = u - Mathf.Cos(num4) * 0.52f; float num6 = v - Mathf.Sin(num4) * 0.52f; if (num5 * num5 + num6 * num6 < 0.028f) { result = (Color)((j == 0) ? Ink : new Color(Ink.r, Ink.g, Ink.b, 0.55f)); } } break; } case Shape.Swap: if (v > 0.1f && v < 0.36f && u > -0.62f && u < 0.34f) { result = Ink; } else if (v < -0.1f && v > -0.36f && u < 0.62f && u > -0.34f) { result = Ink; } else if (u > 0.34f && u < 0.62f && Mathf.Abs(v - 0.23f) < 0.62f - u + 0.34f) { result = Ink; } else if (u < -0.34f && u > -0.62f && Mathf.Abs(v + 0.23f) < u + 0.62f + 0.34f) { result = Ink; } break; case Shape.Ultra: { for (int i = 0; i < 3; i++) { float num = -0.3f + (float)i * 0.3f; float num2 = -0.8f + (float)Mathf.Abs(i - 1) * 0.2f; if (u > num2 && u < 0.02f && Mathf.Abs(v - num * 0.55f) < 0.062f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, (i == 1) ? 1f : 0.6f); } } if (u > 0.06f && u < 0.52f && Mathf.Abs(v - (u * 0.3f - 0.06f)) < 0.2f) { result = Ink; } else if (u > 0.44f && u < 0.78f && v > -0.1f && v < 0.4f && Mathf.Abs(u - 0.56f) + Mathf.Abs(v - 0.14f) < 0.34f) { result = Ink; } break; } case Shape.StancePair: case Shape.StanceCrowd: if (Dot(u, v, -0.58f, 0f) || Dot(u, v, 0.58f, 0f)) { result = Ink; } else if (shape != Shape.StancePair && (Dot(u, v, -0.3f, 0.34f) || Dot(u, v, -0.3f, -0.34f) || Dot(u, v, 0.3f, 0.34f) || Dot(u, v, 0.3f, -0.34f))) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.62f); } break; } return result; } private static bool Dot(float u, float v, float cx, float cy) { float num = u - cx; float num2 = v - cy; return num * num + num2 * num2 < 0.032f; } } internal static class TodoLanguage { internal const string Prefix = "CODEX_TODO_"; internal static readonly Color Colour = new Color(0.55f, 0.36f, 0.72f, 1f); private static float FlashMultiplier { get { if (JujutsuConfig.BlackFlashMultiplier == null) { return 2.5f; } return Mathf.Max(1f, JujutsuConfig.BlackFlashMultiplier.Value); } } internal static void Register() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) LanguageAPI.Add("CODEX_TODO_NAME", "Aoi Todo"); LanguageAPI.Add("CODEX_TODO_SUBTITLE", "The Best Friend"); LanguageAPI.Add("CODEX_TODO_DESCRIPTION", "Todo is heavier and better armoured than the rest, and he moves by trading places rather than by running. Throw a stone to make somewhere to be, mark what you want moved, and clap it to whatever you are looking at — yourself, a teammate, or whatever is trying to kill you."); LanguageAPI.Add("CODEX_TODO_SKIN_DEFAULT_NAME", "Jujutsu High"); LanguageAPI.Add("CODEX_TODO_SKIN_OFFDUTY_NAME", "Off Duty"); LanguageAPI.Add("CODEX_TODO_SKIN_JACKETOFF_NAME", "Jacket Off"); LanguageAPI.Add("CODEX_TODO_STANCE_NAME", "Pair / Crowd"); LanguageAPI.Add("CODEX_TODO_STANCE_DESCRIPTION", StatText.Utility(JujutsuInput.Describe(JujutsuConfig.StanceKey.Value)) + " changes which reading of the technique the clap uses. " + StatText.Utility("Pair") + " is the clap as described above: two things trade places. " + StatText.Damage("Crowd") + " trades the two places instead — every enemy the arrival's blow catches changes ends with it, up to six at each end, keeping the ground it stood on. So in this stance you cannot clap out of a pile; you take the pile with you, which is the set-up the Overhead Smash wants. Only on the claps that land a blow."); LanguageAPI.Add("CODEX_TODO_PASSIVE_NAME", "Impact"); LanguageAPI.Add("CODEX_TODO_PASSIVE_DESCRIPTION", "Every clap " + StatText.Damage("lands") + ". Both ends of a swap take " + StatText.Damage(StatText.Percent(4f) + " damage") + " in " + StatText.Utility(StatText.Metres(6f)) + " and are thrown outward — where you left and where you arrived. The clap has no cooldown, so the blow does: " + StatText.Utility("once every " + StatText.Number(1.2f) + " seconds") + ".\n\nAnd he fights to a beat. Every blow that lands adds to it, up to " + StatText.Utility(StatText.Number(6f)) + ", each worth " + StatText.Utility(StatText.Fraction(0.12f) + " attack speed") + " and " + StatText.Healing(StatText.Number(8f) + " armor") + ". From " + StatText.Utility(StatText.Number(3f)) + " up, landing one also " + StatText.Healing("heals " + StatText.Fraction(0.015f) + " of your maximum health") + ". Land nothing and it slips a step every " + StatText.Number(1.4f) + " seconds — but " + StatText.Utility("a clap fills it outright") + ", so arriving is how the beat starts.\n\nAnd he " + StatText.Utility("never takes fall damage") + " — from any height, however he got there.\n\n" + StatText.EnergyRule()); LanguageAPI.Add("CODEX_TODO_PRIMARY_NAME", "Consecutive Blows"); LanguageAPI.Add("CODEX_TODO_PRIMARY_DESCRIPTION", StatText.Utility(StatText.Number((float)TodoConsecutiveState.Steps) + " blows") + " thrown one after another for " + StatText.Damage(StatText.Percent(TodoConsecutiveState.Coefficient) + " damage") + " in all. The first three barely move what they hit — the fourth is a hook that throws it. Stop swinging for " + StatText.Number(1.2f) + " seconds and the run starts again from the first.\n\nEach blow spends " + StatText.Utility(StatText.Number(2f) + " cursed energy") + " and pays back " + StatText.Healing(StatText.Number(9f) + " where it lands") + " — " + StatText.Healing(StatText.Number(14f)) + " on the hook. It never refuses for want of energy: " + StatText.Utility("punching is how the bar fills") + ", and only a run swung at nothing is down on the deal."); LanguageAPI.Add("CODEX_TODO_SECONDARY_NAME", "Overhead Smash"); LanguageAPI.Add("CODEX_TODO_SECONDARY_DESCRIPTION", "Both fists into the ground for " + StatText.Damage(StatText.Percent(13f) + " damage") + " to everything within " + StatText.Metres(8.5f) + " and throws it outward. Centred on him, not aimed — clap into a crowd, then smash.\n\n" + StatText.Utility("Used in the air") + " he hangs for a moment and then comes down the way he is facing instead, landing for the same damage across " + StatText.Metres(9.5f) + " — and the further he fell, up to " + StatText.Metres(18f) + ", the harder it lands, to " + StatText.Damage("+" + StatText.Fraction(0.25f)) + ". Anything he catches on the way down stops him there. " + StatText.Seconds(4f) + " second cooldown, and " + StatText.Utility(StatText.Number(14f) + " cursed energy") + " — of which " + StatText.Healing(StatText.Number(12f) + " comes straight back") + " if it hits anything."); LanguageAPI.Add("CODEX_TODO_UTILITY_NAME", "Boogie Woogie: Stone"); LanguageAPI.Add("CODEX_TODO_UTILITY_DESCRIPTION", StatText.Utility("Hold to aim") + " — the arc it will take is drawn for you, and the " + StatText.Utility("mouse wheel throws it harder or softer") + ", from " + StatText.Metres(15f) + " out to " + StatText.Metres(140f) + " — and release to throw. It becomes a " + StatText.Utility("destination you can clap to") + ", and clapping leaves the stone where you were — so the same throw takes you there and back. " + StatText.Utility(StatText.Number(2f) + " stones") + ", one back every " + StatText.Seconds(5f) + " seconds."); LanguageAPI.Add("CODEX_TODO_CYCLE_NAME", "Mark"); LanguageAPI.Add("CODEX_TODO_CYCLE_DESCRIPTION", "Mark whatever you are aiming at — " + StatText.Utility("a teammate, an enemy, or the stone") + ", out to " + StatText.Metres(140f) + ". Aim at nothing to clear it. Costs nothing and takes no time."); LanguageAPI.Add("CODEX_TODO_SWAP_NAME", "Boogie Woogie"); LanguageAPI.Add("CODEX_TODO_SWAP_DESCRIPTION", "Clap, and two things " + StatText.Utility("trade places") + ". " + StatText.Utility("No cooldown") + " — what it spends is " + StatText.Utility("cursed energy") + ", and how much depends on what you ask it to move: " + StatText.Utility(StatText.Number(4f) + " to your own stone") + ", " + StatText.Utility(StatText.Number(9f) + " with an enemy") + ", " + StatText.Utility(StatText.Number(20f) + " with an ally") + ", and " + StatText.Utility(StatText.Number(32f) + " for two things that are not you") + ".\n\nThe " + StatText.Utility("marked") + " thing trades with whatever you are " + StatText.Utility("aiming at") + ". With nothing marked, you are one end. With nothing under your crosshair, the other end is the stone.\n\nSo: aim and clap to go somewhere. Mark an ally and aim at the stone to pull them out. Mark an enemy and aim at another to rearrange the fight.\n\n" + StatText.Utility("Crowd stance:") + " the clap trades the two " + StatText.Utility("places") + " instead of the two things in them. Every enemy the arrival's blow catches — up to " + StatText.Utility(StatText.Number(6f) + " at each end, within " + StatText.Metres(6f)) + " — changes ends with it, keeping the ground they stood on. Only on the claps that land a blow, so at most " + StatText.Utility("once every " + StatText.Number(1.2f) + " seconds") + ". You cannot step out of a fight in this stance: whatever is on you comes too." + StatText.Sub("\n\n< ! > A clap that moves anybody but Todo is handed to the host and run there, so it works from a joined game as well as from one you are hosting.")); LanguageAPI.Add("CODEX_TODO_SPECIAL_NAME", "Plus Ultra"); LanguageAPI.Add("CODEX_TODO_SPECIAL_DESCRIPTION", "Dash at whatever you are looking at and kick it. That kick is " + StatText.Damage("always a Black Flash") + ": " + StatText.Damage(StatText.Percent(13f * FlashMultiplier) + " damage") + " across " + StatText.Metres(4.4f) + ", every time.\n\n" + StatText.Utility("Hold to dash further") + " — from " + StatText.Metres(7f) + " on a tap out to " + StatText.Metres(26f) + ". The dash stops at the first thing it reaches, so a hold aimed across a room is a closer as much as a finisher.\n\nAt a " + StatText.Utility("full beat") + " it goes " + StatText.Utility(StatText.Fraction(0.35f) + " further") + ", lands " + StatText.Utility(StatText.Fraction(0.2f) + " wider") + " and hits for " + StatText.Damage("+" + StatText.Fraction(0.25f)) + " — and a clap fills the beat outright. " + StatText.Seconds(9f) + " second cooldown, and " + StatText.Utility(StatText.Number(30f) + " cursed energy") + " — very nearly what a clap between two other things costs, so a bar buys the kick or the rearrangement and not both."); LanguageAPI.Add("CODEX_TODO_OUTRO_FLAVOR", "..and so he left, asking everyone he met what their type was."); LanguageAPI.Add("CODEX_TODO_OUTRO_FAILURE", "..and so he vanished, with nobody left to call his brother."); LogResolvedNumbers(); } private static void LogResolvedNumbers() { Plugin.Log.LogInfo((object)"Todo skill text assembled from live values:"); Plugin.Log.LogInfo((object)(" passive : clap " + StatText.Percent(4f) + " across " + StatText.Metres(6f) + ", once every " + StatText.Number(1.2f) + "s")); Plugin.Log.LogInfo((object)($" stance : crowd carries up to {6}" + " enemies an end, from the same " + StatText.Metres(6f) + " the blow uses")); Plugin.Log.LogInfo((object)($" rhythm : up to {6} stacks" + ", +" + StatText.Fraction(0.12f) + " attack speed and +" + StatText.Number(8f) + " armour each" + $", heals {StatText.Fraction(0.015f)} from stack {3}" + ", slips one every " + StatText.Number(1.4f) + "s")); Plugin.Log.LogInfo((object)($" blows : {TodoConsecutiveState.Steps} steps" + ", " + StatText.Percent(TodoConsecutiveState.Coefficient) + " in all over " + StatText.Number(TodoConsecutiveState.RunSeconds) + "s, resets after " + StatText.Number(1.2f) + "s")); Plugin.Log.LogInfo((object)(" blow fee: " + StatText.Number(2f) + " a swing (" + StatText.Number(2f * (float)TodoConsecutiveState.Steps) + " a run, drained not gated), pays " + StatText.Number(9f) + " a hit and " + StatText.Number(14f) + " on the hook = " + StatText.Number(9f * (float)(TodoConsecutiveState.Steps - 1) + 14f - 2f * (float)TodoConsecutiveState.Steps) + " net on a run that all lands")); Plugin.Log.LogInfo((object)(" overhead: " + StatText.Percent(13f) + " across " + StatText.Metres(8.5f) + " planted, " + StatText.Metres(9.5f) + " diving (+" + StatText.Fraction(0.25f) + " at " + StatText.Metres(18f) + " of fall), cooldown " + StatText.Seconds(4f) + "s, energy " + StatText.Number(14f) + " less " + StatText.Number(12f) + " back on a hit")); Plugin.Log.LogInfo((object)(" stone : " + StatText.Number(2f) + " charges, " + StatText.Seconds(5f) + "s each, mark range " + StatText.Metres(140f))); Plugin.Log.LogInfo((object)(" ultra : " + StatText.Percent(13f) + $" x{FlashMultiplier:0.##} guaranteed flash" + " = " + StatText.Percent(13f * FlashMultiplier) + ", dash " + StatText.Metres(7f) + "-" + StatText.Metres(26f) + ", cooldown " + StatText.Seconds(9f) + "s, energy " + StatText.Number(30f) + " against a remote clap's " + StatText.Number(32f))); } } internal static class TodoSurvivor { internal static class Costs { internal const float ConsecutiveCooldown = 0f; internal const float ConsecutiveEnergy = 2f; internal const float OverheadCooldown = 4f; internal const float OverheadEnergy = 14f; internal const float ThrowStoneCooldown = 5f; internal const int StoneCharges = 2; internal const float PlusUltraCooldown = 9f; internal const float PlusUltraEnergy = 30f; internal const float CycleCooldown = 0f; internal const float SwapCooldown = 0f; } internal static SurvivorDef SurvivorDef { get; private set; } internal static void Initialize() { //IL_0019: 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_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_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_00b8: 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_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //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_00f7: 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_0112: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //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_014e: 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_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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01bc: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_01f4: 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_0204: 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_021f: 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_0235: 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_0241: Expected O, but got Unknown //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_0257: 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_0272: 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_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_0294: Expected O, but got Unknown //IL_02c5: Expected O, but got Unknown //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Expected O, but got Unknown SurvivorDef = JujutsuNewcomers.Build("AoiTodoBody", "AoiTodoMonsterMaster", "AoiTodoDisplay", "AoiTodo", "CODEX_TODO_", TodoLanguage.Colour, 93f, new MixamoCharacterModel("Todo", "todo.model", "todo", (JujutsuConfig.TodoModelScale != null) ? JujutsuConfig.TodoModelScale.Value : 1.1f, (JujutsuConfig.TodoFightAnimation == null || JujutsuConfig.TodoFightAnimation.Value) ? "todo.anim" : "todo-classic.anim"), 175f, 15f, 20f, 6.9f, new Dictionary { ["Primary"] = new SkillSlot { Name = "TodoConsecutive", TokenSuffix = "PRIMARY", State = typeof(TodoConsecutiveState), Icon = TodoAssets.BlowIcon, Cooldown = 0f, MustKeyPress = false, Priority = (InterruptPriority)0 }, ["Secondary"] = new SkillSlot { Name = "TodoOverhead", TokenSuffix = "SECONDARY", State = typeof(TodoOverheadState), Icon = TodoAssets.SlamIcon, Cooldown = 4f, EnergyCost = 14f }, ["Utility"] = new SkillSlot { Name = "TodoThrowStone", TokenSuffix = "UTILITY", State = typeof(TodoThrowStoneState), Icon = TodoAssets.StoneIcon, Cooldown = 5f, MaxStock = 2 }, ["Special"] = new SkillSlot { Name = "TodoPlusUltra", TokenSuffix = "SPECIAL", State = typeof(TodoPlusUltraState), Icon = TodoAssets.UltraIcon, Cooldown = 9f, EnergyCost = 30f, Priority = (InterruptPriority)2 } }, new Dictionary { ["SideCycleTarget"] = new SkillSlot { Name = "SideCycleTarget", TokenSuffix = "CYCLE", State = typeof(TodoCycleTargetState), Icon = TodoAssets.CycleIcon, Cooldown = 0f, Priority = (InterruptPriority)0 }, ["SideSwap"] = new SkillSlot { Name = "SideSwap", TokenSuffix = "SWAP", State = typeof(TodoSwapState), Icon = TodoAssets.SwapIcon, Cooldown = 0f, Priority = (InterruptPriority)2 } }, GojoAssets.LoadPersistentTexture("ui/todo-portrait.png", "texTodoPortrait"), TodoAssets.SwapIcon, (Action)ConfigureBody, (Action)ConfigureDisplay); JujutsuCharacter val = new JujutsuCharacter(); val.Key = "Todo"; val.BodyPrefix = "AoiTodo"; val.MenuOrder = 3; val.SpawnLine = () => TodoAssets.SpawnVoice; val.FlashVoice = delegate(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) TodoAssets.TryPlayVoice(position, 1f); }; val.EffortVoice = TodoAssets.TryPlayVoice; val.Hints = new string[8] { "Throw the stone first - it is the destination Boogie Woogie swaps you to", "Both ends of a swap take damage", "Hold the special to dash further - the kick at the end is always a Black Flash", "Press the secondary in mid-air to come down on them instead", "X widens the clap - up to six enemies at each end change ends with it", "Nothing he lands from ever hurts him - throw the stone off a cliff and clap to it", "The clap has no cooldown; what rations it is Cursed Energy, and punching refills that", "A clap to your own stone is cheap, with an ally dear, and between two others dearest" }; val.Survivor = SurvivorDef; JujutsuCharacters.Register(val); } private static void ConfigureBody(GameObject bodyPrefab, SideSlots slots) { //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_00c9: 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_00eb: 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_0100: 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_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_0119: Expected O, but got Unknown //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_0137: 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_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_0162: 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_0170: Expected O, but got Unknown bodyPrefab.AddComponent(); bodyPrefab.AddComponent().UseVoice("Todo"); if (((SideSlots)(ref slots)).Made.ContainsKey("SideCycleTarget") && ((SideSlots)(ref slots)).Made.ContainsKey("SideSwap")) { bodyPrefab.AddComponent(); JujutsuStance.Attach(bodyPrefab, "CROWD", "PAIR", TodoLanguage.Colour, "Todo", TodoAssets.StanceCrowdIcon, TodoAssets.StancePairIcon); JujutsuNewcomers.AddStanceStrip(bodyPrefab, "Todo", "CODEX_TODO_STANCE_NAME", "CODEX_TODO_STANCE_DESCRIPTION", TodoAssets.StanceCrowdIcon); bodyPrefab.AddComponent().Configure(((SideSlots)(ref slots)).Made["SideCycleTarget"], ((SideSlots)(ref slots)).Made["SideSwap"]); bodyPrefab.AddComponent().Configure((Slot[])(object)new Slot[2] { new Slot { Skill = ((SideSlots)(ref slots)).Made["SideCycleTarget"], Icon = TodoAssets.CycleIcon, Bind = JujutsuInput.Describe(JujutsuConfig.SideSkill1Key.Value), ShortName = "MARK", Accent = ((SideSlots)(ref slots)).Accent }, new Slot { Skill = ((SideSlots)(ref slots)).Made["SideSwap"], Icon = TodoAssets.SwapIcon, Bind = JujutsuInput.Describe(JujutsuConfig.SideSkill2Key.Value), ShortName = "CLAP", Accent = ((SideSlots)(ref slots)).Accent } }); } JujutsuNewcomers.GiveSkinIcon(bodyPrefab, "todo-skin-default"); TodoExtraSkins.RegisterOnPrefab(bodyPrefab); TodoExtraSkins.Apply(bodyPrefab.GetComponentInChildren(true)); } private static void ConfigureDisplay(GameObject displayPrefab) { TodoExtraSkins.RegisterOnPrefab(displayPrefab); TodoExtraSkins.Apply(displayPrefab.GetComponentInChildren(true)); } } } namespace GojoSatoruMod.Components { internal sealed class TodoBoogieWoogie : MonoBehaviour { internal readonly struct ClapTarget { internal CharacterBody Body { get; } internal bool IsStone { get; } internal bool Exists { get { if (!IsStone) { if (Object.op_Implicit((Object)(object)Body) && Object.op_Implicit((Object)(object)Body.healthComponent)) { return Body.healthComponent.alive; } return false; } return true; } } internal static ClapTarget None => default(ClapTarget); internal static ClapTarget Stone => new ClapTarget(null, isStone: true); internal ClapTarget(CharacterBody body, bool isStone) { Body = body; IsStone = isStone; } } internal enum ClapRefusal { None, NothingChosen, NoStone, NotAffordable, NoRoom } internal const float Range = 140f; private const float StoneLifetime = 26f; private const float AimCone = 14f; internal const float ImpactCoefficient = 4f; internal const float ImpactRadius = 6f; internal const float ImpactInterval = 1.2f; internal const int CrowdLimit = 6; internal const float StoneClapEnergy = 4f; internal const float EnemyClapEnergy = 9f; internal const float AllyClapEnergy = 20f; internal const float RemoteClapEnergy = 32f; internal const float MostCarriedSpeed = 42f; private const float StoneCone = 22f; [SerializeField] private GenericSkill markSkill; [SerializeField] private GenericSkill swapSkill; private CharacterBody body; private JujutsuStance stance; private bool previousMarkHeld; private bool previousSwapHeld; private GameObject stone; private float stoneThrownAt = -1000f; private float lastImpactAt = -1000f; private ClapTarget mark; private static int clipped; internal const float ThrowRange = 70f; internal const float LeastThrowRange = 15f; internal const float MostThrowRange = 140f; private const float MetresPerNotch = 8f; internal GenericSkill CycleSkill => markSkill; internal GenericSkill SwapSkill => swapSkill; internal bool HasStone { get { if (Object.op_Implicit((Object)(object)stone)) { return Time.time - stoneThrownAt < 26f; } return false; } } internal ClapRefusal LastRefusal { get; private set; } private bool Crowded { get { if (Object.op_Implicit((Object)(object)stance)) { return stance.Engaged; } return false; } } private Ray AimRay { get { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inputBank)) { return new Ray(((Component)this).transform.position, ((Component)this).transform.forward); } return body.inputBank.GetAimRay(); } } internal ClapTarget Mark { get { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (mark.IsStone) { if (!HasStone) { return ClapTarget.None; } return mark; } if (!Object.op_Implicit((Object)(object)mark.Body) || !Object.op_Implicit((Object)(object)body)) { return mark; } Vector3 val = mark.Body.footPosition - body.footPosition; if (!(((Vector3)(ref val)).sqrMagnitude <= 19600f)) { return ClapTarget.None; } return mark; } } internal bool HasMark => Mark.Exists; private bool ImpactReady { get { if (Object.op_Implicit((Object)(object)body) && (Object)(object)body.teamComponent != (Object)null) { return Time.time - lastImpactAt >= 1.2f; } return false; } } internal float ThrowReach { get; private set; } = 70f; private void Awake() { body = ((Component)this).GetComponent(); stance = ((Component)this).GetComponent(); } private void Start() { GenericSkill[] components = ((Component)this).GetComponents(); for (int i = 0; i < components.Length; i++) { string skillName = components[i].skillName; if (!(skillName == "SideCycleTarget")) { if (skillName == "SideSwap") { swapSkill = components[i]; } } else { markSkill = components[i]; } } } internal void Configure(GenericSkill mark, GenericSkill swap) { markSkill = mark; swapSkill = swap; } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (JujutsuInput.IsBlocked || !Util.HasEffectiveAuthority(((Component)this).gameObject)) { previousMarkHeld = false; previousSwapHeld = false; return; } bool key = JujutsuInput.GetKey(JujutsuConfig.SideSkill1Key.Value); bool key2 = JujutsuInput.GetKey(JujutsuConfig.SideSkill2Key.Value); if (key && !previousMarkHeld) { GenericSkill obj = markSkill; if (obj != null) { obj.ExecuteIfReady(); } } if (key2 && !previousSwapHeld) { GenericSkill obj2 = swapSkill; if (obj2 != null) { obj2.ExecuteIfReady(); } } previousMarkHeld = key; previousSwapHeld = key2; } internal ClapTarget ResolveAimed() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = AimRay; float angle; CharacterBody val = FindCharacter(aimRay, out angle); float num = StoneAngle(aimRay); if (Object.op_Implicit((Object)(object)val) && angle <= num) { return new ClapTarget(val, isStone: false); } if (num < float.MaxValue) { return ClapTarget.Stone; } if (!Object.op_Implicit((Object)(object)val)) { return ClapTarget.None; } return new ClapTarget(val, isStone: false); } private CharacterBody FindCharacter(Ray aim, out float angle) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //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_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_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_0059: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_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) angle = float.MaxValue; if (!Object.op_Implicit((Object)(object)body)) { return null; } BullseyeSearch val = new BullseyeSearch { teamMaskFilter = TeamMask.all, filterByLoS = true, searchOrigin = ((Ray)(ref aim)).origin, searchDirection = ((Ray)(ref aim)).direction, sortMode = (SortMode)3, maxDistanceFilter = 140f, maxAngleFilter = 14f, viewer = body }; val.RefreshCandidates(); foreach (HurtBox result in val.GetResults()) { if (Object.op_Implicit((Object)(object)result) && Object.op_Implicit((Object)(object)result.healthComponent) && result.healthComponent.alive) { CharacterBody val2 = result.healthComponent.body; if (Object.op_Implicit((Object)(object)val2) && !((Object)(object)val2 == (Object)(object)body)) { angle = Vector3.Angle(((Ray)(ref aim)).direction, val2.corePosition - ((Ray)(ref aim)).origin); return val2; } } } return null; } private float StoneAngle(Ray aim) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) if (!HasStone) { return float.MaxValue; } Vector3 val = stone.transform.position - ((Ray)(ref aim)).origin; if (((Vector3)(ref val)).magnitude > 140f) { return float.MaxValue; } float num = Vector3.Angle(((Ray)(ref aim)).direction, val); if (!(num <= 22f)) { return float.MaxValue; } return num; } internal void MarkAimed() { ClapTarget clapTarget = ResolveAimed(); mark = ((clapTarget.Exists && !Same(clapTarget, mark)) ? clapTarget : ClapTarget.None); } internal string NameOf(ClapTarget target) { if (target.IsStone) { return "STONE"; } if (!Object.op_Implicit((Object)(object)target.Body)) { return "NONE"; } return Language.GetString(target.Body.baseNameToken); } private static bool Same(ClapTarget left, ClapTarget right) { if (!left.IsStone) { if (!right.IsStone) { return (Object)(object)left.Body == (Object)(object)right.Body; } return false; } return right.IsStone; } internal Vector3 PositionOf(ClapTarget target) { //IL_0048: 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_0027: 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 (target.IsStone) { if (!Object.op_Implicit((Object)(object)stone)) { return Vector3.zero; } return stone.transform.position; } if (!Object.op_Implicit((Object)(object)target.Body)) { return Vector3.zero; } return target.Body.footPosition; } private bool Found(ClapTarget target) { if (!target.IsStone) { return target.Exists; } return HasStone; } internal bool Swap() { ClapTarget clapTarget = ResolveAimed(); ClapTarget clapTarget2 = Mark; ClapTarget clapTarget3 = new ClapTarget(body, isStone: false); ClapTarget clapTarget4; ClapTarget clapTarget5; if (clapTarget2.Exists) { clapTarget4 = clapTarget2; clapTarget5 = ((clapTarget.Exists && !Same(clapTarget, clapTarget2)) ? clapTarget : clapTarget3); } else { clapTarget4 = clapTarget3; clapTarget5 = (clapTarget.Exists ? clapTarget : ClapTarget.Stone); } if (!Found(clapTarget4) || !Found(clapTarget5) || Same(clapTarget4, clapTarget5)) { LastRefusal = (((!clapTarget5.IsStone || HasStone) && (!clapTarget4.IsStone || HasStone)) ? ClapRefusal.NothingChosen : ClapRefusal.NoStone); return false; } float price = ClapPrice(clapTarget4, clapTarget5); if (!Afford(price)) { LastRefusal = ClapRefusal.NotAffordable; return false; } if (!Perform(clapTarget4, clapTarget5)) { LastRefusal = ClapRefusal.NoRoom; return false; } Spend(price); TodoRhythm todoRhythm = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent() : null); if (Object.op_Implicit((Object)(object)todoRhythm)) { todoRhythm.Clapped(); } ClearMark(); LastRefusal = ClapRefusal.None; return true; } private bool Afford(float price) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) CursedEnergyController val = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent() : null); if (!Object.op_Implicit((Object)(object)val) || val.CanAfford(price)) { return true; } JujutsuCharacters.ForBody(body)?.EffortVoice?.Invoke(body.corePosition, 0.9f); return false; } private void Spend(float price) { CursedEnergyController val = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { val.TrySpendPriced(price); } } private float ClapPrice(ClapTarget near, ClapTarget far) { bool flag = !near.IsStone && (Object)(object)near.Body == (Object)(object)body; bool flag2 = !far.IsStone && (Object)(object)far.Body == (Object)(object)body; if (!flag && !flag2) { return 32f; } ClapTarget clapTarget = (flag ? far : near); if (clapTarget.IsStone) { return 4f; } if (!SharesTeam(clapTarget.Body)) { return 9f; } return 20f; } private bool SharesTeam(CharacterBody other) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)other) && Object.op_Implicit((Object)(object)body) && (Object)(object)other.teamComponent != (Object)null && (Object)(object)body.teamComponent != (Object)null) { return other.teamComponent.teamIndex == body.teamComponent.teamIndex; } return false; } internal void ClearMark() { mark = ClapTarget.None; } internal void MoveStone(Vector3 destination) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Object.op_Implicit((Object)(object)stone)) { Vector3 position = stone.transform.position; stone.transform.position = destination; Vector3 val = position - destination; if (!(((Vector3)(ref val)).sqrMagnitude < 0.04f)) { float radius = TodoFx.Reach(body, 5.1000004f); TodoFx.Portal(position, destination, arriving: false, radius, forLocalPlayer: false); TodoFx.Portal(destination, position, arriving: true, radius, forLocalPlayer: false); stone.GetComponent()?.Settle(); } } } internal void AdoptStone(GameObject built) { if (Object.op_Implicit((Object)(object)stone) && (Object)(object)stone != (Object)(object)built) { Object.Destroy((Object)(object)stone); } stone = built; stoneThrownAt = Time.time; } internal void PerformForClient(CharacterBody nearBody, bool nearIsStone, CharacterBody farBody, bool farIsStone, Vector3 stoneAt, bool stoneKnown, bool clientLands) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } if ((nearIsStone || farIsStone) && !Object.op_Implicit((Object)(object)stone) && stoneKnown) { stone = new GameObject("TodoBoogieWoogieStoneEcho"); stone.transform.position = stoneAt; stoneThrownAt = Time.time; Object.Destroy((Object)(object)stone, 4f); } if ((nearIsStone || farIsStone) && !Object.op_Implicit((Object)(object)stone)) { Plugin.Log.LogInfo((object)"A clap wanted the stone and neither machine could say where it was, so it was refused rather than aimed at the origin."); return; } ClapTarget near = (nearIsStone ? ClapTarget.Stone : new ClapTarget(nearBody, isStone: false)); ClapTarget far = (farIsStone ? ClapTarget.Stone : new ClapTarget(farBody, isStone: false)); if (!near.Exists || !far.Exists) { Plugin.Log.LogInfo((object)"A clap arrived after one of its ends had gone, so there was nothing left to trade."); } else { Perform(near, far, clientLands); } } private bool Perform(ClapTarget near, ClapTarget far, bool clientLands = true) { //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_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_00c2: 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_0097: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_014b: 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_0199: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_0291: 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_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: 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_02c8: 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_02b4: 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_0221: 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) if (!Found(near) || !Found(far)) { Plugin.Log.LogInfo((object)"A clap named an end this machine cannot find, so it was refused rather than aimed at the origin."); return false; } if (!NetworkServer.active && (MovesSomebodyElse(near) || MovesSomebodyElse(far))) { bool impactReady = ImpactReady; if (impactReady) { lastImpactAt = Time.time; } TodoStoneSync.RequestClap(body, near.Body, near.IsStone, far.Body, far.IsStone, Object.op_Implicit((Object)(object)stone) ? stone.transform.position : Vector3.zero, Object.op_Implicit((Object)(object)stone), impactReady); return true; } Vector3 val = PositionOf(near); Vector3 val2 = PositionOf(far); if (!Landing(near, val2, !far.IsStone, out var answer) || !Landing(far, val, !near.IsStone, out var answer2)) { Plugin.Log.LogInfo((object)"A clap had nowhere to put one of its two ends, so neither of them travelled."); return false; } int num; int num2; object obj; if (clientLands) { num = (ImpactReady ? 1 : 0); if (num != 0) { num2 = (Crowded ? 1 : 0); if (num2 == 0) { goto IL_0118; } obj = Gather(val, near, far); goto IL_0124; } } else { num = 0; } num2 = 0; goto IL_0118; IL_0118: obj = null; goto IL_0124; IL_0199: Vector3 val3 = Vector3.zero; goto IL_01a7; IL_01a7: Vector3 val4 = val3; int num3; TodoStoneFlight todoStoneFlight; if (num3 != 0) { _ = todoStoneFlight.Boosted; } else _ = 0; bool flag = Send(near, answer); bool flag2 = Send(far, answer2); SpeakIfBestFriend(near, far, val, val2); if (num3 != 0) { CharacterBody val5 = (near.IsStone ? far.Body : near.Body); if ((near.IsStone ? flag2 : flag) && Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.characterMotor)) { val5.characterMotor.velocity = Vector3.ClampMagnitude(val4, 42f); KinematicCharacterMotor motor = ((BaseCharacterController)val5.characterMotor).Motor; if (motor != null) { motor.ForceUnground(0.1f); } } Object.Destroy((Object)(object)todoStoneFlight); } if (near.IsStone || far.IsStone) { stoneThrownAt = Time.time; } bool forLocalPlayer = TodoFx.IsLocalPlayer(near.Body) || TodoFx.IsLocalPlayer(far.Body); TodoFx.Portal(val, val2, arriving: false, ClapRadius(), forLocalPlayer); TodoFx.Portal(val2, val, arriving: true, ClapRadius(), forLocalPlayer); if (num != 0) { Impact(val, val2); } List list; Carry(list, val, val2); List list2; Carry(list2, val2, val); return true; IL_0124: list = (List)obj; list2 = ((num2 != 0) ? Gather(val2, near, far) : null); Divide(list, val, list2, val2); Trim(list, val); Trim(list2, val2); todoStoneFlight = (Object.op_Implicit((Object)(object)stone) ? stone.GetComponent() : null); if (Object.op_Implicit((Object)(object)todoStoneFlight) && todoStoneFlight.InFlight) { if (!near.IsStone) { num3 = (far.IsStone ? 1 : 0); if (num3 == 0) { goto IL_0199; } } else { num3 = 1; } val3 = todoStoneFlight.Velocity; goto IL_01a7; } num3 = 0; goto IL_0199; } private void SpeakIfBestFriend(ClapTarget near, ClapTarget far, Vector3 here, Vector3 there) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) if (near.IsStone || far.IsStone || !Object.op_Implicit((Object)(object)body)) { return; } CharacterBody val; Vector3 at; if ((Object)(object)near.Body == (Object)(object)body) { val = far.Body; at = here; } else { if (!((Object)(object)far.Body == (Object)(object)body)) { return; } val = near.Body; at = there; } if (!(JujutsuCharacters.ForBody(val)?.Key != "Yuji")) { TodoStoneSync.Befriend(at); } } private float ClapRadius() { return TodoFx.Reach(body, 5.1000004f); } private void Impact(Vector3 here, Vector3 there) { //IL_0043: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_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) if (ImpactReady) { lastImpactAt = Time.time; float damage = body.damage * 4f; bool crit = Util.CheckRoll(body.crit, body.master); Blast(here, damage, crit); Blast(there, damage, crit); float num = JujutsuFxScale.Weight(4f); float num2 = TodoFx.Reach(body, 6f); JujutsuImpact.Detonate(here, TodoFx.Colour, num2, num, true); JujutsuImpact.Detonate(there, TodoFx.Colour, num2, num, true); if (NetworkServer.active) { JujutsuImpact.Surface(here, Vector3.up, num2, true); JujutsuImpact.Surface(there, Vector3.up, num2, true); } } } private void Blast(Vector3 position, float damage, bool crit) { //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_002e: Unknown result type (might be due to invalid IL or missing references) GojoMeleeAttackUtility.FireRadial(((Component)this).gameObject, body, body.teamComponent.teamIndex, position, 6f, damage, 1400f, 500f, crit, DamageTypeCombo.GenericSecondary); } private List Gather(Vector3 point, ClapTarget near, ClapTarget far) { //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_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_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_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) ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null || !Object.op_Implicit((Object)(object)body) || (Object)(object)body.teamComponent == (Object)null) { return null; } List list = null; TeamIndex teamIndex = body.teamComponent.teamIndex; float num = 36f; for (int i = 0; i < readOnlyInstancesList.Count; i++) { CharacterBody val = readOnlyInstancesList[i]; if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)body) && !((Object)(object)val == (Object)(object)near.Body) && !((Object)(object)val == (Object)(object)far.Body) && !((Object)(object)val.teamComponent == (Object)null) && val.teamComponent.teamIndex != teamIndex && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { Vector3 val2 = val.corePosition - point; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { list = list ?? new List(6); list.Add(val); } } } return list; } private static void Divide(List nearCrowd, Vector3 here, List farCrowd, Vector3 there) { //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_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_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_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) if (nearCrowd == null || farCrowd == null) { return; } for (int num = nearCrowd.Count - 1; num >= 0; num--) { CharacterBody val = nearCrowd[num]; int num2 = farCrowd.IndexOf(val); if (num2 >= 0) { Vector3 val2 = val.corePosition - here; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; val2 = val.corePosition - there; if (sqrMagnitude <= ((Vector3)(ref val2)).sqrMagnitude) { farCrowd.RemoveAt(num2); } else { nearCrowd.RemoveAt(num); } } } } private static void Trim(List crowd, Vector3 point) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (crowd != null && crowd.Count > 6) { if (clipped < 12) { clipped++; Plugin.Log.LogInfo((object)($"Crowd clap: {crowd.Count} at one end, carrying the " + $"nearest {6}.")); } crowd.Sort(delegate(CharacterBody left, CharacterBody right) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = left.corePosition - point; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; val = right.corePosition - point; return sqrMagnitude.CompareTo(((Vector3)(ref val)).sqrMagnitude); }); crowd.RemoveRange(6, crowd.Count - 6); } } private void Carry(List crowd, Vector3 from, Vector3 to) { //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_004b: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (crowd == null) { return; } for (int i = 0; i < crowd.Count; i++) { CharacterBody val = crowd[i]; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { Vector3 val2 = val.footPosition - from; val2.y = 0f; val2 = Vector3.ClampMagnitude(val2, 6f); TodoStoneSync.Order(val, JujutsuTeleport.UnblockedPoint(to + val2, val, val.footPosition, true), report: false); } } } private bool MovesSomebodyElse(ClapTarget target) { if (!target.IsStone && Object.op_Implicit((Object)(object)target.Body)) { return (Object)(object)target.Body != (Object)(object)body; } return false; } private bool Landing(ClapTarget target, Vector3 destination, bool ontoBody, out Vector3 answer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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) answer = destination; if (target.IsStone) { return true; } if (!Object.op_Implicit((Object)(object)target.Body)) { return false; } Vector3 footPosition = target.Body.footPosition; answer = JujutsuTeleport.UnblockedPoint(destination, target.Body, footPosition, !ontoBody); Vector3 val = answer - footPosition; return ((Vector3)(ref val)).sqrMagnitude > 0.04f; } private bool Send(ClapTarget target, Vector3 destination) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (target.IsStone) { MoveStone(destination); TodoStoneSync.OrderStone(body, destination); return true; } if (!Object.op_Implicit((Object)(object)target.Body)) { return false; } TodoStoneSync.Order(target.Body, destination); return true; } internal float AimThrow(float notches) { ThrowReach = Mathf.Clamp(ThrowReach + notches * 8f, 15f, 140f); return ThrowReach; } internal static Vector3 ThrowOrigin(CharacterBody thrower) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_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_0008: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)thrower)) { return Vector3.zero; } return thrower.corePosition + Vector3.up * 0.5f + thrower.transform.forward * 0.9f; } internal static Vector3 ThrowDestination(Ray aim, float reach = 70f) { //IL_0012: 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_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_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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) reach = Mathf.Clamp(reach, 15f, 140f); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(aim, ref val, reach, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { return ((Ray)(ref aim)).origin + ((Ray)(ref aim)).direction * reach; } return ((RaycastHit)(ref val)).point + Vector3.up * 0.4f; } internal void PlaceStone(Vector3 position) { //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_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_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) if (Object.op_Implicit((Object)(object)stone)) { Object.Destroy((Object)(object)stone); } Vector3 origin = ThrowOrigin(body); stone = Build(body, origin, position); stoneThrownAt = Time.time; TodoStoneSync.Broadcast(body, origin, position); } internal static GameObject Build(CharacterBody thrower, Vector3 origin, Vector3 destination) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0040: Expected O, but got Unknown GameObject val = new GameObject("TodoBoogieWoogieStone"); val.transform.position = origin; val.AddComponent().Initialize(TodoLanguage.Colour, 26f); TodoStoneFlight todoStoneFlight = val.AddComponent(); todoStoneFlight.Configure(thrower); todoStoneFlight.Launch(origin, destination); return val; } } internal sealed class TodoStoneMarker : MonoBehaviour { private const float BeamHeight = 2.4f; private const float PingSeconds = 1.35f; private const float PingLife = 0.7f; private readonly LineRenderer[] beams = (LineRenderer[])(object)new LineRenderer[3]; private readonly Material[] beamMaterials = (Material[])(object)new Material[3]; private readonly Color[] beamColours = (Color[])(object)new Color[3]; private readonly float[] beamGlows = new float[3]; private TodoFxPart flare; private TodoFxPart halo; private TodoFxPart floorRing; private ParticleSystem embers; private Color colour; private float lifetime; private float age; private float pingAt; private bool settled; internal void Initialize(Color tint, float seconds) { //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_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_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_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_007d: Unknown result type (might be due to invalid IL or missing references) lifetime = seconds; colour = tint; flare = TodoFx.Flare("TodoMarkCore", ((Component)this).transform.position, tint, 0.85f, 34f, 0f); halo = TodoFx.Flare("TodoMarkHalo", ((Component)this).transform.position, tint, 2.1f, -13f, 0f); if (halo != null) { halo.Retint(Color.Lerp(tint, Color.black, 0.15f), 0.55f); halo.Envelope(0.55f); } Carry(flare); Carry(halo); BuildBeam(); } private void Carry(TodoFxPart part) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (part != null && part.Alive) { part.Item.transform.SetParent(((Component)this).transform, false); part.Item.transform.localPosition = Vector3.zero; } } internal void Settle() { //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) settled = true; if (floorRing != null && floorRing.Alive) { Object.Destroy((Object)(object)floorRing.Item); } floorRing = TodoFx.FloorRing(((Component)this).transform.position, colour, 1.5f, lifetime - age); } private void BuildBeam() { //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_0061: 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_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_00ad: 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_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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_015b: 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) JujutsuFxLayer[] array = (JujutsuFxLayer[])(object)new JujutsuFxLayer[3] { (JujutsuFxLayer)2, (JujutsuFxLayer)1, default(JujutsuFxLayer) }; float[] array2 = new float[3] { 0.42f, 0.17f, 0.06f }; for (int i = 0; i < array.Length; i++) { GameObject val = new GameObject("TodoMarkBeam" + ((object)Unsafe.As(ref array[i])/*cast due to .constrained prefix*/).ToString()); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.zero; LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = false; val2.alignment = (LineAlignment)0; val2.textureMode = (LineTextureMode)0; val2.numCapVertices = 2; val2.positionCount = 2; val2.SetPosition(0, Vector3.zero); val2.SetPosition(1, Vector3.up * 2.4f); val2.widthCurve = JujutsuEase.Curve((Func)((float t) => Mathf.Lerp(1f, 0.06f, JujutsuEase.InQuad(t))), 8); val2.widthMultiplier = array2[i]; Color val3 = TodoFx.Tinted(colour, array[i]); Material val4 = (((Renderer)val2).sharedMaterial = JujutsuFxMaterials.CreateLayerMaterial("matTodoMarkBeam" + ((object)Unsafe.As(ref array[i])/*cast due to .constrained prefix*/).ToString(), colour, array[i], JujutsuFxTextures.Streak)); JujutsuFxMaterials.Claim(val, val4); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); beams[i] = val2; beamMaterials[i] = val4; beamColours[i] = val3; beamGlows[i] = JujutsuFxMaterials.GlowFor(array[i]); } } private void Update() { //IL_0032: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; if (age >= lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } ((Component)this).transform.Rotate(Vector3.up, 90f * Time.deltaTime, (Space)0); float num = JujutsuEase.Window(age, lifetime - 2.2f, lifetime); float num2 = JujutsuEase.FlickerScaled(Time.time, 0.68f, 3.4f) * (1f - JujutsuEase.InQuad(num)); for (int i = 0; i < beams.Length; i++) { if (Object.op_Implicit((Object)(object)beamMaterials[i])) { JujutsuFxMaterials.SetEnvelope(beamMaterials[i], beamColours[i], num2, beamGlows[i]); } } flare?.Envelope(num2); halo?.Envelope(num2 * 0.55f); flare?.Scale(Vector3.one * (0.85f * Mathf.Lerp(0.8f, 1.15f, num2))); halo?.Scale(Vector3.one * (2.1f * Mathf.Lerp(0.92f, 1.08f, num2))); if (settled && !(Time.time < pingAt)) { pingAt = Time.time + 1.35f; Ping(); } } private void Ping() { //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_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) TodoFx.Ping(((Component)this).transform.position + Vector3.up * 0.12f, colour, 2.6f, 0.7f); } private void OnEnable() { pingAt = Time.time + 0.675f; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)embers)) { JujutsuMotes.Stop(embers); embers = null; } if (floorRing != null && floorRing.Alive) { Object.Destroy((Object)(object)floorRing.Item); } } internal void Rest() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)embers)) { embers = JujutsuMotes.Attach(((Component)this).transform, colour, 0.7f, (JujutsuMoteKind)0); } } } internal sealed class TodoStoneFlight : MonoBehaviour { internal const float Gravity = 30f; private const float MinimumFlight = 0.28f; private const float MaximumFlight = 1.15f; private const float SecondsPerMetre = 1f / 45f; private const float BoostScale = 3.1f; private const float CatchRadius = 2.6f; private const float Coefficient = 2.2f; private const float HitRadius = 1.6f; private const float LandingRadius = 3.4f; private Vector3 velocity; private bool landed; private CharacterBody owner; private float damage; private readonly HashSet struck = new HashSet(); private readonly TrailRenderer[] trails = (TrailRenderer[])(object)new TrailRenderer[2]; internal bool InFlight => !landed; internal Vector3 Velocity => velocity; internal bool Boosted { get; private set; } private float Payload => damage * 2.2f * (Boosted ? 3.1f : 1f); internal void Configure(CharacterBody thrower) { owner = thrower; damage = (Object.op_Implicit((Object)(object)thrower) ? thrower.damage : 0f); } internal static Vector3 Solve(Vector3 origin, Vector3 destination, out float seconds) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Vector3 val = destination - origin; seconds = Mathf.Clamp(((Vector3)(ref val)).magnitude * (1f / 45f), 0.28f, 1.15f); Vector3 result = val / seconds; result.y += 15f * seconds; return result; } internal static Vector3 Sample(Vector3 origin, Vector3 launch, float seconds) { //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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) return origin + launch * seconds - Vector3.up * (15f * seconds * seconds); } internal void Launch(Vector3 origin, Vector3 destination) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) ((Component)this).transform.position = origin; velocity = Solve(origin, destination, out var _); BuildTrail(); } private void BuildTrail() { //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_0073: 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_0083: 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_0137: Expected O, but got Unknown JujutsuFxLayer[] array = (JujutsuFxLayer[])(object)new JujutsuFxLayer[2] { (JujutsuFxLayer)1, default(JujutsuFxLayer) }; float[] array2 = new float[2] { 0.5f, 0.16f }; float[] array3 = new float[2] { 0.34f, 0.2f }; for (int i = 0; i < array.Length; i++) { GameObject val = new GameObject("TodoStoneTrail" + ((object)Unsafe.As(ref array[i])/*cast due to .constrained prefix*/).ToString()); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.zero; TrailRenderer val2 = val.AddComponent(); val2.time = array3[i]; val2.minVertexDistance = 0.12f; val2.autodestruct = false; val2.alignment = (LineAlignment)0; val2.textureMode = (LineTextureMode)0; val2.numCapVertices = 2; val2.widthCurve = JujutsuEase.Curve((Func)((float t) => Mathf.Lerp(1f, 0.05f, JujutsuEase.OutCubic(t))), 8); val2.widthMultiplier = array2[i]; Material val3 = (((Renderer)val2).sharedMaterial = JujutsuFxMaterials.CreateLayerMaterial("matTodoStoneTrail" + ((object)Unsafe.As(ref array[i])/*cast due to .constrained prefix*/).ToString(), TodoFx.Colour, array[i], JujutsuFxTextures.Streak)); JujutsuFxMaterials.Claim(val, val3); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); trails[i] = val2; } } private void Settled() { for (int i = 0; i < trails.Length; i++) { if (Object.op_Implicit((Object)(object)trails[i])) { trails[i].emitting = false; } } } private void FixedUpdate() { //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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0162: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_011c: 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_0147: Unknown result type (might be due to invalid IL or missing references) if (landed) { return; } TryCatch(); velocity += Vector3.down * (30f * Time.fixedDeltaTime); Vector3 position = ((Component)this).transform.position; Vector3 val = velocity * Time.fixedDeltaTime; RaycastHit val2 = default(RaycastHit); if (((Vector3)(ref val)).sqrMagnitude > 1E-06f && Physics.Raycast(position, ((Vector3)(ref val)).normalized, ref val2, ((Vector3)(ref val)).magnitude + 0.3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { ((Component)this).transform.position = ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * 0.6f; landed = true; Settled(); Arrive(((RaycastHit)(ref val2)).point, ((RaycastHit)(ref val2)).normal); if (NetworkServer.active && Object.op_Implicit((Object)(object)owner)) { JujutsuDamageUtility.FireSphere(((Component)owner).gameObject, (TeamIndex)((!Object.op_Implicit((Object)(object)owner.teamComponent)) ? 1 : ((int)owner.teamComponent.teamIndex)), ((Component)this).transform.position, 3.4f, Payload, 900f, 300f, false, 1f, DamageTypeCombo.GenericSecondary, (Color?)null, true); } } else { ((Component)this).transform.position = position + val; HitAlong(position); } } private void Arrive(Vector3 point, Vector3 normal) { //IL_0031: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) float num = JujutsuFxScale.Weight(2.2f * (Boosted ? 3.1f : 1f)); float num2 = TodoFx.Reach(owner, 3.4f); JujutsuImpact.Detonate(point, TodoFx.Colour, num2, num, true); if (NetworkServer.active) { JujutsuImpact.Surface(point, normal, num2, true); } TodoStoneMarker component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.Settle(); component.Rest(); } } private void HitAlong(Vector3 from) { //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_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_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_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_00f9: 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_011c: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)owner) || (Object)(object)owner.teamComponent == (Object)null) { return; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } TeamIndex teamIndex = owner.teamComponent.teamIndex; float num = 2.5600002f; Vector3 position = ((Component)this).transform.position; for (int i = 0; i < readOnlyInstancesList.Count; i++) { CharacterBody val = readOnlyInstancesList[i]; if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val.teamComponent == (Object)null) && val.teamComponent.teamIndex != teamIndex && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && !struck.Contains(val.healthComponent) && !(OffStep(val.corePosition, from, position) > num)) { struck.Add(val.healthComponent); JujutsuDamageUtility.FireSphere(((Component)owner).gameObject, teamIndex, val.corePosition, 1.6f, Payload, 700f, 200f, false, 1f, DamageTypeCombo.GenericSecondary, (Color?)null, true); } } } private static float OffStep(Vector3 point, Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //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) Vector3 val = to - from; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; Vector3 val2; if (sqrMagnitude < 1E-06f) { val2 = point - to; return ((Vector3)(ref val2)).sqrMagnitude; } float num = Mathf.Clamp01(Vector3.Dot(point - from, val) / sqrMagnitude); val2 = point - (from + val * num); return ((Vector3)(ref val2)).sqrMagnitude; } private void TryCatch() { //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f7: 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_0109: 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) if (Boosted || !Object.op_Implicit((Object)(object)owner) || (Object)(object)owner.teamComponent == (Object)null) { return; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } TeamIndex teamIndex = owner.teamComponent.teamIndex; float num = 6.7599993f; Vector3 position = ((Component)this).transform.position; for (int i = 0; i < readOnlyInstancesList.Count; i++) { CharacterBody val = readOnlyInstancesList[i]; if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)owner) && !((Object)(object)val.teamComponent == (Object)null) && val.teamComponent.teamIndex == teamIndex && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { Vector3 val2 = val.corePosition - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { Vector3 normalized = ((Vector3)(ref velocity)).normalized; velocity *= 3.1f; Boosted = true; JujutsuSfxAssets.PlayMeleeHeavy(position); TodoFx.Catch(position, normalized, val); break; } } } } } internal sealed class TodoFxPart { internal readonly GameObject Item; internal readonly Mesh Mesh; internal readonly Material Material; private Color tint; private float glow; internal bool Alive => Object.op_Implicit((Object)(object)Item); internal TodoFxPart(GameObject item, Mesh mesh, Material material, Color partTint, float partGlow) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Item = item; Mesh = mesh; Material = material; tint = partTint; glow = partGlow; } internal void Retint(Color newTint, float newGlow) { //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) tint = newTint; glow = newGlow; } internal void Envelope(float alpha) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { JujutsuFxMaterials.SetEnvelope(Material, tint, alpha, glow); } } internal void Place(Vector3 position) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Item)) { Item.transform.position = position; } } internal void Aim(Quaternion rotation) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Item)) { Item.transform.rotation = rotation; } } internal void Scale(Vector3 scale) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Item)) { Item.transform.localScale = scale; } } } internal sealed class TodoMeshKeeper : MonoBehaviour { private Mesh mesh; internal void Own(Mesh owned) { mesh = owned; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mesh)) { Object.Destroy((Object)(object)mesh); } } } internal static class TodoFx { private const float PortalLife = 0.62f; private const float MeetShare = 0.45f; private const float PlateSpread = 0.95f; private const float FootLift = 1f; private const float FailureRest = 20f; private const float RepeatSeconds = 0.2f; private const float RepeatDistance = 0.5f; private static readonly Vector3[] recentAt = (Vector3[])(object)new Vector3[8]; private static readonly float[] recentWhen = new float[8]; private static int recentNext; private static float restingUntil; private static bool failureLogged; private static readonly Color RingInner = new Color(1f, 1f, 1f, 0.1f); private static readonly Color RingMiddle = Color.white; private static readonly Color RingOuter = new Color(1f, 1f, 1f, 0f); private static readonly Color PlateCore = new Color(1f, 1f, 1f, 0.85f); private static readonly Color PlateRim = new Color(1f, 1f, 1f, 0f); private static JujutsuGroundField liftField; private static float liftReach; private static float liftBase; private static float liftClearance = 0.07f; private static readonly Func LiftOf = (float angle) => (liftField != null) ? (liftField.PointAt(angle, liftReach, liftClearance).y - liftBase) : 0f; internal static Color Colour => TodoLanguage.Colour; internal static float Reach(CharacterBody body, float metres) { return JujutsuFxScale.Of(body, metres / 1.1f); } internal static Color Tinted(Color colour, JujutsuFxLayer layer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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: Invalid comparison between Unknown and I4 //IL_004f: 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_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_003e: Unknown result type (might be due to invalid IL or missing references) Color result = colour; if ((int)layer != 0) { if ((int)layer == 2) { result = Color.Lerp(colour, Color.black, 0.15f); result.a = colour.a * 0.45f; } } else { result = Color.Lerp(colour, Color.white, 0.78f); result.a = colour.a; } return result; } internal static bool IsLocalPlayer(CharacterBody who) { if (!Object.op_Implicit((Object)(object)who) || LocalUserManager.readOnlyLocalUsersList == null) { return false; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if (readOnlyLocalUsers != null && (Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)who) { return true; } } return false; } internal static void Portal(Vector3 foot, Vector3 partner, bool arriving, float radius, bool forLocalPlayer) { //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_0012: Unknown result type (might be due to invalid IL or missing references) if (Resting() || !Claim(foot)) { return; } try { BuildPortal(foot, partner, arriving, radius, forLocalPlayer); } catch (Exception exception) { Fail(exception); } } private static void BuildPortal(Vector3 foot, Vector3 partner, bool arriving, float radius, bool forLocalPlayer) { //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_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_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_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_0150: 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_016d: 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_018a: 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_01a7: 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_01c4: Unknown result type (might be due to invalid IL or missing references) radius = Mathf.Clamp(radius, 0.6f, 24f); Vector3 centre = foot + Vector3.up * 1f; Vector3 axis = Axis(partner - foot, Vector3.forward); Quaternion rotation = Quaternion.FromToRotation(Vector3.up, axis); Quaternion rotation2 = Quaternion.LookRotation(axis, Steady(axis)); Quaternion rotation3 = Quaternion.LookRotation(-axis, Steady(axis)); Color colour = Colour; float meet = (arriving ? 0f : 0.45f); float num = 0.62f; int seed = Seed(centre); int segments = Mathf.Clamp(Mathf.RoundToInt(radius * 3f) + 24, 24, 72); TodoFxPart flare = Flare("TodoClapFlare", centre, colour, radius * 0.8f, arriving ? 130f : (-95f), num); TodoFxPart core = Part("TodoClapRingCore", centre, rotation, colour, (JujutsuFxLayer)0, null, num); TodoFxPart body = Part("TodoClapRingBody", centre, rotation, colour, (JujutsuFxLayer)1, null, num); TodoFxPart haze = Part("TodoClapRingHaze", centre, rotation, colour, (JujutsuFxLayer)2, null, num); TodoFxPart nearPlate = Part("TodoClapPlateNear", centre, rotation2, colour, (JujutsuFxLayer)1, null, num); TodoFxPart farPlate = Part("TodoClapPlateFar", centre, rotation3, colour, (JujutsuFxLayer)1, null, num); Plate(nearPlate, segments, seed + 5); Plate(farPlate, segments, seed + 11); float spread = radius * 0.95f; Action action = delegate(float t) { //IL_00f4: 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_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) float num2 = (arriving ? JujutsuEase.Window(t, 0f, 0.55f) : JujutsuEase.Window(t, 0f, meet)); float num3 = (arriving ? (spread * JujutsuEase.OutExpo(num2)) : (spread * (1f - JujutsuEase.InCubic(num2)))); float alpha = (arriving ? (1f - JujutsuEase.OutCubic(num2)) : (Mathf.Min(1f, 0.2f + JujutsuEase.InQuad(num2)) * (1f - JujutsuEase.OutCubic(JujutsuEase.Window(t, meet, meet + 0.18f))))); float num4 = radius * Mathf.Lerp(0.62f, 0.18f, num2); Vector3 scale = default(Vector3); ((Vector3)(ref scale))..ctor(Mathf.Max(0.001f, num4), Mathf.Max(0.001f, num4), Mathf.Max(0.001f, num3)); nearPlate?.Scale(scale); farPlate?.Scale(scale); nearPlate?.Envelope(alpha); farPlate?.Envelope(alpha); float num5 = JujutsuEase.Window(t, meet, 1f); float num6 = ((t < meet) ? 0f : 1f); float reach = radius * JujutsuEase.OutExpo(num5); float num7 = radius * Mathf.Lerp(0.34f, 0.06f, JujutsuEase.OutCubic(num5)); float num8 = num6 * JujutsuEase.Snap(num5, 0.11f); Ring(core, reach, num7 * 0.45f, segments, seed, num8); Ring(body, reach, num7, segments, seed + 3, num8 * 0.9f); Ring(haze, reach, num7 * 2.1f, segments, seed + 7, num8 * 0.75f); float num9 = (arriving ? 0f : (0.4f * JujutsuEase.InCubic(JujutsuEase.Window(t, 0f, meet)))); float num10 = num6 * JujutsuEase.Snap(num5, 0.16f); float alpha2 = Mathf.Max(num9, num10); flare?.Envelope(alpha2); flare?.Scale(Vector3.one * Mathf.Max(0.001f, radius * 0.8f * Mathf.Lerp(0.35f, 1f, Mathf.Max(num9, num10)))); }; action(0f); JujutsuFxSequence.Run(num).While(action).AtSeconds(meet * num, (Action)delegate { //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) Snap(centre, axis, radius, forLocalPlayer); }) .AtSeconds((meet + 0.3f) * num, (Action)delegate { //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) Wake(centre, axis, radius); }); } private static void Snap(Vector3 centre, Vector3 axis, float radius, bool forLocalPlayer) { //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_0013: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) GojoTechniqueVisuals.CreateBurst(centre, Colour, radius * 0.7f, 0.3f, (GojoTechniqueStyle)5, axis); JujutsuFxShake.Tier(centre, 0.42f); JujutsuFxLights.Borrow(centre, Color.Lerp(Colour, Color.white, 0.4f), 8f, Mathf.Clamp(radius * 3f, 4f, 30f), 0.13f); JujutsuMotes.Burst(centre, axis, Colour, radius, (JujutsuMoteKind)2, 20); JujutsuMotes.Burst(centre, -axis, Colour, radius, (JujutsuMoteKind)2, 20); if (forLocalPlayer) { JujutsuFxScreen.Flash(new Color(1f, 0.94f, 1f, 0.3f), 0.11f); } } private static void Wake(Vector3 centre, Vector3 axis, float radius) { //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_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_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_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) JujutsuMotes.Burst(centre, Vector3.up, Colour, radius * 0.8f, (JujutsuMoteKind)0, 0); JujutsuMotes.Burst(centre - Vector3.up * 0.75f, Vector3.up, Colour, radius * 0.7f, (JujutsuMoteKind)1, 0); JujutsuFxDebris.Throw(centre, axis, Colour, radius * 0.7f, 6, 0f, 0.85f); } internal static void Gather(CharacterBody body, float forward, float rise, float seconds, float radius) { //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_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_007b: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) if (Resting() || !Object.op_Implicit((Object)(object)body) || seconds <= 0.01f) { return; } try { radius = Mathf.Clamp(radius, 0.3f, 12f); Color colour = Colour; Vector3 position = GatherPoint(body, forward, rise); int seed = Seed(position); int segments = 32; TodoFxPart flare = Flare("TodoGatherFlare", position, colour, radius * 0.5f, 70f, seconds); TodoFxPart ring = Part("TodoGatherRing", position, Quaternion.identity, colour, (JujutsuFxLayer)1, null, seconds); TodoFxPart haze = Part("TodoGatherHaze", position, Quaternion.identity, colour, (JujutsuFxLayer)2, null, seconds); Action action = delegate(float t) { //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_0026: 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_004a: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0155: 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) if (Object.op_Implicit((Object)(object)body)) { Vector3 position2 = GatherPoint(body, forward, rise); Quaternion rotation = Quaternion.FromToRotation(Vector3.up, Axis(body.transform.forward, Vector3.forward)); float num = JujutsuEase.InCubic(t); float reach = radius * Mathf.Lerp(2.1f, 0.3f, num); float num2 = radius * Mathf.Lerp(0.1f, 0.34f, num); float num3 = JujutsuEase.InQuad(t); ring?.Place(position2); ring?.Aim(rotation); haze?.Place(position2); haze?.Aim(rotation); Ring(ring, reach, num2, segments, seed, num3); Ring(haze, reach, num2 * 2.4f, segments, seed + 13, num3 * 0.7f); flare?.Place(position2); flare?.Envelope(0.15f + 0.85f * num); flare?.Scale(Vector3.one * Mathf.Max(0.001f, radius * Mathf.Lerp(0.2f, 0.62f, num))); } }; action(0f); JujutsuFxSequence.Run(seconds).While(action); } catch (Exception exception) { Fail(exception); } } private static Vector3 GatherPoint(CharacterBody body, float forward, float rise) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) return JujutsuFxScale.Core(body) + Axis(body.transform.forward, Vector3.forward) * forward + Vector3.up * rise; } internal static void Seal(Vector3 foot, bool set) { //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) SealAt(foot + Vector3.up * 1f, set); } internal static void SealAt(Vector3 centre, bool set) { //IL_0034: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (Resting()) { return; } try { Color val = (set ? Colour : Color.Lerp(Colour, Color.black, 0.35f)); float radius = 1.9f; float num = (set ? 0.42f : 0.3f); int seed = Seed(centre); TodoFxPart ring = Part("TodoMarkSeal", centre, Quaternion.identity, val, (JujutsuFxLayer)((!set) ? 2 : 0), null, num); TodoFxPart skirt = Part("TodoMarkSealHaze", centre, Quaternion.identity, val, (JujutsuFxLayer)2, null, num); TodoFxPart spot = (set ? Flare("TodoMarkSealFlare", centre, val, 0.9f, 90f, num) : null); Action action = delegate(float t) { //IL_00d2: 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) float num2 = (set ? (radius * Mathf.Lerp(1.6f, 0.42f, JujutsuEase.OutExpo(t))) : (radius * Mathf.Lerp(0.5f, 1.5f, JujutsuEase.OutQuint(t)))); float num3 = (set ? JujutsuEase.Snap(t, 0.42f) : (1f - JujutsuEase.OutQuint(t))); Ring(ring, num2, radius * 0.12f, 30, seed, num3); Ring(skirt, num2 * 1.05f, radius * 0.34f, 30, seed + 5, num3 * 0.6f); spot?.Envelope(num3); spot?.Scale(Vector3.one * Mathf.Max(0.02f, 0.9f * Mathf.Lerp(0.35f, 1f, JujutsuEase.OutBack(t, 0.4f)))); }; action(0f); JujutsuFxSequence.Run(num).While(action); if (set) { JujutsuMotes.Burst(centre, Vector3.up, val, radius, (JujutsuMoteKind)2, 9); } } catch (Exception exception) { Fail(exception); } } internal static void Catch(Vector3 at, Vector3 heading, CharacterBody catcher) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (Resting()) { return; } try { float num = Reach(catcher, 2.2f); JujutsuImpact.Strike(at, heading, Colour, num, 0.4f, true); JujutsuMotes.Burst(at, heading, Colour, num, (JujutsuMoteKind)0, 14); JujutsuFxHitStop.Hold(catcher, 0.05f, false); } catch (Exception exception) { Fail(exception); } } internal static void GroundWave(Vector3 at, Color colour, float radius, float life) { //IL_0061: 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_00b5: 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_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_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_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_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_011e: Unknown result type (might be due to invalid IL or missing references) if (Resting()) { return; } try { radius = Mathf.Clamp(radius, 0.6f, 40f); life = Mathf.Clamp(life, 0.1f, 3f); int num = Mathf.Clamp(Mathf.RoundToInt(radius * 1.5f) + 8, 12, 28); JujutsuGroundField field = JujutsuGroundField.Sample(at, radius, num, 3); bool floor = field.HasFloor; int seed = Seed(at); int segments = Mathf.Clamp(Mathf.RoundToInt(radius * 3f) + 26, 26, 84); Vector3 centre = at + Vector3.up * 0.05f; TodoFxPart core = Part("TodoWaveCore", centre, Quaternion.identity, colour, (JujutsuFxLayer)0, null, life); TodoFxPart band = Part("TodoWaveBody", centre, Quaternion.identity, colour, (JujutsuFxLayer)1, null, life); TodoFxPart skirt = Part("TodoWaveHaze", centre, Quaternion.identity, colour, (JujutsuFxLayer)2, null, life); Action action = delegate(float t) { float num2 = JujutsuEase.OutExpo(t); float num3 = Mathf.Max(0.12f, radius * num2); float num4 = radius * Mathf.Lerp(0.3f, 0.05f, JujutsuEase.OutCubic(t)); float num5 = JujutsuEase.Snap(t, 0.1f); GroundRing(core, field, floor, centre.y, num3, num4 * 0.35f, segments, seed, num5); GroundRing(band, field, floor, centre.y, num3, num4, segments, seed + 3, num5 * 0.95f); GroundRing(skirt, field, floor, centre.y, num3 * 1.04f, num4 * 2.3f, segments, seed + 9, num5 * 0.7f); }; action(0f); JujutsuFxSequence.Run(life).While(action); } catch (Exception exception) { Fail(exception); } } private static void GroundRing(TodoFxPart part, JujutsuGroundField field, bool floor, float baseHeight, float reach, float width, int segments, int ringSeed, float alpha) { //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) if (part != null && part.Alive && Object.op_Implicit((Object)(object)part.Mesh)) { liftField = (floor ? field : null); liftBase = baseHeight; liftClearance = 0.09f; liftReach = reach; JujutsuFxMesh.Ring(part.Mesh, Mathf.Max(0.01f, reach - width), Mathf.Max(0.02f, reach + width * 0.35f), RingInner, RingMiddle, RingOuter, segments, 0.42f, ringSeed, floor ? LiftOf : null); liftField = null; part.Envelope(alpha); } } internal static TodoFxPart FloorRing(Vector3 at, Color colour, float radius, float life) { //IL_002a: 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_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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) if (Resting() || life <= 0.05f) { return null; } try { radius = Mathf.Clamp(radius, 0.4f, 12f); JujutsuGroundField val = JujutsuGroundField.Sample(at, radius * 1.2f, 12, 2); if (!val.HasFloor) { return null; } int num = Seed(at); TodoFxPart ring = Part("TodoStoneFloorRing", at, Quaternion.identity, colour, (JujutsuFxLayer)1, null, life); if (ring == null) { return null; } TodoFxPart glow = Part("TodoStoneFloorHaze", at, Quaternion.identity, colour, (JujutsuFxLayer)2, null, life); if (glow != null && glow.Alive && ring.Alive) { glow.Item.transform.SetParent(ring.Item.transform, true); } liftField = val; liftBase = at.y; liftClearance = 0.07f; liftReach = radius; BuildFloorRing(ring, radius, 0.16f, num); liftReach = radius * 1.12f; BuildFloorRing(glow, radius * 1.12f, 0.4f, num + 17); liftField = null; Action action = delegate(float t) { float num2 = JujutsuEase.FlickerScaled(Time.time, 0.7f, 2.6f) * (1f - JujutsuEase.InQuad(JujutsuEase.Window(t, 0.82f, 1f))); ring.Envelope(num2); glow?.Envelope(num2 * 0.8f); }; action(0f); JujutsuFxSequence.Run(life).While(action); return ring; } catch (Exception exception) { Fail(exception); return null; } } private static void BuildFloorRing(TodoFxPart part, float radius, float band, int seed) { //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_0037: Unknown result type (might be due to invalid IL or missing references) if (part != null && Object.op_Implicit((Object)(object)part.Mesh)) { JujutsuFxMesh.Ring(part.Mesh, Mathf.Max(0.02f, radius - band), radius + band * 0.35f, RingInner, RingMiddle, RingOuter, 40, 0.45f, seed, LiftOf); } } internal static void Ping(Vector3 at, Color colour, float radius, float life) { //IL_0017: 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) if (Resting()) { return; } try { int seed = Seed(at); TodoFxPart ring = Part("TodoStonePing", at, Quaternion.identity, colour, (JujutsuFxLayer)1, null, life); if (ring != null) { Action action = delegate(float t) { float num = JujutsuEase.OutQuint(t); float reach = Mathf.Max(0.15f, radius * num); Ring(ring, reach, Mathf.Max(0.04f, radius * 0.1f * (1f - num * 0.7f)), 28, seed, (1f - JujutsuEase.OutCubic(t)) * JujutsuEase.OutQuint(Mathf.Clamp01(t * 6f))); }; action(0f); JujutsuFxSequence.Run(life).While(action); } } catch (Exception exception) { Fail(exception); } } internal static TodoFxPart Part(string name, Vector3 position, Quaternion rotation, Color colour, JujutsuFxLayer layer, Texture2D texture, float life) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (JujutsuFxBudget.Available((Kind)3, 1) < 1) { return null; } Mesh val2 = default(Mesh); MeshRenderer val3 = default(MeshRenderer); GameObject val = JujutsuFxMesh.Object(name, ref val2, ref val3); val.transform.SetPositionAndRotation(position, rotation); Material val4 = (((Renderer)val3).sharedMaterial = JujutsuFxMaterials.CreateLayerMaterial("mat" + name, colour, layer, texture)); JujutsuFxMaterials.Claim(val, val4); val.AddComponent().Own(val2); if (life > 0f) { Object.Destroy((Object)(object)val, life); } JujutsuFxBudget.Register(val, (Kind)3); return new TodoFxPart(val, val2, val4, Tinted(colour, layer), JujutsuFxMaterials.GlowFor(layer)); } internal static TodoFxPart Flare(string name, Vector3 position, Color colour, float size, float spin, float life) { //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_0061: Unknown result type (might be due to invalid IL or missing references) if (JujutsuFxBudget.Available((Kind)3, 1) < 1) { return null; } GameObject val = JujutsuPrimitives.Flare(name, position, colour, Mathf.Max(0.02f, size), spin); if (!Object.op_Implicit((Object)(object)val)) { return null; } MeshRenderer component = val.GetComponent(); Material material = (Object.op_Implicit((Object)(object)component) ? ((Renderer)component).sharedMaterial : null); if (life > 0f) { Object.Destroy((Object)(object)val, life); } JujutsuFxBudget.Register(val, (Kind)3); return new TodoFxPart(val, null, material, colour, 4.4f); } private static void Ring(TodoFxPart part, float reach, float band, int segments, int seed, float alpha) { //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_0049: Unknown result type (might be due to invalid IL or missing references) if (part != null && part.Alive && Object.op_Implicit((Object)(object)part.Mesh)) { JujutsuFxMesh.Ring(part.Mesh, Mathf.Max(0.01f, reach - band), Mathf.Max(0.02f, reach + band * 0.35f), RingInner, RingMiddle, RingOuter, segments, 0.42f, seed, (Func)null); part.Envelope(alpha); } } private static void Plate(TodoFxPart part, int segments, int seed) { //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) if (part != null && Object.op_Implicit((Object)(object)part.Mesh)) { JujutsuFxMesh.Cone(part.Mesh, 1f, 1f, PlateCore, PlateRim, Mathf.Clamp(segments / 2, 10, 32), 0.3f, seed); } } private static bool Claim(Vector3 at) { //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_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_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) float time = Time.time; for (int i = 0; i < recentAt.Length; i++) { if (recentWhen[i] > 0f && time - recentWhen[i] < 0.2f) { Vector3 val = recentAt[i] - at; if (((Vector3)(ref val)).sqrMagnitude < 0.25f) { return false; } } } recentAt[recentNext] = at; recentWhen[recentNext] = time; recentNext = (recentNext + 1) % recentAt.Length; return true; } private static Vector3 Axis(Vector3 direction, Vector3 fallback) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) float sqrMagnitude = ((Vector3)(ref direction)).sqrMagnitude; if (!(sqrMagnitude > 1E-06f) || !(sqrMagnitude < 1E+12f)) { return fallback; } return ((Vector3)(ref direction)).normalized; } private static Vector3 Steady(Vector3 aim) { //IL_0000: 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_0012: Unknown result type (might be due to invalid IL or missing references) if (!(Mathf.Abs(aim.y) > 0.985f)) { return Vector3.up; } return Vector3.forward; } private static int Seed(Vector3 position) { //IL_0000: 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_002f: Unknown result type (might be due to invalid IL or missing references) return (Mathf.RoundToInt(position.x * 100f) * 73856093) ^ (Mathf.RoundToInt(position.y * 100f) * 19349663) ^ (Mathf.RoundToInt(position.z * 100f) * 83492791); } private static bool Resting() { return Time.time < restingUntil; } private static void Fail(Exception exception) { restingUntil = Time.time + 20f; if (!failureLogged) { failureLogged = true; ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("Todo's effects failed and are resting for " + $"{20f} seconds at a time; gameplay is unaffected: " + exception)); } } } } internal sealed class TodoRhythm : MonoBehaviour { internal const int MaximumStacks = 6; internal const float AttackSpeedPerStack = 0.12f; internal const float ArmourPerStack = 8f; internal const float DecaySeconds = 1.4f; internal const int HealFromStack = 3; internal const float HealPerHit = 0.015f; private static int active; private static bool hooked; private CharacterBody body; private int stacks; private float decayStopwatch; private int lastReported = -1; private TodoBeatVisual beat; private int nextComboStep; private float lastComboStepAt; internal const float ComboResetSeconds = 1.2f; internal int Stacks => stacks; internal float Charge => Mathf.Clamp01(decayStopwatch / 1.4f); internal static int ComboSteps => TodoConsecutiveState.Steps; private bool Simulates { get { if (!Util.HasEffectiveAuthority(((Component)this).gameObject)) { return NetworkServer.active; } return true; } } internal int ConsumeComboStep() { if (Time.time - lastComboStepAt > 1.2f) { nextComboStep = 0; } int result = nextComboStep; nextComboStep = (nextComboStep + 1) % ComboSteps; lastComboStepAt = Time.time; return result; } internal static void Initialize() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown if (!hooked) { hooked = true; CharacterBody.RecalculateStats += new hook_RecalculateStats(AddRhythm); } } private void Awake() { body = ((Component)this).GetComponent(); } private void OnEnable() { active++; } private void OnDisable() { active--; stacks = 0; Dismiss(); } private void FixedUpdate() { if (stacks > 0 && Simulates) { decayStopwatch += Time.fixedDeltaTime; if (!(decayStopwatch < 1.4f)) { decayStopwatch -= 1.4f; Set(stacks - 1); } } } internal void LandedHit() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (Simulates) { if (!NetworkServer.active) { TodoStoneSync.ReportRhythm(body, clapped: false); } decayStopwatch = 0f; bool num = stacks >= 3; Set(stacks + 1); if (num && NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent)) { body.healthComponent.HealFraction(0.015f, default(ProcChainMask)); } } } internal void Clapped() { if (Simulates) { if (!NetworkServer.active) { TodoStoneSync.ReportRhythm(body, clapped: true); } decayStopwatch = 0f; Set(6); } } private void Set(int value) { int num = Mathf.Clamp(value, 0, 6); if (num != stacks) { int before = stacks; stacks = num; Show(before); if (Object.op_Implicit((Object)(object)body)) { body.MarkAllStatsDirty(); } if (stacks != lastReported && (stacks == 6 || stacks == 0)) { lastReported = stacks; Plugin.Log.LogInfo((object)((stacks == 6) ? ($"Todo rhythm: full beat, +{0.71999997f:P0} " + $"attack speed and +{48f:0} armour.") : "Todo rhythm: beat lost.")); } } } private static void AddRhythm(orig_RecalculateStats original, CharacterBody self) { original.Invoke(self); if (active > 0 && Object.op_Implicit((Object)(object)self)) { TodoRhythm component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.stacks > 0) { self.attackSpeed += (float)component.stacks * 0.12f; self.armor += (float)component.stacks * 8f; } } } internal static void ReportHit(CharacterBody owner) { TodoRhythm todoRhythm = (Object.op_Implicit((Object)(object)owner) ? ((Component)owner).GetComponent() : null); if (Object.op_Implicit((Object)(object)todoRhythm)) { todoRhythm.LandedHit(); } } private void Show(int before) { if (stacks <= 0) { Dismiss(); return; } if (!Object.op_Implicit((Object)(object)beat)) { beat = TodoBeatVisual.Attach(this, body); } if (Object.op_Implicit((Object)(object)beat)) { beat.Step(before, stacks); } } private void Dismiss() { if (Object.op_Implicit((Object)(object)beat)) { beat.Leave(); beat = null; } } } internal sealed class TodoBeatVisual : MonoBehaviour { private const float SpinDegrees = 72f; private const float LeaveSeconds = 0.4f; private static readonly Color Warm = new Color(1f, 0.66f, 0.36f, 1f); private static bool disabled; private readonly TodoFxPart[] motes = new TodoFxPart[6]; private TodoRhythm rhythm; private CharacterBody body; private TodoFxPart band; private TodoFxPart skirt; private int seed; private int shown; private float roll; private float leaving = -1f; private bool healing; private bool broken; internal static TodoBeatVisual Attach(TodoRhythm owner, CharacterBody who) { //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_002a: Unknown result type (might be due to invalid IL or missing references) if (disabled || !Object.op_Implicit((Object)(object)owner) || !Object.op_Implicit((Object)(object)who)) { return null; } GameObject val = new GameObject("TodoBeat"); val.transform.position = who.footPosition; TodoBeatVisual todoBeatVisual = val.AddComponent(); todoBeatVisual.rhythm = owner; todoBeatVisual.body = who; todoBeatVisual.seed = ((Object)who).GetInstanceID(); try { todoBeatVisual.Build(); return todoBeatVisual; } catch (Exception exception) { todoBeatVisual.Break(exception); return null; } } private void Build() { //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_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_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_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) Color colour = TodoFx.Colour; for (int i = 0; i < motes.Length; i++) { motes[i] = TodoFx.Flare("TodoBeatMote", ((Component)this).transform.position, colour, 0.3f, ((i % 2 == 0) ? 1f : (-1f)) * (55f + (float)i * 9f), 0f); TodoFxPart obj = motes[i]; if (obj != null) { obj.Item.SetActive(false); } } band = TodoFx.Part("TodoBeatBand", ((Component)this).transform.position, Quaternion.identity, colour, (JujutsuFxLayer)1, null, 0f); skirt = TodoFx.Part("TodoBeatSkirt", ((Component)this).transform.position, Quaternion.identity, colour, (JujutsuFxLayer)2, null, 0f); } internal void Step(int before, int now) { //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_0037: 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_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_006c: 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_008b: 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_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_00b6: Unknown result type (might be due to invalid IL or missing references) if (broken || now <= before || !Object.op_Implicit((Object)(object)body)) { return; } try { float num = JujutsuFxScale.BodyRadius(body); Vector3 val = Hip(num); bool flag = now >= 6; TodoFx.Ping(val, Hue(now), num * (flag ? 3.4f : 2.1f), flag ? 0.55f : 0.34f); JujutsuMotes.Burst(val, Vector3.up, Hue(now), num, (JujutsuMoteKind)2, flag ? 18 : 7); if (flag) { JujutsuFxLights.Borrow(val, Color.Lerp(Warm, Color.white, 0.4f), 6f, num * 5f, 0.14f); JujutsuMotes.Burst(val, Vector3.up, Warm, num, (JujutsuMoteKind)0, 12); } } catch (Exception exception) { Break(exception); } } internal void Leave() { if (leaving < 0f) { leaving = 0f; } } private void LateUpdate() { if (broken) { return; } if (!Object.op_Implicit((Object)(object)body)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } try { Draw(); } catch (Exception exception) { Break(exception); } } private void Draw() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_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_01ee: 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) float num = 1f; if (leaving >= 0f) { leaving += Time.deltaTime; num = 1f - JujutsuEase.OutCubic(Mathf.Clamp01(leaving / 0.4f)); if (num <= 0.001f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } } else { shown = (Object.op_Implicit((Object)(object)rhythm) ? rhythm.Stacks : 0); } float num2 = JujutsuFxScale.BodyRadius(body); Vector3 val = Hip(num2); ((Component)this).transform.position = val; roll += 72f * Time.deltaTime; float num3 = (Object.op_Implicit((Object)(object)rhythm) ? rhythm.Charge : 1f); float num4 = Mathf.Lerp(1f, 0.28f, JujutsuEase.OutCubic(num3)) * JujutsuEase.FlickerScaled(Time.time, 0.82f, 6.5f) * num; bool flag = shown >= 3; if (flag != healing) { healing = flag; Recolour(); } float num5 = num2 * (1.15f + 0.05f * (float)shown); for (int i = 0; i < motes.Length; i++) { TodoFxPart todoFxPart = motes[i]; if (todoFxPart != null && todoFxPart.Alive) { bool flag2 = i < shown; if (todoFxPart.Item.activeSelf != flag2) { todoFxPart.Item.SetActive(flag2); } if (flag2) { float num6 = (roll + (float)i * 60f) * (MathF.PI / 180f); float num7 = Mathf.Sin(num6 * 2f + (float)i) * num2 * 0.12f; todoFxPart.Place(val + new Vector3(Mathf.Cos(num6) * num5, num7, Mathf.Sin(num6) * num5)); todoFxPart.Scale(Vector3.one * (num2 * 0.28f * Mathf.Lerp(0.72f, 1.1f, num4))); todoFxPart.Envelope(num4); } } } Band(band, num5, num2 * 0.1f, num4 * 0.85f, seed); Band(skirt, num5 * 1.06f, num2 * 0.3f, num4 * 0.55f, seed + 19); } private void Band(TodoFxPart part, float orbit, float width, float alpha, int ringSeed) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (part != null && part.Alive && Object.op_Implicit((Object)(object)part.Mesh)) { bool flag = shown > 0; if (part.Item.activeSelf != flag) { part.Item.SetActive(flag); } if (flag) { part.Place(((Component)this).transform.position); JujutsuFxMesh.Ring(part.Mesh, Mathf.Max(0.02f, orbit - width), orbit + width * 0.4f, new Color(1f, 1f, 1f, 0.08f), Color.white, new Color(1f, 1f, 1f, 0f), 36, 0.5f, ringSeed, (Func)null); part.Envelope(alpha); } } } private void Recolour() { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Color val = Hue(shown); for (int i = 0; i < motes.Length; i++) { motes[i]?.Retint(val, 4.4f); } band?.Retint(TodoFx.Tinted(val, (JujutsuFxLayer)1), 1.6f); skirt?.Retint(TodoFx.Tinted(val, (JujutsuFxLayer)2), 0.55f); } private Color Hue(int count) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (count < 3) { return TodoFx.Colour; } return Color.Lerp(TodoFx.Colour, Warm, 0.62f); } private Vector3 Hip(float radius) { //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_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) return body.footPosition + Vector3.up * (radius * 1.05f); } private void Break(Exception exception) { broken = true; if (!disabled) { disabled = true; ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("Todo's beat could not be drawn and has been switched off; the beat itself is unaffected and every number it " + $"grants is still being applied: {exception}")); } } Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnDestroy() { for (int i = 0; i < motes.Length; i++) { if (motes[i] != null && motes[i].Alive) { Object.Destroy((Object)(object)motes[i].Item); } } if (band != null && band.Alive) { Object.Destroy((Object)(object)band.Item); } if (skirt != null && skirt.Alive) { Object.Destroy((Object)(object)skirt.Item); } } } internal static class TodoStoneSync { private const float FriendLineInterval = 6f; private static float lastFriendLineAt = -1000f; private static int reported; private static int landings; internal static void Initialize() { NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); } internal static void Befriend(Vector3 at) { //IL_001d: 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 (!(Time.time - lastFriendLineAt < 6f)) { lastFriendLineAt = Time.time; TodoAssets.PlayBestFriend(at); if (NetworkServer.active) { JujutsuDiagnostics.Sent("todo-friend"); NetMessageExtensions.Send((INetMessage)(object)new TodoFriendMessage(at), (NetworkDestination)1); } } } internal static void ReportRhythm(CharacterBody owner, bool clapped) { //IL_0026: 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.networkIdentity)) { JujutsuDiagnostics.Sent("todo-rhythm"); NetMessageExtensions.Send((INetMessage)(object)new TodoRhythmMessage(owner.networkIdentity.netId, clapped), (NetworkDestination)2); } } internal static void RequestClap(CharacterBody owner, CharacterBody nearBody, bool nearIsStone, CharacterBody farBody, bool farIsStone, Vector3 stoneAt, bool stoneKnown, bool lands) { //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_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) if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)owner.networkIdentity)) { NetMessageExtensions.Send((INetMessage)(object)new TodoClapMessage(owner.networkIdentity.netId, Identify(nearBody), nearIsStone, Identify(farBody), farIsStone, stoneAt, stoneKnown, lands), (NetworkDestination)2); JujutsuDiagnostics.Sent("todo-clap"); } } internal static void Order(CharacterBody target, Vector3 destination, bool report = true) { //IL_0026: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)target)) { return; } if (Util.HasEffectiveAuthority(((Component)target).gameObject)) { if (report) { Report(target, destination, "applied here"); } Apply(target, destination); } else if (Object.op_Implicit((Object)(object)target.networkIdentity)) { if (report) { Report(target, destination, "sent to its owner"); } TodoMoveMessage todoMoveMessage = new TodoMoveMessage(target.networkIdentity.netId, destination, isStone: false, NetworkServer.active); JujutsuDiagnostics.Sent("todo-move"); NetMessageExtensions.Send((INetMessage)(object)todoMoveMessage, (NetworkDestination)(NetworkServer.active ? 1 : 2)); } } internal static void OrderStone(CharacterBody owner, Vector3 destination) { //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) if (Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)owner.networkIdentity)) { TodoMoveMessage todoMoveMessage = new TodoMoveMessage(owner.networkIdentity.netId, destination, isStone: true, NetworkServer.active); JujutsuDiagnostics.Sent("todo-move"); NetMessageExtensions.Send((INetMessage)(object)todoMoveMessage, (NetworkDestination)(NetworkServer.active ? 1 : 2)); } } private static void Report(CharacterBody target, Vector3 destination, string what) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (reported < 12) { reported++; Plugin.Log.LogInfo((object)("Clap: " + target.GetDisplayName() + " -> " + $"{destination:F1}, {what}. It moves " + $"{Vector3.Distance(target.footPosition, destination):F1} m; " + $"server={NetworkServer.active}, " + $"authorityHere={Util.HasEffectiveAuthority(((Component)target).gameObject)}.")); } } internal static void Apply(CharacterBody target, Vector3 destination) { //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)target)) { Vector3 footPosition = target.footPosition; if (Object.op_Implicit((Object)(object)target.characterMotor) && Object.op_Implicit((Object)(object)((BaseCharacterController)target.characterMotor).Motor)) { ((BaseCharacterController)target.characterMotor).Motor.SetPosition(destination, true); } else { target.transform.position = destination; } Landed(target, destination); Announce(target, footPosition, destination); } } private static void Landed(CharacterBody target, Vector3 foot) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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_004b: 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_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_00eb: Unknown result type (might be due to invalid IL or missing references) if (landings < 12 && Object.op_Implicit((Object)(object)target)) { landings++; float num = ((target.radius > 0.1f) ? target.radius : 0.5f); Vector3 val = foot + Vector3.up * num; RaycastHit val2 = default(RaycastHit); string text = (Physics.Raycast(val, Vector3.down, ref val2, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? $"{((RaycastHit)(ref val2)).distance - num:F1} m above the surface under it" : "nothing solid within 200 m below it"); RaycastHit val3 = default(RaycastHit); string text2 = (Physics.Raycast(val, Vector3.up, ref val3, 3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) ? ($", with something solid {((RaycastHit)(ref val3)).distance + num:F1} m over " + "its head") : ", nothing over its head"); Plugin.Log.LogInfo((object)($"Clap landing: {target.GetDisplayName()} at {foot:F1} — " + text + text2 + ".")); } } internal static void Announce(CharacterBody target, Vector3 was, Vector3 destination) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)target)) { Vector3 val = was - destination; if (!(((Vector3)(ref val)).sqrMagnitude < 0.04f)) { bool forLocalPlayer = TodoFx.IsLocalPlayer(target); float radius = TodoFx.Reach(target, 5.1000004f); TodoFx.Portal(was, destination, arriving: false, radius, forLocalPlayer); TodoFx.Portal(destination, was, arriving: true, radius, forLocalPlayer); } } } internal static NetworkInstanceId Identify(CharacterBody body) { //IL_0015: 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) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.networkIdentity)) { return NetworkInstanceId.Invalid; } return body.networkIdentity.netId; } internal static CharacterBody Resolve(NetworkInstanceId id) { //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_000f: Unknown result type (might be due to invalid IL or missing references) if (id == NetworkInstanceId.Invalid) { return null; } GameObject val = Util.FindNetworkObject(id); if (!Object.op_Implicit((Object)(object)val)) { return null; } return val.GetComponent(); } internal static void Broadcast(CharacterBody thrower, Vector3 origin, Vector3 destination) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)thrower) && Object.op_Implicit((Object)(object)thrower.networkIdentity)) { TodoStoneMessage todoStoneMessage = new TodoStoneMessage(thrower.networkIdentity.netId, origin, destination, NetworkServer.active); JujutsuDiagnostics.Sent("todo-stone"); JujutsuDiagnostics.Sent("todo-move"); NetMessageExtensions.Send((INetMessage)(object)todoStoneMessage, (NetworkDestination)(NetworkServer.active ? 1 : 2)); } } internal static void Receive(NetworkInstanceId owner, Vector3 origin, Vector3 destination) { //IL_0000: 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_0032: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(owner); CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); if (Object.op_Implicit((Object)(object)val2) && !Util.HasEffectiveAuthority(((Component)val2).gameObject)) { GameObject built = TodoBoogieWoogie.Build(val2, origin, destination); ((Component)val2).GetComponent()?.AdoptStone(built); } } } public sealed class TodoRhythmMessage : INetMessage, ISerializableObject { private NetworkInstanceId owner; private bool clapped; public TodoRhythmMessage() { } public TodoRhythmMessage(NetworkInstanceId owner, bool clapped) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) this.owner = owner; this.clapped = clapped; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(owner); writer.Write(clapped); } public void Deserialize(NetworkReader reader) { //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) owner = reader.ReadNetworkId(); clapped = reader.ReadBoolean(); } public void OnReceived() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) JujutsuDiagnostics.Sent("todo-rhythm RECEIVED"); if (!NetworkServer.active) { return; } CharacterBody val = TodoStoneSync.Resolve(owner); TodoRhythm todoRhythm = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (Object.op_Implicit((Object)(object)todoRhythm)) { if (clapped) { todoRhythm.Clapped(); } else { todoRhythm.LandedHit(); } } } } public sealed class TodoClapMessage : INetMessage, ISerializableObject { private NetworkInstanceId owner; private NetworkInstanceId near; private bool nearIsStone; private NetworkInstanceId far; private bool farIsStone; private Vector3 stoneAt; private bool stoneKnown; private bool lands; public TodoClapMessage() { } public TodoClapMessage(NetworkInstanceId owner, NetworkInstanceId near, bool nearIsStone, NetworkInstanceId far, bool farIsStone, Vector3 stoneAt, bool stoneKnown, bool lands) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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) this.owner = owner; this.near = near; this.nearIsStone = nearIsStone; this.far = far; this.farIsStone = farIsStone; this.stoneAt = stoneAt; this.stoneKnown = stoneKnown; this.lands = lands; } public void Serialize(NetworkWriter writer) { //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) //IL_0026: 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) writer.Write(owner); writer.Write(near); writer.Write(nearIsStone); writer.Write(far); writer.Write(farIsStone); writer.Write(stoneAt); writer.Write(stoneKnown); writer.Write(lands); } public void Deserialize(NetworkReader reader) { //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) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) owner = reader.ReadNetworkId(); near = reader.ReadNetworkId(); nearIsStone = reader.ReadBoolean(); far = reader.ReadNetworkId(); farIsStone = reader.ReadBoolean(); stoneAt = reader.ReadVector3(); stoneKnown = reader.ReadBoolean(); lands = reader.ReadBoolean(); } public void OnReceived() { //IL_0013: 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_0046: 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) JujutsuDiagnostics.Sent("todo-clap RECEIVED"); if (NetworkServer.active) { CharacterBody val = TodoStoneSync.Resolve(owner); (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null)?.PerformForClient(TodoStoneSync.Resolve(near), nearIsStone, TodoStoneSync.Resolve(far), farIsStone, stoneAt, stoneKnown, lands); } } } public sealed class TodoMoveMessage : INetMessage, ISerializableObject { private NetworkInstanceId target; private Vector3 destination; private bool isStone; private bool relayed; public TodoMoveMessage() { } public TodoMoveMessage(NetworkInstanceId target, Vector3 destination, bool isStone, bool relayed = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) this.target = target; this.destination = destination; this.isStone = isStone; this.relayed = relayed; } public void Serialize(NetworkWriter writer) { //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) writer.Write(target); writer.Write(destination); writer.Write(isStone); writer.Write(relayed); } public void Deserialize(NetworkReader reader) { //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) target = reader.ReadNetworkId(); destination = reader.ReadVector3(); isStone = reader.ReadBoolean(); relayed = reader.ReadBoolean(); } public void OnReceived() { //IL_000b: 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_0082: 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_004e: 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) JujutsuDiagnostics.Sent("todo-move RECEIVED"); CharacterBody val = TodoStoneSync.Resolve(target); if (Object.op_Implicit((Object)(object)val)) { if (isStone) { ((Component)val).GetComponent()?.MoveStone(destination); } else if (Util.HasEffectiveAuthority(((Component)val).gameObject)) { TodoStoneSync.Apply(val, destination); } else { TodoStoneSync.Announce(val, val.footPosition, destination); } } if (NetworkServer.active && !relayed) { NetMessageExtensions.Send((INetMessage)(object)new TodoMoveMessage(target, destination, isStone, relayed: true), (NetworkDestination)1); } } } public sealed class TodoStoneMessage : INetMessage, ISerializableObject { private NetworkInstanceId owner; private Vector3 origin; private Vector3 destination; private bool relayed; public TodoStoneMessage() { } public TodoStoneMessage(NetworkInstanceId owner, Vector3 origin, Vector3 destination, bool relayed = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) this.owner = owner; this.origin = origin; this.destination = destination; this.relayed = relayed; } public void Serialize(NetworkWriter writer) { //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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) writer.Write(owner); writer.Write(origin); writer.Write(destination); writer.Write(relayed); } public void Deserialize(NetworkReader reader) { //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) //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) owner = reader.ReadNetworkId(); origin = reader.ReadVector3(); destination = reader.ReadVector3(); relayed = reader.ReadBoolean(); } public void OnReceived() { //IL_000b: 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_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_003d: Unknown result type (might be due to invalid IL or missing references) JujutsuDiagnostics.Sent("todo-stone RECEIVED"); TodoStoneSync.Receive(owner, origin, destination); if (NetworkServer.active && !relayed) { NetMessageExtensions.Send((INetMessage)(object)new TodoStoneMessage(owner, origin, destination, relayed: true), (NetworkDestination)1); } } } public sealed class TodoFriendMessage : INetMessage, ISerializableObject { private Vector3 at; public TodoFriendMessage() { } public TodoFriendMessage(Vector3 at) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) this.at = at; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(at); } public void Deserialize(NetworkReader reader) { //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) at = reader.ReadVector3(); } public void OnReceived() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) JujutsuDiagnostics.Sent("todo-friend RECEIVED"); if (!NetworkServer.active) { TodoAssets.PlayBestFriend(at); } } } internal sealed class TodoTargetHud : MonoBehaviour { private const float IconSize = 34f; private const float DropBelowCrosshair = -34f; private static bool hooked; private static bool reportedAnchor; private HUD hud; private CanvasGroup group; private Image portrait; private TextMeshProUGUI label; private static readonly Dictionary portraitCache = new Dictionary(); internal static void Initialize() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown if (!hooked) { hooked = true; HUD.Awake += new hook_Awake(Attach); } } private static void Attach(orig_Awake original, HUD self) { original.Invoke(self); if (!Object.op_Implicit((Object)(object)self)) { return; } try { Build(self); } catch (Exception ex) { Plugin.Log.LogError((object)("Todo's mark readout could not be built: " + ex)); } } private static void Build(HUD hud) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_0097: 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_00c1: 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_00eb: 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: Expected O, but got Unknown //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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_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) Transform val = (Object.op_Implicit((Object)(object)hud.mainContainer) ? hud.mainContainer.transform : ((Component)hud).transform); if (!reportedAnchor) { reportedAnchor = true; Plugin.Log.LogInfo((object)("Todo's mark readout anchored to the HUD centre at " + ((Object)val).name + ".")); } GameObject val2 = new GameObject("JujutsuTodoMark", new Type[2] { typeof(RectTransform), typeof(CanvasGroup) }); RectTransform val3 = (RectTransform)val2.transform; ((Transform)val3).SetParent(val, false); val3.anchorMin = new Vector2(0.5f, 0.5f); val3.anchorMax = new Vector2(0.5f, 0.5f); val3.pivot = new Vector2(0.5f, 1f); val3.sizeDelta = new Vector2(260f, 58f); val3.anchoredPosition = new Vector2(0f, -34f); TodoTargetHud todoTargetHud = val2.AddComponent(); todoTargetHud.hud = hud; todoTargetHud.group = val2.GetComponent(); todoTargetHud.group.blocksRaycasts = false; todoTargetHud.group.interactable = false; todoTargetHud.group.alpha = 0f; GameObject val4 = new GameObject("Portrait", new Type[1] { typeof(RectTransform) }); RectTransform val5 = (RectTransform)val4.transform; ((Transform)val5).SetParent((Transform)(object)val3, false); val5.anchorMin = new Vector2(0.5f, 1f); val5.anchorMax = new Vector2(0.5f, 1f); val5.pivot = new Vector2(0.5f, 1f); val5.sizeDelta = new Vector2(34f, 34f); val5.anchoredPosition = Vector2.zero; todoTargetHud.portrait = val4.AddComponent(); ((Graphic)todoTargetHud.portrait).raycastTarget = false; todoTargetHud.portrait.preserveAspect = true; todoTargetHud.label = JujutsuHudAnchor.Text(val3, "Name", 15f, TodoLanguage.Colour); ((TMP_Text)todoTargetHud.label).alignment = (TextAlignmentOptions)258; RectTransform rectTransform = ((TMP_Text)todoTargetHud.label).rectTransform; rectTransform.anchorMin = new Vector2(0f, 1f); rectTransform.anchorMax = new Vector2(1f, 1f); rectTransform.pivot = new Vector2(0.5f, 1f); rectTransform.sizeDelta = new Vector2(0f, 22f); rectTransform.anchoredPosition = new Vector2(0f, -36f); } private void Update() { GameObject val = (Object.op_Implicit((Object)(object)hud) ? hud.targetBodyObject : null); TodoBoogieWoogie todoBoogieWoogie = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); TodoBoogieWoogie.ClapTarget clapTarget = (Object.op_Implicit((Object)(object)todoBoogieWoogie) ? todoBoogieWoogie.Mark : default(TodoBoogieWoogie.ClapTarget)); bool flag = Object.op_Implicit((Object)(object)todoBoogieWoogie) && clapTarget.Exists; if (group.alpha != (flag ? 1f : 0f)) { group.alpha = (flag ? 1f : 0f); } if (flag) { Sprite val2 = PortraitOf(clapTarget); portrait.sprite = val2; ((Behaviour)portrait).enabled = Object.op_Implicit((Object)(object)val2); ((TMP_Text)label).text = todoBoogieWoogie.NameOf(clapTarget); } } private static Sprite PortraitOf(TodoBoogieWoogie.ClapTarget mark) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (mark.IsStone) { return TodoAssets.StoneIcon; } Texture obj = (Object.op_Implicit((Object)(object)mark.Body) ? mark.Body.portraitIcon : null); Texture2D val = (Texture2D)(object)((obj is Texture2D) ? obj : null); if (val == null) { return null; } if (portraitCache.TryGetValue((Texture)(object)val, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); portraitCache[(Texture)(object)val] = val2; return val2; } } internal sealed class TodoThrowPreview : MonoBehaviour { private const int Points = 26; private const float BodyWidth = 0.24f; private const float MarkRadius = 1.1f; private const float ChaseRate = 0.75f; private static readonly List path = new List(27); private static float ribbonWidth = 0.24f; private static float chasePhase; private static readonly Func WidthOf = (float t) => ribbonWidth * Mathf.Lerp(1f, 0.28f, JujutsuEase.OutCubic(Mathf.Clamp01(t))); private static readonly Func EdgeOf = (float t) => new Color(1f, 1f, 1f, 0f); private static readonly Func SpineOf = (float t) => new Color(1f, 1f, 1f, Chase(t)); private readonly TodoFxPart[] ribbons = new TodoFxPart[3]; private TodoFxPart mark; private TodoFxPart glow; private bool built; internal static TodoThrowPreview Attach(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body)) { return null; } TodoThrowPreview component = ((Component)body).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return ((Component)body).gameObject.AddComponent(); } return component; } internal void Aim(CharacterBody body, Ray aim, float reach = 70f) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { Hide(); return; } try { Build(); Trace(body, aim, reach); } catch (Exception arg) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("Todo's throw preview could not be drawn; the throw " + $"itself is unaffected: {arg}")); } Hide(); } } private void Trace(CharacterBody body, Ray aim, float reach) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: 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_0074: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) Vector3 val = TodoBoogieWoogie.ThrowOrigin(body); Vector3 destination = TodoBoogieWoogie.ThrowDestination(aim, reach); float seconds; Vector3 launch = TodoStoneFlight.Solve(val, destination, out seconds); path.Clear(); path.Add(val); Vector3 val2 = val; Vector3 normal = Vector3.up; bool flag = false; RaycastHit val4 = default(RaycastHit); for (int i = 0; i < 26; i++) { float num = (float)(i + 1) / 26f; Vector3 val3 = (flag ? val2 : TodoStoneFlight.Sample(val, launch, seconds * num)); if (!flag && Physics.Linecast(val2, val3, ref val4, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val3 = ((RaycastHit)(ref val4)).point; normal = ((RaycastHit)(ref val4)).normal; flag = true; } Vector3 val5 = val3 - val2; if (((Vector3)(ref val5)).sqrMagnitude > 1E-06f) { path.Add(val3); } val2 = val3; } if (path.Count < 2) { Hide(); return; } Face(val2, normal); Draw(); } private void Draw() { //IL_001b: 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_0020: 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) Camera main = Camera.main; Vector3 val = (Object.op_Implicit((Object)(object)main) ? ((Component)main).transform.forward : Vector3.up); chasePhase = Time.time * 0.75f; float[] array = new float[3] { 2.6f, 1f, 0.34f }; for (int i = 0; i < ribbons.Length; i++) { TodoFxPart todoFxPart = ribbons[i]; if (todoFxPart != null && todoFxPart.Alive && Object.op_Implicit((Object)(object)todoFxPart.Mesh)) { Wake(todoFxPart); ribbonWidth = 0.24f * array[i]; JujutsuFxMesh.Ribbon(todoFxPart.Mesh, (IList)path, val, WidthOf, EdgeOf, SpineOf); todoFxPart.Envelope((i == 1) ? 0.95f : 0.8f); } } } private void Face(Vector3 at, Vector3 normal) { //IL_0026: 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) //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_0048: 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_0098: 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) if (mark != null && mark.Alive) { Wake(mark); mark.Place(at + normal * 0.06f); mark.Aim(Quaternion.FromToRotation(Vector3.up, normal)); mark.Envelope(JujutsuEase.FlickerScaled(Time.time, 0.72f, 5f)); } if (glow != null && glow.Alive) { Wake(glow); glow.Place(at + normal * 0.25f); glow.Envelope(JujutsuEase.FlickerScaled(Time.time, 0.6f, 3.7f)); } } private static void Wake(TodoFxPart part) { if (part != null && part.Alive && !part.Item.activeSelf) { part.Item.SetActive(true); } } private static float Chase(float t) { float num = 0.5f + 0.5f * Mathf.Sin((Mathf.Clamp01(t) * 3f - chasePhase) * MathF.PI * 2f); return Mathf.Clamp01(0.42f + 0.58f * num * num * num); } internal void Hide() { if (built) { for (int i = 0; i < ribbons.Length; i++) { Sleep(ribbons[i]); } Sleep(mark); Sleep(glow); } } private static void Sleep(TodoFxPart part) { if (part != null && part.Alive && part.Item.activeSelf) { part.Item.SetActive(false); } } private void OnDisable() { Hide(); } private void Build() { //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_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_0077: 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_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_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_0135: Unknown result type (might be due to invalid IL or missing references) if (built && Standing()) { return; } built = true; Color colour = TodoFx.Colour; JujutsuFxLayer[] array = (JujutsuFxLayer[])(object)new JujutsuFxLayer[3] { (JujutsuFxLayer)2, (JujutsuFxLayer)1, default(JujutsuFxLayer) }; for (int i = 0; i < ribbons.Length; i++) { if (ribbons[i] == null || !ribbons[i].Alive) { ribbons[i] = TodoFx.Part("TodoThrowArc" + ((object)Unsafe.As(ref array[i])/*cast due to .constrained prefix*/).ToString(), Vector3.zero, Quaternion.identity, colour, array[i], JujutsuFxTextures.Streak, 0f); } } if (mark == null || !mark.Alive) { mark = TodoFx.Part("TodoThrowMark", Vector3.zero, Quaternion.identity, colour, (JujutsuFxLayer)1, null, 0f); if (mark != null && Object.op_Implicit((Object)(object)mark.Mesh)) { JujutsuFxMesh.Ring(mark.Mesh, 0.79200006f, 1.1f, new Color(1f, 1f, 1f, 0.12f), Color.white, new Color(1f, 1f, 1f, 0f), 36, 0.4f, 7, (Func)null); } } if (glow == null || !glow.Alive) { glow = TodoFx.Flare("TodoThrowMarkGlow", Vector3.zero, colour, 1.43f, 22f, 0f); } Hide(); } private bool Standing() { for (int i = 0; i < ribbons.Length; i++) { if (ribbons[i] == null || !ribbons[i].Alive) { return false; } } if (mark != null && mark.Alive && glow != null) { return glow.Alive; } return false; } private void OnDestroy() { for (int i = 0; i < ribbons.Length; i++) { Drop(ribbons[i]); } Drop(mark); Drop(glow); } private static void Drop(TodoFxPart part) { if (part != null && part.Alive) { Object.Destroy((Object)(object)part.Item); } } } }