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.Configuration; 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.ExpansionManagement; using RoR2.Skills; 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("NaoyaZenin")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.3.1.0")] [assembly: AssemblyInformationalVersion("1.3.1+4bfea71e3ca88fd38135ba73f70b6801fa7b0366")] [assembly: AssemblyProduct("NaoyaZenin")] [assembly: AssemblyTitle("NaoyaZenin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace GojoSatoruMod.Visuals { internal static class NaoyaCurseModel { private const string ModelFileName = "curse-form.model"; private const string TextureFolder = "curse-form"; private static Mesh mesh; private static Material material; private static bool loadFailed; internal static bool Available => EnsureLoaded(); internal static GameObject Draw(Transform parent, float height) { //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_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_003a: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)parent) || !EnsureLoaded()) { return null; } GameObject val = new GameObject("NaoyaCurseShell"); val.transform.SetParent(parent, false); Bounds bounds = mesh.bounds; float num = Mathf.Max(0.01f, ((Bounds)(ref bounds)).size.y); val.transform.localScale = Vector3.one * (height / num); val.AddComponent().sharedMesh = mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = material; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)obj).receiveShadows = true; return val; } private static bool EnsureLoaded() { if (Object.op_Implicit((Object)(object)mesh)) { return true; } if (loadFailed) { return false; } string text = JujutsuAssetPaths.Find(new string[2] { "assets", "curse-form.model" }); if (!File.Exists(text)) { loadFailed = true; Plugin.Log.LogWarning((object)("Naoya's curse form was not found at " + text + "; the ghost will wear the donor body instead of the chrysalis."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaCurseModel.cs"); return false; } try { Read(text); return true; } catch (Exception arg) { loadFailed = true; mesh = null; material = null; Plugin.Log.LogWarning((object)("Naoya's curse form could not be read; the ghost will " + $"wear the donor body instead: {arg}"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaCurseModel.cs"); return false; } } private static void Read(string path) { //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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_0233: 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_02e0: Unknown result type (might be due to invalid IL or missing references) using FileStream input = File.OpenRead(path); using BinaryReader binaryReader = new BinaryReader(input); string text = new string(binaryReader.ReadChars(8)); if (text != "SUKNMDL1") { throw new InvalidDataException("Bad magic '" + text + "'."); } int num = binaryReader.ReadInt32(); if (num != 2) { throw new InvalidDataException($"Bad version {num}."); } int num2 = binaryReader.ReadInt32(); for (int i = 0; i < num2; i++) { binaryReader.ReadString(); binaryReader.ReadInt32(); for (int j = 0; j < 10; j++) { binaryReader.ReadSingle(); } } if (binaryReader.ReadInt32() < 1) { throw new InvalidDataException("No parts."); } binaryReader.ReadString(); binaryReader.ReadInt32(); string text2 = binaryReader.ReadString(); string text3 = binaryReader.ReadString(); binaryReader.ReadByte(); int num3 = binaryReader.ReadInt32(); Vector3[] array = (Vector3[])(object)new Vector3[num3]; Vector3[] array2 = (Vector3[])(object)new Vector3[num3]; Vector2[] array3 = (Vector2[])(object)new Vector2[num3]; for (int k = 0; k < num3; k++) { array[k] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); array2[k] = new Vector3(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle()); array3[k] = new Vector2(binaryReader.ReadSingle(), binaryReader.ReadSingle()); binaryReader.ReadInt32(); binaryReader.ReadInt32(); binaryReader.ReadInt32(); binaryReader.ReadInt32(); binaryReader.ReadSingle(); binaryReader.ReadSingle(); binaryReader.ReadSingle(); binaryReader.ReadSingle(); } int num4 = binaryReader.ReadInt32(); int[] array4 = new int[num4]; for (int l = 0; l < num4; l++) { array4[l] = binaryReader.ReadInt32(); } mesh = new Mesh { name = "meshNaoyaCurse", hideFlags = (HideFlags)61 }; mesh.vertices = array; mesh.normals = array2; mesh.uv = array3; mesh.triangles = array4; mesh.RecalculateBounds(); material = JujutsuFxMaterials.CreateSurfaceMaterial("matNaoyaCurse" + text2, Color.white); if (Object.op_Implicit((Object)(object)material)) { ((Object)material).hideFlags = (HideFlags)61; Texture2D val = GojoAssets.LoadPersistentTexture("curse-form/" + text3, "texNaoyaCurse"); if (Object.op_Implicit((Object)(object)val) && material.HasProperty("_MainTex")) { material.SetTexture("_MainTex", (Texture)(object)val); } if (material.HasProperty("_Color")) { material.SetColor("_Color", Color.white); } if (material.HasProperty("_EmissionColor")) { material.SetColor("_EmissionColor", Color.black); material.DisableKeyword("_EMISSION"); } } Plugin.Log.LogInfo((object)($"Naoya's curse form read: {num3} vertices, " + $"{num4 / 3} triangles, texture '{text3}'" + (Object.op_Implicit((Object)(object)material) ? "." : ", but no material could be built.")), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaCurseModel.cs"); } } internal static class NaoyaGhosts { internal const float Seconds = 0.32f; private const float Hold = 0.2f; private const float Alpha = 0.42f; private static bool warned; internal static bool Cast(CharacterBody body, Color colour) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0061: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { return false; } if (JujutsuFxBudget.Available((Kind)3, 1) < 1) { return false; } SkinnedMeshRenderer[] componentsInChildren = ((Component)body.modelLocator.modelTransform).GetComponentsInChildren(); if (componentsInChildren == null || componentsInChildren.Length == 0) { return false; } GameObject val = new GameObject("NaoyaGhost"); val.transform.position = body.corePosition; NaoyaGhost naoyaGhost = val.AddComponent(); Material val2 = JujutsuFxMaterials.CreateLineMaterial("matNaoyaGhost", colour, 1.6f, (Texture2D)null); JujutsuFxMaterials.Claim(val, val2); int num = 0; for (int i = 0; i < componentsInChildren.Length; i++) { if (Bake(componentsInChildren[i], val.transform, val2, naoyaGhost)) { num++; } } if (num == 0) { Object.Destroy((Object)(object)val); return false; } Color tint = colour; tint.a = 0.42f; naoyaGhost.Configure(val2, tint, 0.32f, 0.2f); JujutsuFxBudget.Register(val, (Kind)3); return true; } private static bool Bake(SkinnedMeshRenderer part, Transform root, Material material, NaoyaGhost ghost) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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) if (!Object.op_Implicit((Object)(object)part) || !Object.op_Implicit((Object)(object)part.sharedMesh) || !((Renderer)part).enabled || !((Component)part).gameObject.activeInHierarchy) { return false; } Mesh val = new Mesh { name = "meshNaoyaGhost" }; try { part.BakeMesh(val); } catch (Exception ex) { if (!warned) { warned = true; Plugin.Log.LogWarning((object)("Naoya's afterimage could not bake " + ((Object)part).name + ": " + ex.Message), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGhosts.cs"); } Object.Destroy((Object)(object)val); return false; } GameObject val2 = new GameObject(((Object)part).name + "Ghost"); val2.transform.SetParent(((Component)part).transform, false); val2.transform.SetParent(root, true); val2.AddComponent().sharedMesh = val; MeshRenderer obj = val2.AddComponent(); ((Renderer)obj).sharedMaterial = material; JujutsuFxMaterials.PrepareRenderer((Renderer)(object)obj); ghost.Own(val); return true; } } internal sealed class NaoyaGhost : MonoBehaviour { private readonly List owned = new List(16); private Material material; private Color colour; private float life = 0.32f; private float hold; private float age; internal void Configure(Material ownedMaterial, Color tint, float seconds, float holdShare) { //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_0033: Unknown result type (might be due to invalid IL or missing references) material = ownedMaterial; colour = tint; life = Mathf.Max(0.05f, seconds); hold = Mathf.Clamp01(holdShare); JujutsuFxMaterials.SetEnvelopeSnap(material, colour, 0f, 1.6f, hold); } internal void Own(Mesh mesh) { if (Object.op_Implicit((Object)(object)mesh)) { owned.Add(mesh); } } private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; if (age >= life) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { JujutsuFxMaterials.SetEnvelopeSnap(material, colour, age / life, 1.6f, hold); } } private void OnDestroy() { for (int i = 0; i < owned.Count; i++) { if (Object.op_Implicit((Object)(object)owned[i])) { Object.Destroy((Object)(object)owned[i]); } } owned.Clear(); } } internal static class NaoyaGlass { internal const float FormSeconds = 0.09f; internal const float ReleaseSeconds = 0.26f; private const float Tiling = 2.4f; internal static readonly Color Tint = new Color(1.05f, 1.05f, 1.05f, 1f); private static readonly Color Pane = new Color(0.4f, 0.62f, 0.58f, 1f); internal static readonly Color Seam = Color.Lerp(NaoyaLanguage.Colour, Color.white, 0.62f); private const int Cells = 5; private const float SeamWidth = 0.115f; private static Texture2D texture; private static Texture2D ramp; private static Material material; private static bool materialResolved; private static bool hooked; internal static Texture2D Texture { get { if (!Object.op_Implicit((Object)(object)texture)) { return texture = Build(); } return texture; } } internal static Texture2D Ramp { get { if (!Object.op_Implicit((Object)(object)ramp)) { return ramp = BuildRamp(); } return ramp; } } internal static Material Material { get { //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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0065: 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_0097: Unknown result type (might be due to invalid IL or missing references) if (materialResolved) { return material; } materialResolved = true; Material brittleMaterial = CharacterModel.brittleMaterial; if (!Object.op_Implicit((Object)(object)brittleMaterial)) { JujutsuLog log = Plugin.Log; if (log != null) { log.LogWarning((object)"Naoya's glass has no material to build from — the game's brittle overlay is not loaded. A framed body will still be frozen and still take the extra damage; it simply will not look like glass.", "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGlass.cs"); } return null; } material = new Material(brittleMaterial) { name = "matNaoyaGlass", hideFlags = (HideFlags)61 }; material.SetColor("_TintColor", Tint); material.SetTexture("_MainTex", (Texture)(object)Texture); material.SetTextureScale("_MainTex", Vector2.one * 2.4f); material.SetTexture("_RemapTex", (Texture)(object)Ramp); JujutsuLog log2 = Plugin.Log; if (log2 != null) { string[] obj = new string[8] { "Naoya's glass built from the game's brittle overlay: shader '", null, null, null, null, null, null, null }; Shader shader = material.shader; obj[1] = ((shader != null) ? ((Object)shader).name : null); obj[2] = "', sheet "; Texture2D obj2 = Texture; obj[3] = $"'{((obj2 != null) ? ((Object)obj2).name : null)}' tiled {2.4f:0.0}x, ramp "; obj[4] = "'"; Texture2D obj3 = Ramp; obj[5] = ((obj3 != null) ? ((Object)obj3).name : null); obj[6] = "', remap "; obj[7] = ((material.GetFloat("_DisableRemapOn") > 0.5f) ? "off." : "on."); log2.LogInfo((object)string.Concat(obj), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGlass.cs"); } return material; } } 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.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(Glaze); JujutsuGlassSfx.Warm(); } } private static void Glaze(orig_OnBuffFirstStackGained original, CharacterBody self, BuffDef buffDef) { original.Invoke(self, buffDef); if (!Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) || (Object)(object)buffDef != (Object)(object)NaoyaBuffs.Framed || !Object.op_Implicit((Object)(object)self)) { return; } try { NaoyaGlassSkin.Cast(self); } catch (Exception arg) { JujutsuLog log = Plugin.Log; if (log != null) { log.LogWarning((object)("Naoya's glass could not be put on " + ((Object)self).name + "; the " + $"freeze itself is unaffected: {arg}"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGlass.cs"); } } } private static Texture2D Build() { Texture2D obj = JujutsuFxTextures.Build("texNaoyaGlassShell", 256, (Func)Sample); ((Texture)obj).wrapMode = (TextureWrapMode)0; return obj; } private static Texture2D BuildRamp() { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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_0071: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 2, (TextureFormat)4, false) { name = "texNaoyaGlassRamp", wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; Color32[] array = (Color32[])(object)new Color32[128]; Color32 val3 = default(Color32); for (int i = 0; i < 64; i++) { float num = ((float)i + 0.5f) / 64f; Color val2 = ((num <= 0.35f) ? (Pane * (num / 0.35f)) : Color.Lerp(Pane, Seam, Mathf.Clamp01((num - 0.35f) / 0.5f))); ((Color32)(ref val3))..ctor((byte)Mathf.RoundToInt(Mathf.Clamp01(val2.r) * 255f), (byte)Mathf.RoundToInt(Mathf.Clamp01(val2.g) * 255f), (byte)Mathf.RoundToInt(Mathf.Clamp01(val2.b) * 255f), (byte)Mathf.RoundToInt(Mathf.Clamp01(num) * 255f)); for (int j = 0; j < 2; j++) { array[j * 64 + i] = val3; } } val.SetPixels32(array); val.Apply(false, false); return val; } private static Color32 Sample(float u, float v) { //IL_0189: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) float num = u * 5f; float num2 = v * 5f; int num3 = Mathf.FloorToInt(num); int num4 = Mathf.FloorToInt(num2); float num5 = float.MaxValue; float num6 = float.MaxValue; float num7 = 0f; float num8 = 0f; int x = 0; int y = 0; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int num9 = num3 + j; int num10 = num4 + i; int num11 = Wrap(num9); int num12 = Wrap(num10); float num13 = (float)num9 + 0.16f + 0.68f * Hash(num11, num12, 17); float num14 = (float)num10 + 0.16f + 0.68f * Hash(num11, num12, 91); float num15 = num13 - num; float num16 = num14 - num2; float num17 = Mathf.Sqrt(num15 * num15 + num16 * num16); if (num17 < num5) { num6 = num5; num5 = num17; num7 = num15; num8 = num16; x = num11; y = num12; } else if (num17 < num6) { num6 = num17; } } } float num18 = Mathf.Clamp01(1f - (num6 - num5) / 0.115f); num18 = num18 * num18 * num18; float num19 = Hash(x, y, 233) * MathF.PI * 2f; float num20 = (0f - num7) * Mathf.Cos(num19) - num8 * Mathf.Sin(num19); float num21 = Mathf.Clamp01(0.5f + num20 * 1.5f) * (0.55f + 0.45f * Hash(x, y, 401)); Color val = Pane * (num21 * 0.46f) + Seam * (num18 * 0.95f); float num22 = Mathf.Clamp01(num21 * 0.38f + num18); return new Color32((byte)Mathf.RoundToInt(Mathf.Clamp01(val.r) * 255f), (byte)Mathf.RoundToInt(Mathf.Clamp01(val.g) * 255f), (byte)Mathf.RoundToInt(Mathf.Clamp01(val.b) * 255f), (byte)Mathf.RoundToInt(num22 * 255f)); } private static int Wrap(int index) { int num = index % 5; if (num >= 0) { return num; } return num + 5; } private static float Hash(int x, int y, int seed) { int num = x * 374761393 + y * 668265263 + seed * 1442695040; int num2 = (num ^ (num >> 13)) * 1274126177; return (float)((num2 ^ (num2 >> 16)) & 0xFFFFFF) / 16777215f; } } internal sealed class NaoyaGlassSkin : MonoBehaviour { private const int Shards = 6; private const float PatienceSeconds = 0.5f; private static readonly int ExternalAlpha = Shader.PropertyToID("_ExternalAlpha"); private static bool failureLogged; private CharacterBody body; private TemporaryOverlayInstance overlay; private float age; private float waited; private float alpha; private float releasing = -1f; internal static void Cast(CharacterBody victim) { if (Object.op_Implicit((Object)(object)victim) && !failureLogged) { NaoyaGlassSkin naoyaGlassSkin = ((Component)victim).GetComponent(); if (!Object.op_Implicit((Object)(object)naoyaGlassSkin)) { naoyaGlassSkin = ((Component)victim).gameObject.AddComponent(); } ((Behaviour)naoyaGlassSkin).enabled = true; naoyaGlassSkin.Begin(); } } private void Awake() { body = ((Component)this).GetComponent(); } private void Begin() { age = alpha * 0.09f; waited = 0f; releasing = -1f; } private void Update() { try { Draw(); } catch (Exception arg) { failureLogged = true; JujutsuLog log = Plugin.Log; if (log != null) { log.LogWarning((object)("Naoya's glass failed and has been switched off; the " + $"freeze itself is unaffected: {arg}"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGlass.cs"); } Sleep(); } } private void Draw() { if (overlay == null && !Attach()) { waited += Time.deltaTime; if (waited > 0.5f) { Sleep(); } return; } if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) && body.HasBuff(NaoyaBuffs.Framed)) { releasing = -1f; age += Time.deltaTime; SetAlpha(JujutsuEase.OutCubic(Mathf.Clamp01(age / 0.09f))); return; } if (releasing < 0f) { releasing = 0f; Shatter(); } releasing += Time.deltaTime; float num = Mathf.Clamp01(releasing / 0.26f); SetAlpha(1f - JujutsuEase.InQuad(num)); if (num >= 1f) { Sleep(); } } private void Sleep() { Detach(); waited = 0f; releasing = -1f; age = 0f; alpha = 0f; ((Behaviour)this).enabled = false; } private bool Attach() { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator)) { return false; } Transform modelTransform = body.modelLocator.modelTransform; if (!Object.op_Implicit((Object)(object)modelTransform)) { return false; } CharacterModel component = ((Component)modelTransform).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return false; } Material material = NaoyaGlass.Material; if (!Object.op_Implicit((Object)(object)material)) { return false; } overlay = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject); overlay.originalMaterial = material; overlay.animateShaderAlpha = false; overlay.duration = 0f; overlay.destroyComponentOnEnd = true; overlay.destroyObjectOnEnd = false; overlay.AddToCharacterModel(component); NoItemDisplaysController.Keep(overlay.materialInstance); SetAlpha(0f); return true; } private void Shatter() { //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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { JujutsuFxDebris.Throw(body.corePosition, Vector3.up, NaoyaGlass.Seam, Mathf.Max(0.6f, body.radius), 6, 0f, 1f); JujutsuGlassSfx.PlayShatter(body.corePosition, Mathf.Max(0.6f, body.radius), 0.3f); } } private void SetAlpha(float value) { alpha = Mathf.Clamp01(value); Material val = overlay?.materialInstance; if (Object.op_Implicit((Object)(object)val)) { val.SetFloat(ExternalAlpha, alpha); } } private void OnDestroy() { Detach(); } private void Detach() { if (overlay != null) { NoItemDisplaysController.Forget(overlay.materialInstance); overlay.Destroy(); overlay = null; } } } internal sealed class NaoyaGlassCase : MonoBehaviour { private const float Grace = 0.35f; private const float Squash = 0.12f; private const float Spread = 1.12f; private const float FrameMargin = 1.3664f; private const float PressSeconds = 0.12f; private readonly List panes = new List(1); private readonly List offsets = new List(1); private CharacterBody body; private float age; private float life; private bool marked; private bool closed; private Vector3 forward; private Transform model; private Animator animator; private Vector3 heldScale; private Quaternion heldRotation = Quaternion.identity; private float heldAnimatorSpeed = 1f; private bool holdingModel; private float press; private Vector3 Anchor { get { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!holdingModel || !Object.op_Implicit((Object)(object)model)) { return ((Component)this).transform.position; } return model.position; } } internal static void Stand(CharacterBody victim, Vector3 heading, float seconds, Color? tint = null) { //IL_002c: 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_0039: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)victim)) { NaoyaGlassCase naoyaGlassCase = ((Component)victim).GetComponent(); if (!Object.op_Implicit((Object)(object)naoyaGlassCase)) { naoyaGlassCase = ((Component)victim).gameObject.AddComponent(); } ((Behaviour)naoyaGlassCase).enabled = true; naoyaGlassCase.Build(heading, seconds, (Color)(((??)tint) ?? NaoyaLanguage.Colour)); } } internal static void Break(CharacterBody victim) { if (victim != null) { ((Component)victim).GetComponent()?.Shatter(); } } private void Awake() { body = ((Component)this).GetComponent(); } private void Build(Vector3 heading, float seconds, Color tint) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_006c: 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_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_00b7: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) NaoyaPanes.Close(panes, heading, finished: false); offsets.Clear(); age = 0f; life = Mathf.Max(0.2f, seconds) + 0.35f; marked = false; closed = false; forward = Vector3.ProjectOnPlane(heading, Vector3.up); forward = ((((Vector3)(ref forward)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref forward)).normalized : Vector3.forward); if (Object.op_Implicit((Object)(object)body)) { Seize(); float halfWidth; float halfHeight; Vector3 centre = Middle(out halfWidth, out halfHeight); Vector3 val = ((holdingModel && Object.op_Implicit((Object)(object)model)) ? model.lossyScale : Vector3.one); NaoyaPanes.Case(panes, centre, forward, halfWidth / Safe(val.x), halfHeight / Safe(val.y), tint, life); Hang(); Vector3 anchor = Anchor; for (int i = 0; i < panes.Count; i++) { offsets.Add(Object.op_Implicit((Object)(object)panes[i]) ? (((Component)panes[i]).transform.position - anchor) : Vector3.zero); } } } private static float Safe(float scale) { if (!(Mathf.Abs(scale) > 0.0001f)) { return 1f; } return Mathf.Abs(scale); } private void Hang() { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!holdingModel || !Object.op_Implicit((Object)(object)model)) { return; } for (int i = 0; i < panes.Count; i++) { NaoyaPane naoyaPane = panes[i]; if (Object.op_Implicit((Object)(object)naoyaPane)) { Transform transform = ((Component)naoyaPane).transform; transform.SetParent(model, true); Vector3 localPosition = transform.localPosition; localPosition.z = 0f; transform.localPosition = localPosition; transform.localRotation = Quaternion.identity; } } } private Vector3 Middle(out float halfWidth, out float halfHeight) { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00ee: 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) if (holdingModel && Object.op_Implicit((Object)(object)model) && Measure(out var bounds)) { Vector3 extents = ((Bounds)(ref bounds)).extents; halfHeight = Mathf.Clamp(extents.y * 1.3664f, 0.85f, 18f); halfWidth = Mathf.Clamp(Mathf.Max(Mathf.Max(extents.x, extents.z) * 1.3664f, halfHeight * 0.42f), 0.6f, 18f); Plugin.Log.LogInfo((object)($"Naoya's frame round {((Object)this).name}: {halfWidth * 2f:0.#}x" + $"{halfHeight * 2f:0.#}m off a drawn box of " + $"{((Bounds)(ref bounds)).size.x:0.#}x{((Bounds)(ref bounds)).size.y:0.#}x" + $"{((Bounds)(ref bounds)).size.z:0.#}m, hung on the model."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Visuals\\NaoyaGlassCase.cs"); return ((Bounds)(ref bounds)).center; } float num = body.corePosition.y - ((Component)this).transform.position.y; halfHeight = Mathf.Max(0.85f, num * 1.35f); halfWidth = Mathf.Max(Mathf.Max(0.6f, body.radius * 1.6f), halfHeight * 0.5f); return ((Component)this).transform.position + Vector3.up * Mathf.Max(0.65f, num); } private bool Measure(out Bounds bounds) { //IL_0001: 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_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) bounds = default(Bounds); if (!Object.op_Implicit((Object)(object)model)) { return false; } Renderer[] componentsInChildren = ((Component)model).GetComponentsInChildren(); bool flag = false; foreach (Renderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && val.enabled && (val is SkinnedMeshRenderer || val is MeshRenderer)) { if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } } return flag; } private void Seize() { //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_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 (holdingModel || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator)) { return; } model = body.modelLocator.modelTransform; if (Object.op_Implicit((Object)(object)model)) { holdingModel = true; heldScale = model.localScale; heldRotation = model.localRotation; press = 0f; animator = ((Component)model).GetComponent(); if (Object.op_Implicit((Object)(object)animator)) { heldAnimatorSpeed = JujutsuFxHitStop.TrueSpeed(body, animator); animator.speed = 0f; } } } private void Update() { if (!closed) { age += Time.deltaTime; Carry(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) && body.HasBuff(NaoyaBuffs.Framed)) { marked = true; } else if (marked) { Shatter(); } else if (age >= life) { Close(broken: false); } } } private void LateUpdate() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) if (!holdingModel) { if (!closed) { Seize(); } return; } if (!Object.op_Implicit((Object)(object)model)) { holdingModel = false; animator = null; return; } press = Mathf.MoveTowards(press, closed ? 0f : 1f, Time.deltaTime / 0.12f); float num = JujutsuEase.OutCubic(Mathf.Clamp01(press)); model.rotation = Quaternion.Slerp(model.rotation, Quaternion.LookRotation(-forward, Vector3.up), num); model.localScale = Vector3.Scale(heldScale, new Vector3(Mathf.Lerp(1f, 1.12f, num), Mathf.Lerp(1f, 1.12f, num), Mathf.Lerp(1f, 0.12f, num))); if (closed && press <= 0f) { Release(); ((Behaviour)this).enabled = false; } } private void Carry() { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (holdingModel) { return; } Vector3 anchor = Anchor; for (int i = 0; i < panes.Count && i < offsets.Count; i++) { NaoyaPane naoyaPane = panes[i]; if (Object.op_Implicit((Object)(object)naoyaPane) && !naoyaPane.Spent) { ((Component)naoyaPane).transform.position = anchor + offsets[i]; } } } internal void Shatter() { if (!closed) { Close(broken: true); } } private void Close(bool broken) { //IL_0066: 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) closed = true; if (broken) { for (int i = 0; i < panes.Count; i++) { NaoyaPane naoyaPane = panes[i]; if (Object.op_Implicit((Object)(object)naoyaPane) && !naoyaPane.Spent) { naoyaPane.Break(-forward, 0f); } } panes.Clear(); } else { NaoyaPanes.Close(panes, Vector3.up, finished: false); } offsets.Clear(); } private void Release() { //IL_0024: 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 (holdingModel) { holdingModel = false; if (Object.op_Implicit((Object)(object)model)) { model.localScale = heldScale; model.localRotation = heldRotation; } if (Object.op_Implicit((Object)(object)animator) && !JujutsuFxHitStop.HandBack(body, animator, heldAnimatorSpeed)) { animator.speed = heldAnimatorSpeed; } animator = null; press = 0f; } } private void OnDisable() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (!closed) { NaoyaPanes.Close(panes, Vector3.up, finished: false); offsets.Clear(); } Release(); } } internal static class NaoyaPanes { internal const float DrawSeconds = 0.13f; internal const float BreakSeconds = 0.42f; internal const float FadeSeconds = 0.3f; private const float Gravity = 3.4f; private const int Columns = 3; private const int Rows = 3; private static Texture2D glass; private const float GateSpacing = 3.2f; private const float StaggerSeconds = 0.06f; internal static Texture2D Glass { get { if (!Object.op_Implicit((Object)(object)glass)) { return glass = BuildGlass(); } return glass; } } internal static float Fall => 3.4f; internal static int Across => 3; internal static int Down => 3; private static Texture2D BuildGlass() { return JujutsuFxTextures.Build("texNaoyaGlass", 128, (Func)delegate(float u, float v) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) float num = 0.5f + 0.5f * Mathf.Sin(MathF.PI * 2f * (u + v)); float num2 = Mathf.Sin(MathF.PI * 2f * u * 3f) * Mathf.Sin(MathF.PI * 2f * v * 3f); float num3 = Mathf.Clamp01(0.5f + num * 0.1f + num2 * 0.03f); byte b = (byte)Mathf.RoundToInt(num3 * 255f); byte num4 = (byte)Mathf.RoundToInt(Mathf.Clamp01(Mathf.Pow(num3, 1.35f)) * 255f); return new Color32(num4, num4, num4, b); }); } internal static NaoyaPane Draw(Vector3 centre, Vector3 normal, float halfWidth, float halfHeight, Color colour, float life, int seed, float fill = 1f) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0056: 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_005b: 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_0094: Unknown result type (might be due to invalid IL or missing references) if (((Vector3)(ref normal)).sqrMagnitude < 0.0001f) { normal = Vector3.forward; } ((Vector3)(ref normal)).Normalize(); Mesh ownedMesh = default(Mesh); MeshRenderer val = default(MeshRenderer); GameObject obj = JujutsuFxMesh.Object("NaoyaPane", ref ownedMesh, ref val); obj.transform.position = centre; obj.transform.rotation = Quaternion.LookRotation(normal, (Mathf.Abs(normal.y) > 0.985f) ? Vector3.forward : Vector3.up); Material val2 = (((Renderer)val).sharedMaterial = JujutsuFxMaterials.CreateLineMaterial("matNaoyaPane", colour, 1.6f, Glass)); JujutsuFxMaterials.Claim(obj, val2); NaoyaPane naoyaPane = obj.AddComponent(); naoyaPane.Configure(ownedMesh, val2, colour, halfWidth, halfHeight, life, seed, fill); JujutsuFxBudget.Register(obj, (Kind)3); return naoyaPane; } internal static void Line(List into, CharacterBody body, Vector3 from, Vector3 heading, float distance, int count, Color colour, float life) { //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_0032: Unknown result type (might be due to invalid IL or missing references) Along(into, body, (float arc) => from + heading * arc, (float arc) => heading, distance, count, colour, life); } internal static void Along(List into, CharacterBody body, Func at, Func along, float distance, int count, Color colour, float life) { //IL_0057: 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_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_00a6: Unknown result type (might be due to invalid IL or missing references) if (into == null || at == null || along == null || count <= 0) { return; } float num = distance / (float)count; float num2 = Mathf.Clamp01(num / 3.2f); float halfWidth = JujutsuFxScale.Of(body, Mathf.Lerp(0.78f, 1.35f, num2)); float halfHeight = JujutsuFxScale.Of(body, Mathf.Lerp(1f, 1.9f, num2)); int num3 = SeedFrom(at(0f)); float fill = Mathf.Clamp(6f / (float)count, 0.35f, 1f); for (int i = 0; i < count; i++) { float arg = num * ((float)i + 0.5f); NaoyaPane naoyaPane = Draw(at(arg), -along(arg), halfWidth, halfHeight, colour, life, num3 + i * 15485863, fill); if (Object.op_Implicit((Object)(object)naoyaPane)) { naoyaPane.Delay((count > 1) ? (0.06f * (float)i / (float)(count - 1)) : 0f); into.Add(naoyaPane); } } } internal static void Case(List into, Vector3 centre, Vector3 heading, float halfWidth, float halfHeight, Color colour, float life) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_002d: 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_0039: 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) if (into != null) { Vector3 val = Vector3.ProjectOnPlane(heading, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); NaoyaPane naoyaPane = Draw(centre, -val, halfWidth, halfHeight, colour, life, SeedFrom(centre), 0.7f); if (Object.op_Implicit((Object)(object)naoyaPane)) { into.Add(naoyaPane); } } } internal static void Reel(List into, CharacterBody body, Vector3 centre, Vector3 facing, int count, Color colour, float life) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cf: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0183: 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_018b: Unknown result type (might be due to invalid IL or missing references) if (into == null || count <= 0) { return; } if (((Vector3)(ref facing)).sqrMagnitude < 0.0001f) { facing = Vector3.forward; } Vector3 val = Vector3.ProjectOnPlane(facing, Vector3.up); facing = ((Vector3)(ref val)).normalized; float num = JujutsuFxScale.Of(body, 2.6f); float num2 = JujutsuFxScale.Of(body, 16f) / (float)count; float halfWidth = JujutsuFxScale.Of(body, 0.42f); float num3 = JujutsuFxScale.Of(body, 0.52f); float num4 = JujutsuFxScale.Of(body, 1.35f); float num5 = JujutsuFxScale.Of(body, 0.5f); val = Vector3.Cross(Vector3.up, facing); Vector3 normalized = ((Vector3)(ref val)).normalized; int num6 = SeedFrom(centre); float fill = Mathf.Clamp(6f / (float)count, 0.3f, 1f); float num7 = ((Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.transform)) ? body.transform.position.y : (centre.y - num3)); for (int i = 0; i < count; i++) { Vector3 val2 = centre + facing * (num + num2 * (float)i) + normalized * ((Mathf.Sin((float)i * 2.4f) * 0.25f + ((i % 2 == 0) ? (-0.7f) : 0.7f)) * num4) + Vector3.up * (Mathf.Sin((float)i * 1.7f + 0.9f) * num5); val2.y = Mathf.Max(val2.y, num7 + num3 * 1.05f); NaoyaPane naoyaPane = Draw(val2, -facing, halfWidth, num3, colour, life, num6 + i * 15485863, fill); if (Object.op_Implicit((Object)(object)naoyaPane)) { naoyaPane.Delay((float)i * 0.005f); into.Add(naoyaPane); } } } internal static NaoyaPane At(List panes, int index) { if (panes == null || index < 0 || index >= panes.Count) { return null; } NaoyaPane naoyaPane = panes[index]; if (!Object.op_Implicit((Object)(object)naoyaPane) || naoyaPane.Spent) { return null; } return naoyaPane; } internal static void Close(List panes, Vector3 through, bool finished) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (panes == null) { return; } for (int i = 0; i < panes.Count; i++) { NaoyaPane naoyaPane = panes[i]; if (Object.op_Implicit((Object)(object)naoyaPane) && !naoyaPane.Spent) { if (finished) { naoyaPane.Break(through, 0f); } else { naoyaPane.Expire(); } } } panes.Clear(); } internal static int SeedFrom(Vector3 origin) { //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(origin.x * 100f) * 73856093) ^ (Mathf.RoundToInt(origin.y * 100f) * 19349663) ^ (Mathf.RoundToInt(origin.z * 100f) * 83492791); } } internal sealed class NaoyaPane : MonoBehaviour { private Mesh mesh; private Material material; private Color colour; private float halfWidth; private float halfHeight; private float border; private float fillWeight = 1f; private float life; private int seed; private float age; private float delay; private float breakAfter = -1f; private Vector3 breakThrough; private float breakForce; private bool breaking; private bool expiring; private float endedAt; private Vector3[] velocities; private Vector3[] axes; private float[] spins; internal bool Spent { get { if (!breaking) { return expiring; } return true; } } internal void Configure(Mesh ownedMesh, Material ownedMaterial, Color baseColour, float width, float height, float standingSeconds, int hash, float fill) { //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_009b: Unknown result type (might be due to invalid IL or missing references) mesh = ownedMesh; material = ownedMaterial; colour = baseColour; halfWidth = Mathf.Max(0.01f, width); halfHeight = Mathf.Max(0.01f, height); border = Mathf.Min(halfWidth, halfHeight) * 0.16f; fillWeight = Mathf.Clamp01(fill); life = Mathf.Max(0.1f, standingSeconds); seed = hash; Rebuild(null, null); Shade(0f, 4.4f); ((Component)this).transform.localScale = Vector3.zero; } internal void Delay(float seconds) { delay = Mathf.Max(0f, seconds); life += delay; } internal void BreakIn(float after, Vector3 through, float force = 0f) { //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) if (!Spent) { breakAfter = Mathf.Max(0f, after); breakThrough = through; breakForce = force; } } internal void Break(Vector3 through, float force) { //IL_0022: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) if (Spent) { return; } breaking = true; endedAt = age; ((Component)this).transform.localScale = Vector3.one; if (((Vector3)(ref through)).sqrMagnitude < 0.0001f) { through = ((Component)this).transform.forward; } ((Vector3)(ref through)).Normalize(); if (force <= 0f) { force = Mathf.Clamp(2.2f + halfWidth * 3.4f, 2.5f, 11f); } Vector3 val = ((Component)this).transform.InverseTransformDirection(through); int num = NaoyaPanes.Across * NaoyaPanes.Down; velocities = (Vector3[])(object)new Vector3[num]; axes = (Vector3[])(object)new Vector3[num]; spins = new float[num]; float num2 = halfWidth / (float)NaoyaPanes.Across; float num3 = halfHeight / (float)NaoyaPanes.Down; Vector3 val2 = default(Vector3); for (int i = 0; i < num; i++) { int num4 = i % NaoyaPanes.Across; int num5 = i / NaoyaPanes.Across; ((Vector3)(ref val2))..ctor(0f - halfWidth + num2 * (float)(2 * num4 + 1), 0f - halfHeight + num3 * (float)(2 * num5 + 1), 0f); if (((Vector3)(ref val2)).sqrMagnitude > 0.0001f) { ((Vector3)(ref val2)).Normalize(); } velocities[i] = val * (force * Mathf.Lerp(0.5f, 1.2f, Fraction(i, 1))) + val2 * (force * 0.45f * Mathf.Lerp(0.35f, 1f, Fraction(i, 2))); Vector3[] array = axes; int num6 = i; Vector3 val3 = new Vector3(Mathf.Lerp(-1f, 1f, Fraction(i, 3)), Mathf.Lerp(-1f, 1f, Fraction(i, 4)), Mathf.Lerp(-1f, 1f, Fraction(i, 5))); array[num6] = ((Vector3)(ref val3)).normalized; spins[i] = Mathf.Lerp(160f, 620f, Fraction(i, 6)); } JujutsuFxDebris.Throw(((Component)this).transform.position, through, colour, halfWidth, (halfWidth > 1f) ? 4 : 2, 0f, 0.45f); JujutsuGlassSfx.PlayShatter(((Component)this).transform.position, halfWidth, 0.3f); } internal void Expire() { if (!Spent) { expiring = true; endedAt = age; } } private void Update() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; if (breaking) { Breaking(); } else if (expiring) { Expiring(); } else if (!(age < delay)) { if (breakAfter >= 0f && age >= delay + 0.13f + breakAfter) { Break(breakThrough, breakForce); } else if (age >= life) { Expire(); } else { Standing(); } } } private void Standing() { //IL_0083: 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) float num = (age - delay) / 0.13f; if (num < 1f) { ((Component)this).transform.localScale = new Vector3(Mathf.Lerp(0.04f, 1f, JujutsuEase.OutQuint(num)), Mathf.Lerp(0.45f, 1f, JujutsuEase.OutBack(num, 0.25f)), 1f); Shade(JujutsuEase.OutQuint(num), Mathf.Lerp(4.4f, 1.6f, num)); } else { ((Component)this).transform.localScale = Vector3.one; Shade(JujutsuEase.FlickerScaled(age * 1.7f, 0.72f, 9f), 1.6f); } } private void Breaking() { //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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) float num = (age - endedAt) / 0.42f; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float elapsed = num * 0.42f; Vector3 fall = ((Component)this).transform.InverseTransformDirection(Vector3.down) * (0.5f * NaoyaPanes.Fall * elapsed * elapsed); Rebuild((int index) => velocities[index] * elapsed + fall, (int index) => Quaternion.AngleAxis(spins[index] * elapsed, axes[index])); Shade(JujutsuEase.Snap(num, 0.1f), Mathf.Lerp(4.4f, 0.55f, JujutsuEase.OutCubic(num))); } private void Expiring() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) float num = (age - endedAt) / 0.3f; if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } ((Component)this).transform.localScale = new Vector3(1f, Mathf.Lerp(1f, 0.86f, JujutsuEase.InQuad(num)), 1f); Shade(1f - JujutsuEase.InQuad(num), 0.55f); } private void Rebuild(Func drift, Func tumble) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) JujutsuFxMesh.Pane(mesh, halfWidth, halfHeight, border, colour, Fill(colour, 0.2f * fillWeight), NaoyaPanes.Across, NaoyaPanes.Down, drift, tumble); } private static Color Fill(Color source, float weight) { //IL_0000: 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_0010: 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_0020: Unknown result type (might be due to invalid IL or missing references) return new Color(source.r * weight, source.g * weight, source.b * weight, source.a * weight); } private void Shade(float alpha, float glow) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) JujutsuFxMaterials.SetEnvelope(material, colour, alpha, glow); } private float Fraction(int cell, int salt) { int num = seed * 374761393 + cell * 668265263 + salt * 1442695040; int num2 = (num ^ (num >> 13)) * 1274126177; return (float)((num2 ^ (num2 >> 16)) & 0xFFFFFF) / 16777215f; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mesh)) { Object.Destroy((Object)(object)mesh); } } } } namespace GojoSatoruMod.States { public sealed class NaoyaCorridorState : BaseSkillState, IPosedState { internal const float Length = 30f; internal const float Corridor = 3f; private const int Frames = 9; internal const float RunSpeed = 60f; internal const float BreakCoefficient = 8f; internal const float SealSeconds = 2f; internal const float FullFilmSealSeconds = 2.6f; internal const int TracedFrames = 8; private const float LaySeconds = 0.34f; private const float LayFraction = 0.55f; private const float RunCeiling = 1.6f; private const float Recover = 0.12f; private const int StallTicks = 3; private const float ExitSpeedShare = 1f; private const float StrideRate = 15f; private const float LookAhead = 3f; private const float Window = 16f; private Vector3 aim; private Vector3 flat; private Vector3 origin; private bool fromWire; private NaoyaCorridorPath path; private float wind; private bool laid; private bool running; private bool finished; private float runStartedAt; private float finishedAt; private float progress; private int stalled; private bool fallsIgnored; private bool gravityHeld; private float stride; private float seconds = 2f; private readonly List panes = new List(9); private int crossed; private readonly List broken = new List(8); private readonly List found = new List(16); private readonly List arcs = new List(16); private int spent; private int sealed_; bool IPosedState.DrivesPose { get { if (running) { return !finished; } return false; } } GojoCpuPose IPosedState.Pose => (GojoCpuPose)3; float IPosedState.PosePhase => stride; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => 0f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 20; public override void OnEnter() { //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) //IL_003e: 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_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_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_00ca: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (!fromWire) { aim = Bearing(); origin = ((EntityState)this).characterBody.corePosition; } flat = Flatten(aim); path = NaoyaCorridorPath.Build(origin, aim, 30f); wind = 0.34f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(wind + 1.6f + 0.12f); Face(); GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.ClearAttackPose(); val.TriggerPunch(true, wind, 0, 0.55f); } JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.9f); } private Vector3 Bearing() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0024: 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_0088: 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_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) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; if (((Vector3)(ref direction)).sqrMagnitude > 0.0001f) { ((Vector3)(ref direction)).Normalize(); if (direction.y < 0f) { Vector2 val = new Vector2(direction.x, direction.z); if (((Vector2)(ref val)).sqrMagnitude < 0.04f) { return Flatten(((EntityState)this).characterBody.transform.forward); } } return direction; } Vector3 forward = ((EntityState)this).characterBody.transform.forward; if (!(((Vector3)(ref forward)).sqrMagnitude > 0.0001f)) { return Vector3.forward; } return ((Vector3)(ref forward)).normalized; } private static Vector3 Flatten(Vector3 line) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(line, Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude > 0.0001f)) { return Vector3.forward; } return ((Vector3)(ref val)).normalized; } private void Face() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = flat; } } public override void OnSerialize(NetworkWriter writer) { //IL_0009: 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) ((BaseSkillState)this).OnSerialize(writer); writer.Write(aim); writer.Write(origin); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); aim = reader.ReadVector3(); origin = reader.ReadVector3(); fromWire = true; } public override void Update() { ((EntityState)this).Update(); if (running && !finished) { stride = Mathf.Repeat(stride + Time.deltaTime * 15f, MathF.PI * 200f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (finished) { Tail(); } else if (!running) { GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.2f); if (!laid && ((EntityState)this).fixedAge >= wind * 0.55f) { Lay(); } if (laid && ((EntityState)this).fixedAge >= wind) { Begin(); } } else { Run(); } } private void Lay() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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) laid = true; Face(); NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); seconds = ((Object.op_Implicit((Object)(object)naoyaFilm) && naoyaFilm.Full) ? 2.6f : 2f); NaoyaPanes.Along(panes, ((EntityState)this).characterBody, path.PointAt, path.TangentAt, path.Span, 9, NaoyaLanguage.Colour, seconds); sealed_ = Inside(found, 0f, path.Span); for (int i = 0; i < sealed_; i++) { CharacterBody val = found[i]; if (Object.op_Implicit((Object)(object)val)) { NaoyaFilm.Catch(val, seconds); NaoyaHold.Pin(val, seconds, ((EntityState)this).characterBody); if (i < 16) { NaoyaGlassCase.Stand(val, flat, seconds); } } } if (((EntityState)this).isAuthority) { NaoyaFilm.Of(((EntityState)this).characterBody)?.Trace(8); Plugin.Log.LogInfo((object)("Naoya's corridor is " + StatText.Metres(path.Span) + " long and " + StatText.Metres(3f) + " wide, laid " + $"{Mathf.RoundToInt(path.End.y - origin.y)}m higher than " + $"it started; it sealed {sealed_} " + $"body/bodies for {seconds:0.##}s and traced " + $"{8} frames."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaCorridorState.cs"); } float num = NaoyaFx.Reach(((EntityState)this).characterBody, 3f); Vector3 val2 = path.PointAt(3f); Vector3 val3 = path.TangentAt(3f); JujutsuImpact.Strike(val2, val3, NaoyaLanguage.Colour, num, JujutsuFxScale.Weight(1f), false, true); JujutsuMotes.Burst(val2, val3, NaoyaLanguage.Colour, num * 0.8f, (JujutsuMoteKind)2, 12); JujutsuSfxAssets.PlayHeavyWhoosh(origin, 1f); } private void Begin() { //IL_006d: 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) running = true; runStartedAt = ((EntityState)this).fixedAge; progress = 0f; JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true, false); fallsIgnored = true; if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.useGravity) { ((EntityState)this).characterMotor.useGravity = false; gravityHeld = true; } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.85f); NaoyaFx.Afterimage(((EntityState)this).characterBody, path.TangentAt(0f)); } private void Run() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) Vector3 corePosition = ((EntityState)this).characterBody.corePosition; float num = progress; progress = path.Advance(corePosition, progress, 16f); Cross(progress); if (Mathf.Repeat(((EntityState)this).fixedAge, 0.07f) < Time.fixedDeltaTime) { NaoyaFx.Afterimage(((EntityState)this).characterBody, path.TangentAt(progress)); } if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge - runStartedAt >= 1.6f) { Finish(ranOut: false); } return; } Drive(corePosition); if (((EntityState)this).fixedAge - runStartedAt > Time.fixedDeltaTime * 2f) { stalled = ((progress - num < 60f * Time.fixedDeltaTime * 0.25f) ? (stalled + 1) : 0); } if (progress >= path.Span - 0.05f) { Finish(ranOut: true); } else if (stalled >= 3 || ((EntityState)this).fixedAge - runStartedAt >= 1.6f) { Finish(ranOut: false); } } private void Drive(Vector3 here) { //IL_0006: 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_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_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).characterMotor.moveDirection = Vector3.zero; Vector3 val = Ahead(progress + 3f) - here; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = path.TangentAt(progress); } KinematicCharacterMotor motor = ((BaseCharacterController)((EntityState)this).characterMotor).Motor; if (Object.op_Implicit((Object)(object)motor)) { motor.ForceUnground(0.1f); } ((EntityState)this).characterMotor.velocity = ((Vector3)(ref val)).normalized * 60f; } private Vector3 Ahead(float arc) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_0017: Unknown result type (might be due to invalid IL or missing references) float span = path.Span; if (arc <= span) { return path.PointAt(arc); } return path.PointAt(span) + path.TangentAt(span) * (arc - span); } private void Cross(float along) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) float num = path.Span / 9f; while (crossed < panes.Count && ((float)crossed + 0.5f) * num <= along) { NaoyaPane naoyaPane = NaoyaPanes.At(panes, crossed); float arc = ((float)crossed + 0.5f) * num; crossed++; if (Object.op_Implicit((Object)(object)naoyaPane)) { naoyaPane.Break(path.TangentAt(arc), 0f); } } int num2 = Inside(found, 0f, along); int num3 = 0; for (int i = 0; i < num2; i++) { CharacterBody val = found[i]; if (Object.op_Implicit((Object)(object)val) && !broken.Contains(val)) { broken.Add(val); num3++; Shatter(val, arcs[i]); } } if (num3 > 0 && ((EntityState)this).isAuthority) { spent += num3; NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(0.5f); } } } private void Shatter(CharacterBody victim, float arc) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) Vector3 corePosition = victim.corePosition; Vector3 val = path.TangentAt(arc); NaoyaGlassCase.Break(victim); JujutsuImpact.Strike(corePosition, val, NaoyaLanguage.Colour, NaoyaFx.Reach(((EntityState)this).characterBody, 2.1f), JujutsuFxScale.Weight(8f), false, true); JujutsuMotes.Burst(corePosition, val, NaoyaLanguage.Colour, NaoyaFx.Reach(((EntityState)this).characterBody, 1.5f), (JujutsuMoteKind)2, 8); JujutsuGlassSfx.PlayShatter(corePosition, 1.8000001f, 0.3f); if (!NetworkServer.active) { return; } HealthComponent healthComponent = victim.healthComponent; if (!Object.op_Implicit((Object)(object)healthComponent)) { return; } int num; if (Object.op_Implicit((Object)(object)NaoyaBuffs.Framed)) { num = (victim.HasBuff(NaoyaBuffs.Framed) ? 1 : 0); if (num != 0) { goto IL_00c3; } } else { num = 0; } if (Object.op_Implicit((Object)(object)NaoyaBuffs.Cracked) && victim.HasBuff(NaoyaBuffs.Cracked)) { goto IL_00c3; } float num2 = 1f; goto IL_00c8; IL_00c3: num2 = 1.4f; goto IL_00c8; IL_00c8: float num3 = num2; NaoyaFilm.ShatterFrame(victim); NaoyaHold.LetGo(victim); GojoDamageUtility.ApplyDamage(((EntityState)this).gameObject, healthComponent, ((BaseState)this).damageStat * 8f * num3, val * 2400f + Vector3.up * 700f, ((BaseState)this).RollCrit(), 1f, DamageTypeCombo.GenericUtility | DamageTypeCombo.op_Implicit((DamageType)1024), (DamageColorIndex)0, (Color?)NaoyaLanguage.Colour, (float?)null); if (num != 0) { for (int i = 0; i < 3; i++) { DotController.InflictDot(((Component)victim).gameObject, ((EntityState)this).gameObject, (HurtBox)null, (DotIndex)0, 5f, 1f, (uint?)null); } } } private int Inside(List into, float from, float to) { //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_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_0088: 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) into.Clear(); arcs.Clear(); ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return 0; } TeamIndex team = ((BaseState)this).GetTeam(); 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 != team && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { float num = 3f + val.radius; if (path.Anywhere(val.corePosition, num) && !(path.Closest(val.corePosition, from, to, out var at) > num)) { into.Add(val); arcs.Add(at); } } } return into.Count; } private void Finish(bool ranOut) { //IL_009b: 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_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_006d: 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_0084: Unknown result type (might be due to invalid IL or missing references) if (ranOut) { Cross(path.Span); } finished = true; finishedAt = ((EntityState)this).fixedAge; Release(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x *= 1f; velocity.z *= 1f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; ((EntityState)this).characterMotor.disableAirControlUntilCollision = true; } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.7f); NaoyaFx.Afterimage(((EntityState)this).characterBody, path.TangentAt(progress)); if (((EntityState)this).isAuthority) { Plugin.Log.LogInfo((object)(ranOut ? ($"Naoya ran his corridor out — {progress:0.#}m of " + $"{path.Span:0.#}m — and broke {spent} of the {sealed_} " + "frame(s) it laid for " + StatText.Percent(8f) + " each.") : ($"Naoya's corridor was stopped after {progress:0.#}m " + $"of {path.Span:0.#}m; {spent} of {sealed_} frame(s) " + "were broken and the rest stand where they were laid.")), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaCorridorState.cs"); } } private void Release() { if (gravityHeld) { gravityHeld = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = true; } } } private void Tail() { //IL_001b: 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; } if (((EntityState)this).fixedAge >= finishedAt + 0.12f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0051: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (running && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && path != null) { Cross(path.Advance(((EntityState)this).characterBody.corePosition, progress, path.Span)); } NaoyaPanes.Close(panes, flat, finished: false); if (!finished && running && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; } Release(); if (fallsIgnored) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false, true); fallsIgnored = false; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class NaoyaCurseFlightState : GenericCharacterMain { private bool pressedJumpWhileHoldingSprint; private bool countersRaised; private float restoreAirControl; public override void OnEnter() { //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_0034: 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_0058: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).OnEnter(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { CharacterGravityParameters gravityParameters = ((EntityState)this).characterMotor.gravityParameters; gravityParameters.channeledAntiGravityGranterCount++; ((EntityState)this).characterMotor.gravityParameters = gravityParameters; CharacterFlightParameters flightParameters = ((EntityState)this).characterMotor.flightParameters; flightParameters.channeledFlightGranterCount++; ((EntityState)this).characterMotor.flightParameters = flightParameters; countersRaised = true; restoreAirControl = ((EntityState)this).characterMotor.airControl; ((EntityState)this).characterMotor.airControl = 1f; if (Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } } if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator)) { ((EntityState)this).modelLocator.normalizeToFloor = false; } } 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) //IL_0033: 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_0057: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && countersRaised) { CharacterGravityParameters gravityParameters = ((EntityState)this).characterMotor.gravityParameters; gravityParameters.channeledAntiGravityGranterCount--; ((EntityState)this).characterMotor.gravityParameters = gravityParameters; CharacterFlightParameters flightParameters = ((EntityState)this).characterMotor.flightParameters; flightParameters.channeledFlightGranterCount--; ((EntityState)this).characterMotor.flightParameters = flightParameters; ((EntityState)this).characterMotor.airControl = restoreAirControl; countersRaised = false; } ((GenericCharacterMain)this).OnExit(); } public override void GatherInputs() { ((GenericCharacterMain)this).GatherInputs(); if (!((BaseCharacterMain)this).hasInputBank) { return; } if (((EntityState)this).inputBank.jump.down) { if (((EntityState)this).inputBank.sprint.down) { pressedJumpWhileHoldingSprint = true; } base.moveVector.y = 1f; } else if (!((EntityState)this).inputBank.sprint.down) { pressedJumpWhileHoldingSprint = false; } if (((EntityState)this).inputBank.sprint.down && !pressedJumpWhileHoldingSprint) { base.moveVector.y = -1f; } if (((Vector3)(ref base.moveVector)).sqrMagnitude > 1f) { ((Vector3)(ref base.moveVector)).Normalize(); } } public override void ProcessJump() { } } public sealed class NaoyaDomainState : BaseSkillState, IPosedState { internal const float CastDuration = 2.5f; private Vector3 lockedFacing; private bool activated; private bool gravitySuspended; private GojoFaceCamera faceCamera; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)17; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0.06f; float IPosedState.PosePitch => -8f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 30; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 2.5f); public override void OnEnter() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(3f); Vector3 val; Vector3 normalized; if (!Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { val = Vector3.ProjectOnPlane(((EntityState)this).characterBody.transform.forward, Vector3.up); normalized = ((Vector3)(ref val)).normalized; } else { val = Vector3.ProjectOnPlane(((EntityState)this).characterDirection.forward, Vector3.up); normalized = ((Vector3)(ref val)).normalized; } lockedFacing = normalized; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.useGravity) { gravitySuspended = true; ((EntityState)this).characterMotor.useGravity = false; } LockMovement(); if (((EntityState)this).isAuthority) { faceCamera = GojoFaceCamera.Push(((EntityState)this).characterBody); } RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Push(); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 1f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); LockMovement(); if (!activated && ((EntityState)this).fixedAge >= 2.5f) { activated = true; Open(); } if (((EntityState)this).fixedAge >= 2.5f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Open() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Vector3 corePosition = ((EntityState)this).characterBody.corePosition; ((Component)((EntityState)this).characterBody).GetComponent()?.Activate(corePosition, ((BaseState)this).damageStat); DomainBarrierVisual.SpawnSeal(corePosition, NaoyaDomainField.Colour, 28f, (GojoTechniqueStyle)4); JujutsuSfxAssets.PlayMeleeHeavy(corePosition); } private void LockMovement() { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = Vector3.zero; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Vector3)(ref lockedFacing)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.moveVector = lockedFacing; ((EntityState)this).characterDirection.forward = lockedFacing; } } } public override void OnExit() { if (gravitySuspended) { gravitySuspended = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = true; } } if ((Object)(object)faceCamera != (Object)null) { faceCamera.Release(); faceCamera = null; } RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Pop(); } if (!activated && ((EntityState)this).isAuthority) { CursedEnergySkillDef.Refund(((BaseSkillState)this).activatorSkillSlot); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class NaoyaBleedoutState : BaseSkillState { internal const float Coefficient = 6.5f; internal const float Reach = 42f; internal const float Corridor = 1.9f; internal const int Stacks = 3; internal const float BleedSeconds = 5f; internal const float HemorrhageSeconds = 7f; private const float Duration = 0.66f; private const float Contact = 0.44f; private const float Travel = 1.1f; private const float Ripple = 0.19f; private const int Frames = 10; private const string Wound = "naoya-bleedout"; private float duration; private Vector3 origin; private Vector3 heading; private bool struck; private bool fromWire; private float stabbedAt; private int broken; private readonly List panes = new List(10); internal static void Initialize() { JujutsuHitSync.Register("naoya-bleedout", 50f, (Action)Bleed); } 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_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_0103: 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) ((BaseState)this).OnEnter(); Vector3 val; if (!fromWire) { Ray aimRay = ((BaseState)this).GetAimRay(); val = ((Ray)(ref aimRay)).direction; heading = ((Vector3)(ref val)).normalized; if (((Vector3)(ref heading)).sqrMagnitude < 0.01f) { heading = ((EntityState)this).characterBody.transform.forward; } origin = ((EntityState)this).characterBody.corePosition; } duration = 0.66f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(duration + 0.2f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { val = Vector3.ProjectOnPlane(heading, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = normalized; } } GojoModelAnimator val2 = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val2)) { val2.TriggerPunch(true, duration, 1, 0.44f); } JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.7f); } public override void OnSerialize(NetworkWriter writer) { //IL_0009: 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) ((BaseSkillState)this).OnSerialize(writer); writer.Write(origin); writer.Write(heading); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); origin = reader.ReadVector3(); heading = reader.ReadVector3(); fromWire = true; } public override void FixedUpdate() { //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_0038: 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) ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.45f); CharacterMotor characterMotor = ((EntityState)this).characterMotor; bool isAuthority = ((EntityState)this).isAuthority; Vector3 val = Vector3.ProjectOnPlane(heading, Vector3.up); GojoStateUtils.GlideIntoBlow(characterMotor, isAuthority, ((Vector3)(ref val)).normalized, 1.1f, ((EntityState)this).fixedAge, duration, 0.44f, false); if (!struck && ((EntityState)this).fixedAge >= duration * 0.44f) { Stab(); } else if (struck) { Ripples(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Ripples() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.CeilToInt((((EntityState)this).fixedAge - stabbedAt) / 0.19f * (float)panes.Count); while (broken < num && broken < panes.Count) { NaoyaPane naoyaPane = panes[broken++]; if (Object.op_Implicit((Object)(object)naoyaPane) && !naoyaPane.Spent) { naoyaPane.Break(heading, 0f); } } } private void Stab() { //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_001f: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) struck = true; stabbedAt = ((EntityState)this).fixedAge; Vector3 corePosition = ((EntityState)this).characterBody.corePosition; Vector3 val = corePosition + heading * 42f; NaoyaPanes.Line(panes, ((EntityState)this).characterBody, corePosition, heading, 42f, 10, NaoyaLanguage.Colour, 0.69f); if (((EntityState)this).isAuthority) { Prepared val2 = BlackFlash.Roll(1f, ((EntityState)this).characterBody); int num = 0; float num2 = 3.8f; int num3 = Mathf.CeilToInt(42f / num2); for (int i = 0; i < num3; i++) { Vector3 val3 = corePosition + heading * (num2 * ((float)i + 0.5f)); float num4 = NaoyaFilm.Weigh(((BaseState)this).GetTeam(), val3, 1.9f); num += GojoMeleeAttackUtility.Fire(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), val3, 1.9f, ((BaseState)this).damageStat * 6.5f * num4 * ((Prepared)(ref val2)).Multiplier, heading * 400f + Vector3.up * 90f, ((BaseState)this).RollCrit() || ((Prepared)(ref val2)).Landed, DamageTypeCombo.GenericSecondary); } if (num > 0) { if (((Prepared)(ref val2)).Landed) { BlackFlash.Land(corePosition + heading * 4f, "Naoya", true); } NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(4f); } JujutsuHitSync.Request(((EntityState)this).characterBody, "naoya-bleedout", corePosition, val, 1.9f, false); } } JujutsuImpact.Cut(corePosition, heading * 42f, NaoyaLanguage.Colour, 42f, JujutsuFxScale.Weight(6.5f)); JujutsuMotes.Burst(corePosition + heading * 3f, heading, NaoyaLanguage.Colour, NaoyaFx.Reach(((EntityState)this).characterBody, 2.6599998f), (JujutsuMoteKind)2, 9); JujutsuSfxAssets.PlaySlash(corePosition + heading * 2f, 0.78f); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.04f, false); } public override void OnExit() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) NaoyaPanes.Close(panes, heading, struck); ((EntityState)this).OnExit(); } private static void Bleed(CharacterBody attacker, Vector3 from, Vector3 to, float radius, bool unusedFlash) { //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_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_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_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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)attacker)) { return; } TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)attacker.teamComponent)) ? 1 : ((int)attacker.teamComponent.teamIndex)); ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } int num = 0; int num2 = 0; for (int i = 0; i < readOnlyInstancesList.Count; i++) { CharacterBody val2 = readOnlyInstancesList[i]; if (!Object.op_Implicit((Object)(object)val2) || (Object)(object)val2.teamComponent == (Object)null || val2.teamComponent.teamIndex == val || !Object.op_Implicit((Object)(object)val2.healthComponent) || !val2.healthComponent.alive) { continue; } Vector3 val3 = ClosestPointOnSegment(from, to, val2.corePosition); float num3 = radius + val2.radius; Vector3 val4 = val2.corePosition - val3; if (!(((Vector3)(ref val4)).sqrMagnitude > num3 * num3)) { bool flag = Object.op_Implicit((Object)(object)Buffs.Bleeding) && val2.HasBuff(Buffs.Bleeding); for (int j = 0; j < 3; j++) { DotController.InflictDot(((Component)val2).gameObject, ((Component)attacker).gameObject, (HurtBox)null, (DotIndex)0, 5f, 1f, (uint?)null); } num++; if (flag) { DotController.InflictDot(((Component)val2).gameObject, ((Component)attacker).gameObject, (HurtBox)null, (DotIndex)6, 7f, 1f, (uint?)null); num2++; } } } if (num > 0) { Plugin.Log.LogInfo((object)($"Naoya's blade opened {num} body/bodies for " + $"{3} stacks each; {num2} of them were already " + "bleeding and are hemorrhaging."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaSideStates.cs"); } } private static Vector3 ClosestPointOnSegment(Vector3 start, Vector3 end, Vector3 point) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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) Vector3 val = end - start; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < 0.0001f) { return start; } float num = Mathf.Clamp01(Vector3.Dot(point - start, val) / sqrMagnitude); return start + val * num; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class NaoyaSidestepState : BaseSkillState { internal const float Metres = 12f; internal const float Duration = 0.25f; private const float Push = 0.35f; private const float SmearInterval = 0.05f; private Vector3 heading; private Vector3 facing; private bool fromWire; private bool fallsIgnored; public override void OnEnter() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_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) ((BaseState)this).OnEnter(); if (!fromWire) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = Vector3.ProjectOnPlane(((Ray)(ref aimRay)).direction, Vector3.up); facing = ((Vector3)(ref val)).normalized; if (((Vector3)(ref facing)).sqrMagnitude < 0.01f) { facing = ((EntityState)this).characterBody.transform.forward; } NaoyaSidestep component = ((Component)((EntityState)this).characterBody).GetComponent(); val = Vector3.Cross(Vector3.up, facing); heading = ((Vector3)(ref val)).normalized * (Object.op_Implicit((Object)(object)component) ? component.Side : 1f); } ((EntityState)this).characterBody.SetAimTimer(0.45f); Aim(); JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true, false); fallsIgnored = true; JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.75f); NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); } public override void OnSerialize(NetworkWriter writer) { //IL_0009: 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) ((BaseSkillState)this).OnSerialize(writer); writer.Write(heading); writer.Write(facing); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); heading = reader.ReadVector3(); facing = reader.ReadVector3(); fromWire = true; } public override void FixedUpdate() { //IL_0019: 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) ((EntityState)this).FixedUpdate(); Aim(); GojoStateUtils.GlideIntoBlow(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, heading, 12f, ((EntityState)this).fixedAge, 0.25f, 0.35f, false); if (Mathf.Repeat(((EntityState)this).fixedAge, 0.05f) < Time.fixedDeltaTime) { NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); } if (((EntityState)this).fixedAge >= 0.25f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Aim() { //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_003f: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Vector3)(ref facing)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.moveVector = facing; ((EntityState)this).characterDirection.forward = facing; } } public override void OnExit() { if (fallsIgnored) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false, false); fallsIgnored = false; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class NaoyaSealedState : BaseState { public float duration = 0.75f; public override void OnEnter() { //IL_002c: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e1: 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_00f8: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); NaoyaGlassCase.Stand(((EntityState)this).characterBody, Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward, duration); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.isSprinting = false; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = Vector3.zero; Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; } } public override void FixedUpdate() { //IL_0022: 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) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = Vector3.zero; } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnSerialize(NetworkWriter writer) { ((EntityState)this).OnSerialize(writer); writer.Write(duration); } public override void OnDeserialize(NetworkReader reader) { ((EntityState)this).OnDeserialize(reader); duration = reader.ReadSingle(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } public sealed class NaoyaKickState : BaseSkillState { private static readonly float[] StepDurations = new float[3] { 0.32f, 0.3f, 0.42f }; private static readonly float[] StepDamage = new float[3] { 1.1f, 1.2f, 1.9f }; private static readonly float[] StepImpact = new float[3] { 2.4f, 2.5f, 4.1f }; private static readonly float[] StepRadius = new float[3] { 2.7f, 2.7f, 3.4f }; private static readonly float[] StepContact = new float[3] { 0.48f, 0.42f, 0.54f }; private static readonly float[] StepTravel = new float[3] { 1.3f, 1.3f, 2.2f }; private const int FinisherStep = 2; private float duration; private Vector3 aimDirection; private bool struck; 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_00cf: 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_00e9: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); step = Mathf.Clamp(Object.op_Implicit((Object)(object)naoyaFilm) ? naoyaFilm.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; ((EntityState)this).characterBody.SetAimTimer(duration + 0.2f); GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerPunch(step != 0, duration, step, StepContact[step]); } JujutsuSfxAssets.PlayMeleeLight(((EntityState)this).characterBody.corePosition); if (step == 2) { JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.7f); } else { JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.55f); } } public override void FixedUpdate() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0235: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.8f); GojoStateUtils.GlideIntoBlow(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, aimDirection, StepTravel[step], ((EntityState)this).fixedAge, duration, StepContact[step], false); if (struck || ((EntityState)this).fixedAge < duration * StepContact[step]) { if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } 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.2f; if (((EntityState)this).isAuthority) { Prepared val4 = BlackFlash.Roll(1f, ((EntityState)this).characterBody); float num = NaoyaFilm.Weigh(((BaseState)this).GetTeam(), val3, StepRadius[step]); if (GojoMeleeAttackUtility.Fire(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), val3, StepRadius[step], ((BaseState)this).damageStat * StepDamage[step] * num * ((Prepared)(ref val4)).Multiplier, val2 * ((step == 2) ? 4200f : 800f) + Vector3.up * ((step == 2) ? 1000f : 110f), ((BaseState)this).RollCrit() || ((Prepared)(ref val4)).Landed, DamageTypeCombo.GenericPrimary) > 0) { if (((Prepared)(ref val4)).Landed) { BlackFlash.Land(val3, "Naoya", true); } NaoyaFilm.ReportHit(((EntityState)this).characterBody); JujutsuSfxAssets.PlayMeleeHeavy(val3); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee((step == 2) ? 5f : 3f); } } } float num2 = NaoyaFx.Reach(((EntityState)this).characterBody, StepRadius[step]); JujutsuImpact.Strike(val3, val2, NaoyaLanguage.Colour, num2, JujutsuFxScale.Weight(StepImpact[step]), false, true); if (step == 2) { JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.05f, false); JujutsuMotes.Burst(val3, val2, NaoyaLanguage.Colour, num2 * 0.7f, (JujutsuMoteKind)2, 10); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class NaoyaPalmState : BaseSkillState { internal const float Coefficient = 3f; internal const float Forward = 4f; internal const float Radius = 4.6f; private const float Duration = 0.44f; private const float Contact = 0.42f; private const float Travel = 1.4f; private float duration; private Vector3 heading; private Vector3 point; private bool laid; private bool fromWire; 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f0: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (!fromWire) { 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; } point = Aimed(4f, 4.6f); } duration = 0.44f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(duration + 0.2f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = heading; } GojoModelAnimator val2 = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val2)) { val2.TriggerPunch(true, duration, 0, 0.42f); } JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.8f); } public override void OnSerialize(NetworkWriter writer) { //IL_0009: 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) ((BaseSkillState)this).OnSerialize(writer); writer.Write(heading); writer.Write(point); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnDeserialize(reader); heading = reader.ReadVector3(); point = reader.ReadVector3(); fromWire = true; } public override void FixedUpdate() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.4f); GojoStateUtils.GlideIntoBlow(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, heading, 1.4f, ((EntityState)this).fixedAge, duration, 0.42f, false); if (!laid && ((EntityState)this).fixedAge >= duration * 0.42f) { Lay(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private Vector3 Aimed(float forward, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_0023: 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_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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 corePosition = ((EntityState)this).characterBody.corePosition; Vector3 val = ((Ray)(ref aimRay)).direction; Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.01f) { normalized = heading; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; TeamIndex team = ((BaseState)this).GetTeam(); CharacterBody val2 = null; float num = float.MaxValue; int num2 = 0; while (readOnlyInstancesList != null && num2 < readOnlyInstancesList.Count) { CharacterBody val3 = readOnlyInstancesList[num2]; if (Object.op_Implicit((Object)(object)val3) && !((Object)(object)val3.teamComponent == (Object)null) && val3.teamComponent.teamIndex != team && Object.op_Implicit((Object)(object)val3.healthComponent) && val3.healthComponent.alive) { Vector3 val4 = val3.corePosition - corePosition; float num3 = Vector3.Dot(val4, normalized); if (!(num3 <= 0f) && !(num3 > forward + val3.radius) && !(num3 >= num)) { val = val4 - normalized * num3; if (!(((Vector3)(ref val)).magnitude - val3.radius > radius)) { num = num3; val2 = val3; } } } num2++; } if (!Object.op_Implicit((Object)(object)val2)) { return corePosition + normalized * forward; } return val2.corePosition; } private void Lay() { //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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0088: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) laid = true; NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); float num = (Object.op_Implicit((Object)(object)naoyaFilm) ? naoyaFilm.FreezeLength : 1f); NaoyaFilm.Freeze(((BaseState)this).GetTeam(), point, 4.6f, num, ((EntityState)this).characterBody); if (((EntityState)this).isAuthority && GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), point, 4.6f, ((BaseState)this).damageStat * 3f, 0f, 0f, ((BaseState)this).RollCrit(), DamageTypeCombo.GenericSecondary) > 0) { NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(4f); } } float num2 = NaoyaFx.Reach(((EntityState)this).characterBody, 4.6f); JujutsuImpact.Strike(point, heading, NaoyaLanguage.Colour, num2, JujutsuFxScale.Weight(3f), false, true); JujutsuMotes.Burst(point, heading, NaoyaLanguage.Colour, num2 * 0.8f, (JujutsuMoteKind)2, 14); JujutsuSfxAssets.PlayMeleeHeavy(point); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.06f, false); if (Seal(point, 4.6f, num) <= 0) { NaoyaPanes.Draw(point, -heading, 3.4499998f, 4.6f, NaoyaLanguage.Colour, num, NaoyaPanes.SeedFrom(point)); if (((EntityState)this).isAuthority) { Plugin.Log.LogInfo((object)("Naoya's palm reached nothing: " + StatText.Metres(4.6f) + " round a point " + $"{Vector3.Distance(point, ((EntityState)this).characterBody.corePosition):0.#}m " + "out, so the frame is drawn round the volume rather than round a body."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } } private int Seal(Vector3 point, float radius, float seconds) { //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_0028: 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) List list = new List(8); int num = NaoyaSeal.Sealed(((BaseState)this).GetTeam(), point, radius, list); if (num <= 0) { return 0; } for (int i = 0; i < list.Count && i < 16; i++) { NaoyaGlassCase.Stand(list[i], heading, seconds); } if (((EntityState)this).isAuthority) { NaoyaSeal.Of(((EntityState)this).characterBody)?.Open(point, radius, seconds, 9f); } return num; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class NaoyaShatterState : BaseSkillState { internal const float Coefficient = 9f; internal const float BleedSeconds = 5f; internal const int SealedBleeds = 3; private const float Duration = 0.34f; private const float Contact = 0.3f; internal const float Force = 2400f; internal const float Lift = 700f; private Vector3 centre; private float radius; private float payload = 9f; private bool fromWire; private bool opened; private bool broken; private bool Hollow => radius <= 0f; public override void OnEnter() { //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) ((BaseState)this).OnEnter(); if (!fromWire) { NaoyaSeal naoyaSeal = NaoyaSeal.Of(((EntityState)this).characterBody); if (!Object.op_Implicit((Object)(object)naoyaSeal) || !naoyaSeal.Take(out centre, out radius, out payload)) { centre = ((EntityState)this).characterBody.corePosition; radius = 0f; payload = 9f; } } } private void Wind() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) opened = true; if (NetworkServer.active) { NaoyaHold.LetGoAllSealedBy(((EntityState)this).characterBody, centre, radius + 1.4f); } ((EntityState)this).characterBody.SetAimTimer(0.54f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = Vector3.ProjectOnPlane(centre - ((EntityState)this).characterBody.corePosition, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; } } GojoModelAnimator val2 = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val2)) { val2.TriggerPunch(false, 0.34f, 0, 0.3f); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.85f); } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(centre); writer.Write(radius); writer.Write(payload); } public override void OnDeserialize(NetworkReader reader) { //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) ((BaseSkillState)this).OnDeserialize(reader); centre = reader.ReadVector3(); radius = reader.ReadSingle(); payload = reader.ReadSingle(); fromWire = true; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority && !fromWire) { return; } if (Hollow) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } if (!opened) { Wind(); } GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.5f); if (!broken && ((EntityState)this).fixedAge >= 0.102000006f) { Break(); } if (((EntityState)this).fixedAge >= 0.34f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Break() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: 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_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_023b: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0134: Unknown result type (might be due to invalid IL or missing references) broken = true; float num = radius + 1.4f; float num2 = NaoyaFilm.Weigh(((BaseState)this).GetTeam(), centre, num); List list = new List(8); NaoyaSeal.Sealed(((BaseState)this).GetTeam(), centre, num, list); for (int i = 0; i < list.Count; i++) { CharacterBody val = list[i]; if (Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) && Object.op_Implicit((Object)(object)val) && val.HasBuff(NaoyaBuffs.Framed)) { Cuts(val); } NaoyaFilm.ShatterFrame(val); NaoyaHold.LetGo(val); NaoyaGlassCase.Break(val); } if (((EntityState)this).isAuthority) { Prepared val2 = BlackFlash.Roll(1f, ((EntityState)this).characterBody); int num3 = GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), centre, num, ((BaseState)this).damageStat * payload * num2 * ((Prepared)(ref val2)).Multiplier, 2400f, 700f, ((BaseState)this).RollCrit() || ((Prepared)(ref val2)).Landed, DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)1024)); if (num3 > 0) { if (((Prepared)(ref val2)).Landed) { BlackFlash.Land(centre, "Naoya", true); } NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(5f); } } Plugin.Log.LogInfo((object)($"Naoya breaks his frame over {num:0.#}m and hits " + $"{num3} for {StatText.Percent(payload)}" + ((num2 > 1f) ? $" x{num2:0.00} against what was still in it." : ".")), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } float num4 = NaoyaFx.Reach(((EntityState)this).characterBody, num); JujutsuImpact.Detonate(centre, NaoyaLanguage.Colour, num4, JujutsuFxScale.Weight(payload), false, true); JujutsuMotes.Burst(centre, Vector3.up, NaoyaLanguage.Colour, num4 * 0.8f, (JujutsuMoteKind)2, 18); JujutsuFxDebris.Throw(centre, Vector3.up, NaoyaGlass.Seam, num * 0.5f, 8, 0f, 1f); JujutsuGlassSfx.PlayShatter(centre, num, 0.45000002f); JujutsuSfxAssets.PlayMeleeHeavy(centre); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.09f, false); } private void Cuts(CharacterBody victim) { if (NetworkServer.active && Object.op_Implicit((Object)(object)victim)) { for (int i = 0; i < 3; i++) { DotController.InflictDot(((Component)victim).gameObject, ((EntityState)this).gameObject, (HurtBox)null, (DotIndex)0, 5f, 1f, (uint?)null); } } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class NaoyaTraceState : BaseSkillState, IPosedState { internal const float KeySeconds = 2.5f; internal const float StepSeconds = 1f / 12f; internal const float MinSpeed = 40f; internal const float MaxSpeed = 90f; internal const float MaxStep = 7.5f; internal const float MinStep = 3.3333335f; internal const int FramesPerSegment = 4; internal const float Coefficient = 10f; private const float Corridor = 2.6f; internal const float QuickSeconds = 0.8f; internal const float SlowSeconds = 1.8f; internal const float SpeedGain = 14f; internal const float SpeedBleed = 8f; internal const float PaceDamageBonus = 0.5f; internal const float TurnLimit = 70f; private const float StallFraction = 0.5f; private const int StepGraceTicks = 3; private const float TrailShare = 0.8f; internal const float CompletionShare = 0.25f; internal const float SelfFreezeSeconds = 0.75f; private const float SegmentCeiling = 3f; private const float StrideRate = 15f; private Vector3 heading; private bool fromWire; private Vector3 origin; private Vector3 lastPoint; private Vector3 lastBlow; private float travelled; private float covered; private bool fallsIgnored; private int segment = 1; private int tracedFrames; private float segmentStartedAt; private NaoyaTraceCheck.Way asked; private bool attempted; private readonly NaoyaTraceCheck.Way[] queue = new NaoyaTraceCheck.Way[4]; private float speed = 40f; private NaoyaTraceCheck.Way pressed; private bool downHeld; private bool leftHeld; private bool rightHeld; private float litAt; private float answeredIn; private bool bailed; private bool jumpHeld; private bool shiftHeld; private bool leftEarly; private const float ExitSpeedShare = 0.2f; private NaoyaTraceCheck check; private Vector3 lastGhost; private bool drawn; private float stride; private int stepAge = -1; private Vector3 lastSealAt; private bool sealing; private bool finished; private float finishedAt; private bool botched; private bool missed; bool IPosedState.DrivesPose => !finished; GojoCpuPose IPosedState.Pose => (GojoCpuPose)3; float IPosedState.PosePhase => stride; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => 0f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 20; private float Burst => StepSpan / Mathf.Max(0.0001f, Time.fixedDeltaTime); private float StepSpan => speed * (1f / 12f); private float Elapsed => ((EntityState)this).fixedAge - segmentStartedAt; private float Pace => Mathf.InverseLerp(40f, 90f, speed); public override void OnEnter() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: 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_00c1: 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) ((BaseState)this).OnEnter(); if (!fromWire) { heading = Aim(first: true); } ((EntityState)this).characterBody.SetAimTimer(3.75f); Face(); origin = ((EntityState)this).characterBody.corePosition; lastPoint = origin; lastBlow = origin; GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.ClearAttackPose(); } check = (((EntityState)this).isAuthority ? ((Component)((EntityState)this).characterBody).GetComponent() : null); jumpHeld = true; shiftHeld = true; Hands(); JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true, false); fallsIgnored = true; OpenCheck(first: true); JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.9f); NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); } private void Face() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = Vector3.ProjectOnPlane(heading, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; } } } private void Drive() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; float num = (((EntityState)this).characterMotor.isGrounded ? 0f : Mathf.Min(0f, ((EntityState)this).characterMotor.velocity.y)); ((EntityState)this).characterMotor.velocity = heading * Burst + Vector3.up * num; } } private void Hold() { //IL_0006: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).characterMotor.moveDirection = Vector3.zero; Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; } private void SealAlong(Vector3 here) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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_008c: 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_00a2: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || finished) { return; } if (!sealing) { sealing = true; lastSealAt = here; return; } Vector3 val = here - lastSealAt; float num = ((Vector3)(ref val)).magnitude; if (!(num < 5.2f)) { Vector3 val2 = val / num; NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); float num2 = (Object.op_Implicit((Object)(object)naoyaFilm) ? naoyaFilm.FreezeLength : 1f); int num3 = 0; while (num >= 5.2f) { lastSealAt += val2 * 5.2f; num -= 5.2f; num3 += NaoyaFilm.Freeze(((BaseState)this).GetTeam(), lastSealAt, 2.6f, num2, ((EntityState)this).characterBody); } if (num3 > 0) { Plugin.Log.LogInfo((object)($"Naoya's trace ran through {num3} body/bodies on line " + $"{segment}; they are sealed where he passed for " + $"{num2:0.##}s."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } } private Vector3 Aim(bool first) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_00a2: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; Vector3 val2 = Vector3.ProjectOnPlane(((Vector3)(ref val)).normalized, Vector3.up); if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { val2 = Vector3.ProjectOnPlane(first ? ((EntityState)this).characterBody.transform.forward : heading, Vector3.up); } if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { if (!first) { return heading; } val = Vector3.ProjectOnPlane(((EntityState)this).characterBody.transform.forward, Vector3.up); return ((Vector3)(ref val)).normalized; } ((Vector3)(ref val2)).Normalize(); if (!first) { return Held(val2); } return val2; } private Vector3 Held(Vector3 wanted) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_001f: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(heading, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { return wanted; } ((Vector3)(ref val)).Normalize(); float num = Vector3.SignedAngle(val, wanted, Vector3.up); if (Mathf.Abs(num) <= 70f) { return wanted; } return Quaternion.AngleAxis(Mathf.Sign(num) * 70f, Vector3.up) * val; } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(heading); } public override void OnDeserialize(NetworkReader reader) { //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) ((BaseSkillState)this).OnDeserialize(reader); heading = reader.ReadVector3(); fromWire = true; } public override void Update() { ((EntityState)this).Update(); if (!((EntityState)this).isAuthority) { stride = Mathf.Repeat(stride + Time.deltaTime * 15f, MathF.PI * 200f); } if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { return; } bool down = ((EntityState)this).inputBank.skill3.down; if (down && !shiftHeld) { if (!finished) { bailed = true; } ((EntityState)this).inputBank.skill3.hasPressBeenClaimed = true; } shiftHeld = down; if (finished) { return; } Latch(((EntityState)this).inputBank.rawMoveDown.down, ref downHeld, NaoyaTraceCheck.Way.Down); Latch(((EntityState)this).inputBank.rawMoveLeft.down, ref leftHeld, NaoyaTraceCheck.Way.Left); Latch(((EntityState)this).inputBank.rawMoveRight.down, ref rightHeld, NaoyaTraceCheck.Way.Right); bool down2 = ((EntityState)this).inputBank.jump.down; if (down2 && !jumpHeld) { if (!finished) { bailed = true; } ((EntityState)this).inputBank.jump.hasPressBeenClaimed = true; } jumpHeld = down2; } private void Latch(bool down, ref bool held, NaoyaTraceCheck.Way way) { if (down && !held && pressed == NaoyaTraceCheck.Way.None) { pressed = way; answeredIn = Mathf.Max(0f, Time.time - litAt); } held = down; } private void Hands() { if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { downHeld = ((EntityState)this).inputBank.rawMoveDown.down; leftHeld = ((EntityState)this).inputBank.rawMoveLeft.down; rightHeld = ((EntityState)this).inputBank.rawMoveRight.down; } } public override void FixedUpdate() { //IL_003c: 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_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_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_00b8: 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_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_00ce: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (finished) { Tail(); return; } if (!drawn) { drawn = true; lastGhost = ((EntityState)this).characterBody.corePosition; } Trail(((EntityState)this).characterBody.corePosition); SealAlong(((EntityState)this).characterBody.corePosition); if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).isAuthority && Elapsed >= 3f) { Finish(crashed: false); } return; } Vector3 corePosition = ((EntityState)this).characterBody.corePosition; if (bailed) { bailed = false; StepOff(); return; } Hold(); float num = travelled; Vector3 val = Vector3.ProjectOnPlane(corePosition - lastPoint, Vector3.up); travelled = num + ((Vector3)(ref val)).magnitude; lastPoint = corePosition; if (stepAge >= 0 && ++stepAge >= 3) { stepAge = -1; if (travelled < StepSpan * 0.5f) { Sweep(corePosition); Finish(crashed: true); return; } } Vector3 val2 = corePosition - lastBlow; float num2 = ((Vector3)(ref val2)).magnitude; if (num2 >= 5.2f) { Vector3 val3 = val2 / num2; while (num2 >= 5.2f) { lastBlow += val3 * 5.2f; num2 -= 5.2f; Sweep(lastBlow); } } float num3 = Elapsed / 2.5f; check?.Advance(1f - Mathf.Clamp01(num3), tracedFrames); if (pressed != NaoyaTraceCheck.Way.None) { NaoyaTraceCheck.Way answer = pressed; pressed = NaoyaTraceCheck.Way.None; if (Attempt(answer, answeredIn)) { return; } } if (num3 >= 1f || Elapsed >= 3f) { Finish(crashed: false); Plugin.Log.LogInfo((object)($"Naoya let a letter go on line {segment} with " + $"{tracedFrames} frames traced; the run ends where he " + "stopped and nothing is charged."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } private void Coast() { //IL_0058: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = heading * speed * 0.2f + Vector3.up * ((EntityState)this).characterMotor.velocity.y; } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.7f); NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); } private void StepOff() { leftEarly = true; bool num = stepAge >= 0; Finish(crashed: false); if (num) { Coast(); } Plugin.Log.LogInfo((object)($"Naoya stepped off his trace on line {segment} with " + $"{tracedFrames} frames traced; the line he was running banks " + "nothing and nothing else is charged."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } private bool Attempt(NaoyaTraceCheck.Way answer, float took) { if (attempted) { return false; } attempted = true; if (answer != asked) { check?.Missed(); missed = true; Finish(crashed: false); Plugin.Log.LogInfo((object)($"Naoya was asked for {asked} and given {answer} after " + $"{took:0.###}s, so the run ends on line {segment} with " + $"{tracedFrames} frames traced — and he is sealed in his " + "own glass for it."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); return true; } if (!Buy()) { leftEarly = true; bool num = stepAge >= 0; Finish(crashed: false); if (num) { Coast(); } Plugin.Log.LogInfo((object)($"Naoya answered {asked} on line {segment} with nothing " + "left to spend on it — a step is " + $"{1.5f:0.#} energy — so " + $"the run ends there with {tracedFrames} frames traced."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); return true; } Bank(); Advance(Mathf.InverseLerp(1.8f, 0.8f, took)); return true; } private bool Buy() { CursedEnergyController val = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { return val.TrySpendPriced(1.5f); } return true; } private void Bank() { if (((EntityState)this).isAuthority) { tracedFrames = Mathf.Min(tracedFrames + 4, 24); NaoyaFilm.Of(((EntityState)this).characterBody)?.Trace(4); } } private void Advance(float pace) { //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_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_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_010c: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) bool first = segment == 1; segment++; float num = Mathf.Lerp(-8f, 14f, Mathf.Clamp01(pace)); bool num2 = num > 0f; speed = Mathf.Clamp(speed + num, 40f, 90f); heading = Aim(first); Face(); ((EntityState)this).characterBody.SetAimTimer(3.75f); origin = ((EntityState)this).characterBody.corePosition; lastPoint = origin; covered += travelled; travelled = 0f; stepAge = 0; Drive(); stride = Mathf.Repeat(stride + 1.25f, MathF.PI * 200f); lastGhost = origin; OpenCheck(first: false); NaoyaTraceCheck.Publish(((EntityState)this).characterBody, origin, heading, speed); JujutsuSfxAssets.PlayHeavyWhoosh(origin, Mathf.Lerp(0.85f, 1.15f, Pace)); NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); if (num2) { JujutsuMotes.Burst(origin, heading, NaoyaLanguage.Colour, NaoyaFx.Reach(((EntityState)this).characterBody, 1.2f), (JujutsuMoteKind)2, 8); } } private void RemoteSegment(Vector3 from, Vector3 along, float ran) { //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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!finished && !(((Vector3)(ref along)).sqrMagnitude < 0.0001f)) { segment++; speed = ((ran > 0f) ? ran : speed); heading = ((Vector3)(ref along)).normalized; origin = from; Face(); drawn = true; lastGhost = from; NaoyaFx.Afterimage(((EntityState)this).characterBody, heading); } } private void Trail(Vector3 here) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) float num = StepSpan * 0.8f; if (!(num < 0.01f)) { Vector3 val = Vector3.ProjectOnPlane(here - lastGhost, Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude < num * num)) { lastGhost = here; NaoyaGhosts.Cast(((EntityState)this).characterBody, NaoyaLanguage.Colour); JujutsuSfxAssets.PlayMeleeLight(here); } } } private void OpenCheck(bool first) { segmentStartedAt = ((EntityState)this).fixedAge; attempted = false; pressed = NaoyaTraceCheck.Way.None; litAt = Time.time; answeredIn = 0f; Hands(); Deal(first); asked = queue[0]; check?.Begin(queue, segment, tracedFrames, StepSpan); } private void Deal(bool first) { if (first) { queue[0] = Start(); for (int i = 1; i < queue.Length; i++) { queue[i] = After(queue[i - 1]); } } else { for (int j = 0; j < queue.Length - 1; j++) { queue[j] = queue[j + 1]; } queue[queue.Length - 1] = After(queue[queue.Length - 2]); } } private static NaoyaTraceCheck.Way After(NaoyaTraceCheck.Way letter) { return letter switch { NaoyaTraceCheck.Way.Left => NaoyaTraceCheck.Way.Down, NaoyaTraceCheck.Way.Down => NaoyaTraceCheck.Way.Right, _ => NaoyaTraceCheck.Way.Left, }; } private NaoyaTraceCheck.Way Start() { if (!leftHeld) { return NaoyaTraceCheck.Way.Left; } if (!downHeld) { return NaoyaTraceCheck.Way.Down; } if (!rightHeld) { return NaoyaTraceCheck.Way.Right; } return NaoyaTraceCheck.Way.Left; } private void Sweep(Vector3 at) { //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { float num = NaoyaFilm.Weigh(((BaseState)this).GetTeam(), at, 2.6f); float num2 = 1f + 0.5f * Pace; if (GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), at, 2.6f, ((BaseState)this).damageStat * 10f * num * num2, 600f, 260f, ((BaseState)this).RollCrit(), DamageTypeCombo.GenericUtility) > 0) { NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(0.5f); } } List list = new List(8); int num3 = NaoyaSeal.Sealed(((BaseState)this).GetTeam(), at, 2.6f, list); if (num3 > 0) { NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); float seconds = (Object.op_Implicit((Object)(object)naoyaFilm) ? naoyaFilm.FreezeLength : 1f); for (int i = 0; i < num3 && i < 16; i++) { NaoyaGlassCase.Stand(list[i], heading, seconds); } } } JujutsuMotes.Burst(at, -heading, NaoyaLanguage.Colour, NaoyaFx.Reach(((EntityState)this).characterBody, 1.8199999f), (JujutsuMoteKind)2, 5); } private void Finish(bool crashed) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) finished = true; finishedAt = ((EntityState)this).fixedAge; botched = missed || (crashed && travelled < StepSpan * 0.25f); check?.Close(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; } if (!botched) { if (((EntityState)this).isAuthority && !leftEarly && crashed) { Plugin.Log.LogInfo((object)($"Naoya's trace ran {segment} steps — " + $"{covered + travelled:0.#}m, the last one worth " + $"{StepSpan:0.#}m — and traced {tracedFrames} of " + $"{24} frames, stopped after " + $"{travelled:0.#}m of it — past the " + $"{StepSpan * 0.25f:0.#}m mark, so it costs " + "him nothing."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } return; } NaoyaFilm.Of(((EntityState)this).characterBody)?.Spend(); NaoyaFilm.AskSelfFrame(((EntityState)this).characterBody, 0.75f); SealLegs(); JujutsuSfxAssets.PlayMeleeHeavy(((EntityState)this).characterBody.corePosition); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.08f, false); NaoyaFx.Caught(((EntityState)this).characterBody); if (((EntityState)this).isAuthority) { Plugin.Log.LogInfo((object)(missed ? ($"Naoya answered line {segment} with the wrong key, " + "which is a movement he did not set; he is sealed in " + $"his own glass for {0.75f:0.##}s and the " + "film is gone.") : ($"Naoya's step {segment} was stopped after " + $"{travelled:0.#}m of {StepSpan:0.#}m, short of the " + $"{StepSpan * 0.25f:0.#}m mark; he is " + "sealed in his own glass for " + $"{0.75f:0.##}s by his own rule and the " + "film is gone.")), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } private void SealLegs() { if (((EntityState)this).isAuthority) { EntityStateMachine val = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Body"); if (!Object.op_Implicit((Object)(object)val)) { Plugin.Log.LogWarning((object)"Naoya botched a trace and has no Body state machine to hold him with; the glass and the film are still spent.", "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } else if (!val.SetInterruptState((EntityState)(object)new NaoyaSealedState { duration = 0.75f }, (InterruptPriority)7)) { Plugin.Log.LogWarning((object)("Naoya botched a trace and his body refused to be held — it is running " + (((object)val.state)?.GetType().Name ?? "nothing") + ", which outranks Frozen. The glass and the film are still spent."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } } private void Tail() { //IL_0037: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!botched) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; ((EntityState)this).characterMotor.velocity = velocity; } if (((EntityState)this).fixedAge >= finishedAt + 0.75f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } 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) //IL_0040: 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_0057: Unknown result type (might be due to invalid IL or missing references) if (!finished && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.x = 0f; velocity.z = 0f; velocity.y = Mathf.Min(0f, velocity.y); ((EntityState)this).characterMotor.velocity = velocity; } if (fallsIgnored) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false, false); fallsIgnored = false; } check?.Close(); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { if (finished && botched) { return (InterruptPriority)7; } return (InterruptPriority)2; } internal static void AcceptSegment(NetworkInstanceId bodyId, Vector3 origin, Vector3 heading, float speed, bool relayed) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(bodyId); if (Object.op_Implicit((Object)(object)val) && (!relayed || !NetworkServer.active) && !Util.HasEffectiveAuthority(val)) { EntityStateMachine val2 = EntityStateMachine.FindByCustomName(val, "Weapon"); if (Object.op_Implicit((Object)(object)val2) && val2.state is NaoyaTraceState naoyaTraceState) { naoyaTraceState.RemoteSegment(origin, heading, speed); } if (NetworkServer.active) { NaoyaTraceCheck.Publish(val.GetComponent(), origin, heading, speed, relayed: true); } } } } public sealed class NaoyaStompState : BaseSkillState { internal const float Coefficient = 12f; internal const float Radius = 14f; internal const float SealSeconds = 3.5f; internal const float FullFilmSealSeconds = 4.5f; internal const float BreakCoefficient = 15f; private const float Duration = 0.75f; private const float Contact = 0.55f; private const int RingPanes = 12; private const float RingLift = 1.8f; private const float PaneHalfWidth = 1.5f; private const float PaneHalfHeight = 2f; private const float MirrorBeat = 0.14f; private const float RingGapDegrees = 16f; private const float MirrorSpreadDegrees = 9f; private const float FenceFill = 0.5f; private float duration; private bool landed; public override void OnEnter() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = 0.75f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(duration + 0.2f); RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Push(); } GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerPunch(true, duration, 2, 0.55f); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 1f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.15f); if (!landed && ((EntityState)this).fixedAge >= duration * 0.55f) { Slam(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Slam() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_0221: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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) landed = true; Vector3 footPosition = ((EntityState)this).characterBody.footPosition; NaoyaFilm naoyaFilm = NaoyaFilm.Of(((EntityState)this).characterBody); float num = ((Object.op_Implicit((Object)(object)naoyaFilm) && naoyaFilm.Full) ? 4.5f : 3.5f); float num2 = NaoyaFilm.Weigh(((BaseState)this).GetTeam(), footPosition, 14f); int num3 = NaoyaFilm.Freeze(((BaseState)this).GetTeam(), footPosition, 14f, num, ((EntityState)this).characterBody); if (num3 > 0) { Plugin.Log.LogInfo((object)($"Naoya's heel sealed {num3} body/bodies within " + $"{StatText.Metres(14f)} for {num:0.##}s."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } if (((EntityState)this).isAuthority) { Prepared val = BlackFlash.Roll(1f, ((EntityState)this).characterBody); if (GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), footPosition, 14f, ((BaseState)this).damageStat * 12f * num2 * ((Prepared)(ref val)).Multiplier, 0f, 0f, ((BaseState)this).RollCrit() || ((Prepared)(ref val)).Landed, DamageTypeCombo.GenericSpecial) > 0) { if (((Prepared)(ref val)).Landed) { BlackFlash.Land(footPosition, "Naoya", true); } NaoyaFilm.ReportHit(((EntityState)this).characterBody); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(4f); } } } List list = new List(16); int num4 = NaoyaSeal.Sealed(((BaseState)this).GetTeam(), footPosition, 14f, list); for (int i = 0; i < num4 && i < 16; i++) { Vector3 heading = list[i].corePosition - ((EntityState)this).characterBody.corePosition; heading.y = 0f; heading = ((((Vector3)(ref heading)).sqrMagnitude > 0.01f) ? ((Vector3)(ref heading)).normalized : ((EntityState)this).characterBody.transform.forward); NaoyaGlassCase.Stand(list[i], heading, num, NaoyaLanguage.RoomColour); } if (num4 > 0 && ((EntityState)this).isAuthority) { NaoyaSeal.Of(((EntityState)this).characterBody)?.Open(footPosition, 14f, num, 15f); } Ring(footPosition, num, list, num4); float num5 = NaoyaFx.Reach(((EntityState)this).characterBody, 8.400001f); JujutsuImpact.Detonate(footPosition, NaoyaLanguage.RoomColour, num5, JujutsuFxScale.Weight(12f), true, true); JujutsuMotes.Burst(footPosition, Vector3.up, NaoyaLanguage.RoomColour, num5 * 0.8f, (JujutsuMoteKind)1, 16); JujutsuSfxAssets.PlayMeleeHeavy(footPosition); JujutsuFxHitStop.Hold(((EntityState)this).characterBody, 0.09f, false); } private void Ring(Vector3 at, float seconds, List caught, int count) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_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_0134: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Min(count, 16); Vector3[] array = (Vector3[])(object)new Vector3[num]; for (int i = 0; i < num; i++) { CharacterBody val = caught[i]; if (!Object.op_Implicit((Object)(object)val)) { continue; } Vector3 val2 = val.corePosition - at; val2.y = 0f; Vector3 spoke = ((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val2)).normalized : ((EntityState)this).characterBody.transform.forward); spoke = (array[i] = Apart(spoke, array, i)); Vector3 val3 = at + spoke * 14f + Vector3.up * 1.8f; NaoyaPane naoyaPane = NaoyaPanes.Draw(val3, -spoke, 1.5f, 2f, NaoyaLanguage.RoomColour, seconds, NaoyaPanes.SeedFrom(val3)); if (Object.op_Implicit((Object)(object)naoyaPane)) { Vector3 val4 = val.corePosition - val3; float num2 = ((Vector3)(ref val4)).magnitude; if (num2 < 0.05f) { val4 = -spoke; num2 = 1f; } float force = Mathf.Clamp(num2 / 0.357f, 6f, 48f); naoyaPane.BreakIn(0.14f, val4 / num2, force); } } float num3 = Mathf.Cos(MathF.PI * 4f / 45f); Vector3 val5 = default(Vector3); for (int j = 0; j < 12; j++) { float num4 = (float)j * MathF.PI * 2f / 12f; ((Vector3)(ref val5))..ctor(Mathf.Cos(num4), 0f, Mathf.Sin(num4)); bool flag = false; for (int k = 0; k < num; k++) { if (flag) { break; } flag = Vector3.Dot(val5, array[k]) >= num3; } if (!flag) { Vector3 val6 = at + val5 * 14f; NaoyaPanes.Draw(val6 + Vector3.up * 1.8f, -val5, 1.5f, 2f, NaoyaLanguage.RoomColour, seconds, NaoyaPanes.SeedFrom(val6), 0.5f); } } if (num > 0 && ((EntityState)this).isAuthority) { Plugin.Log.LogInfo((object)($"Naoya's heel stood {num} mirror(s) on the " + StatText.Metres(14f) + " circle, one per sealed body, " + $"and spends each of them on its own after {0.14f:0.##}s."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\States\\NaoyaStates.cs"); } } private static Vector3 Apart(Vector3 spoke, Vector3[] taken, int placed) { //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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Cos(MathF.PI / 20f); Vector3 val = spoke; for (int i = 1; i <= 8; i++) { bool flag = false; for (int j = 0; j < placed; j++) { if (flag) { break; } flag = Vector3.Dot(spoke, taken[j]) >= num; } if (!flag) { break; } spoke = Quaternion.AngleAxis(9f * (float)((i + 1) / 2) * ((i % 2 == 1) ? 1f : (-1f)), Vector3.up) * val; } return spoke; } public override void OnExit() { RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Pop(); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } } internal static class NaoyaFx { internal static float Reach(CharacterBody body, float metres) { return JujutsuFxScale.Of(body, metres / 1.1f); } internal static void Afterimage(CharacterBody body, Vector3 along) { //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_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) if (Object.op_Implicit((Object)(object)body)) { JujutsuMotes.Burst(body.corePosition, -along, NaoyaLanguage.Colour, Reach(body, 0.8f), (JujutsuMoteKind)2, 4); } } internal static void Caught(CharacterBody body) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { JujutsuImpact.Detonate(body.corePosition, NaoyaLanguage.Colour, Reach(body, 1.6f), JujutsuFxScale.Weight(1f), false, true); JujutsuMotes.Burst(body.corePosition, Vector3.up, NaoyaLanguage.Colour, Reach(body, 1.2f), (JujutsuMoteKind)1, 10); } } } } namespace GojoSatoruMod.Naoya { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency("dev.marmennz.satorugojo", "1.3.1")] [BepInPlugin("dev.marmennz.naoyazenin", "Naoya Zenin", "1.3.1")] public sealed class NaoyaPlugin : BaseUnityPlugin { public const string PluginGuid = "dev.marmennz.naoyazenin"; public const string PluginVersion = "1.3.1"; public const string PluginName = "Naoya Zenin"; private void Awake() { if (JujutsuCoreContract.Accepts(1, "Naoya Zenin", "1.3.1", ((BaseUnityPlugin)this).Logger)) { int num = JujutsuStartup.FailureMark(); JujutsuStartup.UseHost((MonoBehaviour)(object)this); JujutsuAssetPaths.AddPlugin(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); JujutsuStartup.Step("Naoya's text", (Action)NaoyaLanguage.Register); JujutsuStartup.Step("Naoya's assets", (Action)NaoyaAssets.Initialize); JujutsuStartup.Step("Naoya's buffs", (Action)NaoyaBuffs.Register); JujutsuStartup.Step("Naoya's sounds", (Func)NaoyaAssets.LoadSounds); JujutsuStartup.Step("Naoya's film", (Action)NaoyaFilm.Initialize); JujutsuStartup.Step("Naoya's frame mark", (Action)NaoyaFrameMark.Initialize); JujutsuStartup.Step("Naoya's trace segments", (Action)NaoyaTraceCheck.Initialize); JujutsuStartup.Step("Naoya's trace letter", (Action)NaoyaTraceCheckHud.Initialize); JujutsuStartup.Step("Naoya's film report", (Action)NaoyaFilmSync.Initialize); JujutsuStartup.Step("Naoya's frame step", (Action)NaoyaFrameStep.Initialize); JujutsuStartup.Step("Naoya's blade", (Action)NaoyaBleedoutState.Initialize); JujutsuStartup.Step("Naoya's glass", (Action)NaoyaGlass.Initialize); JujutsuStartup.Survivor("Naoya", (Action)NaoyaSurvivor.Initialize); JujutsuStartup.Step("Naoya's curse", (Action)NaoyaCurseForm.Initialize); JujutsuStartup.Loaded("Naoya Zenin", "1.3.1", num, ((BaseUnityPlugin)this).Logger); } } } internal static class GeneratedVersion { internal const string Value = "1.3.1"; } } namespace GojoSatoruMod.Content { internal static class NaoyaAssets { private enum Shape { Kick, Palm, Shatter, Trace, Corridor, Frames, Domain, Bleedout, Sidestep, Frame } private const int Size = 128; private static readonly Color Backing = new Color(0.03f, 0.05f, 0.06f, 1f); private static readonly Color Ink = new Color(0.86f, 0.97f, 0.94f, 1f); internal static Sprite KickIcon { get; private set; } internal static Sprite PalmIcon { get; private set; } internal static Sprite ShatterIcon { get; private set; } internal static Sprite TraceIcon { get; private set; } internal static Sprite CorridorIcon { get; private set; } internal static Sprite FramesIcon { get; private set; } internal static Sprite DomainIcon { get; private set; } internal static Sprite BleedoutIcon { get; private set; } internal static Sprite SidestepIcon { get; private set; } internal static Sprite FrameIcon { get; private set; } internal static DecodedAttackSound DomainTheme { get; private set; } internal static IEnumerator LoadSounds() { DomainTheme = GojoAssets.LoadSound("naoya-domain-theme.mp3", 1f, "Naoya", 90f); yield return null; } internal static void Initialize() { KickIcon = GojoAssets.LoadIcon("naoya-kick", (Func)(() => Draw("texNaoyaKick", Shape.Kick))); PalmIcon = GojoAssets.LoadIcon("naoya-palm", (Func)(() => Draw("texNaoyaPalm", Shape.Palm))); ShatterIcon = GojoAssets.LoadIcon("naoya-shatter", (Func)(() => Draw("texNaoyaShatter", Shape.Shatter))); TraceIcon = GojoAssets.LoadIcon("naoya-trace", (Func)(() => Draw("texNaoyaTrace", Shape.Trace))); CorridorIcon = GojoAssets.LoadIcon("naoya-corridor", (Func)(() => Draw("texNaoyaCorridor", Shape.Corridor))); FramesIcon = GojoAssets.LoadIcon("naoya-frames", (Func)(() => Draw("texNaoyaFrames", Shape.Frames))); DomainIcon = GojoAssets.LoadIcon("naoya-domain", (Func)(() => Draw("texNaoyaDomain", Shape.Domain))); BleedoutIcon = GojoAssets.LoadIcon("naoya-bleedout", (Func)(() => Draw("texNaoyaBleedout", Shape.Bleedout))); SidestepIcon = GojoAssets.LoadIcon("naoya-sidestep", (Func)(() => Draw("texNaoyaSidestep", Shape.Sidestep))); FrameIcon = GojoAssets.LoadIcon("naoya-frame", (Func)(() => Draw("texNaoyaFrame", Shape.Frame))); } 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_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05df: 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_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Max(Mathf.Abs(u), Mathf.Abs(v)) > 0.94f) { return Color.clear; } Color result = Backing; switch (shape) { case Shape.Kick: if (u > -0.1f && u < 0.6f && Mathf.Abs(v - (u * 0.75f - 0.18f)) < 0.11f) { result = Ink; } else if (u > 0.44f && u < 0.76f && v > 0.06f && v < 0.46f) { result = Ink; } else if (Mathf.Abs(Mathf.Sqrt((u + 0.18f) * (u + 0.18f) + (v + 0.3f) * (v + 0.3f)) - 0.68f) < 0.05f && v > -0.42f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.55f); } break; case Shape.Palm: if (Mathf.Abs(u) < 0.34f && v > -0.62f && v < 0.06f) { result = Ink; } else if (v >= 0.06f && v < 0.52f) { for (int k = 0; k < 4; k++) { float num11 = -0.255f + (float)k * 0.17f; if (Mathf.Abs(u - num11) < 0.055f) { result = Ink; } } } else if (u > 0.34f && u < 0.56f && v > -0.34f && v < 0.1f) { result = Ink; } break; case Shape.Shatter: { float num15 = Mathf.Max(Mathf.Abs(u), Mathf.Abs(v)); if (num15 > 0.58f && num15 < 0.72f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.5f); } if (num15 < 0.7f) { bool num16 = Mathf.Abs(v - u * 0.78f) < 0.055f; bool flag3 = u > -0.28f && u < 0.36f && Mathf.Abs(v - 0.06f + (u + 0.08f) * 1.7f) < 0.045f; bool flag4 = u > -0.56f && u < 0.04f && Mathf.Abs(v + 0.3f - (u + 0.34f) * 2.1f) < 0.04f; if (num16 || flag3 || flag4) { result = Ink; } } break; } case Shape.Trace: { if (!(Mathf.Abs(v + 0.02f) < 0.1f)) { break; } if (u > 0.36f) { result = Ink; break; } float num4 = (u + 0.8f) / 0.24f; if (u > -0.8f && num4 - Mathf.Floor(num4) < 0.62f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.4f + 0.12f * Mathf.Floor(num4)); } break; } case Shape.Corridor: { for (int l = 0; l < 4; l++) { float num12 = -0.66f + (float)l * 0.44f; float num13 = Mathf.Max(Mathf.Abs(u - num12) / 0.17f, Mathf.Abs(v) / 0.62f); if (num13 > 0.8f && num13 < 1f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.55f); } } if (u >= 0.52f && u < 0.88f && Mathf.Abs(v + 0.04f) < 0.24f * (1f - (u - 0.52f) / 0.36f)) { result = Ink; } else if (u > -0.86f && u < 0.52f && Mathf.Abs(v + 0.04f) < 0.07f) { float num14 = (u + 0.86f) / 0.2f; if (num14 - Mathf.Floor(num14) < 0.62f) { result = Ink; } } break; } case Shape.Frames: { if (!(Mathf.Abs(v) < 0.56f)) { break; } for (int i = 0; i < 6; i++) { float num2 = -0.84f + (float)i * 0.28f; if (u > num2 && u < num2 + 0.21f) { result = (Color)((i < 5) ? Ink : new Color(Ink.r, Ink.g, Ink.b, 0.22f)); } } if (Mathf.Abs(Mathf.Abs(v) - 0.66f) < 0.06f) { float num3 = (u + 1f) / 0.28f; if (num3 - Mathf.Floor(num3) < 0.5f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.45f); } } break; } case Shape.Domain: { float num9 = Mathf.Max(Mathf.Abs(u), Mathf.Abs(v * 1.12f)); if (num9 > 0.62f && num9 < 0.74f) { result = Ink; } else if (Mathf.Sqrt(u * u + v * v) < 0.42f) { result = (Color)((Mathf.Sqrt((u - 0.26f) * (u - 0.26f) + v * v) < 0.38f) ? Backing : new Color(Ink.r, Ink.g, Ink.b, 0.85f)); } break; } case Shape.Bleedout: { bool num5 = u > -0.7f && u < 0.12f && Mathf.Abs(v - 0.18f) < 0.08f; bool flag = u >= 0.12f && u < 0.36f && Mathf.Abs(v - 0.18f) < 0.08f * (1f - (u - 0.12f) / 0.24f); bool flag2 = u > -0.84f && u <= -0.7f && Mathf.Abs(v - 0.18f) < 0.19f; if (num5 || flag || flag2) { result = Ink; break; } if (u > 0.4f && Mathf.Abs(v - 0.18f) < 0.035f) { float num6 = (u - 0.4f) / 0.16f; if (num6 - Mathf.Floor(num6) < 0.6f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.6f); } break; } for (int j = 0; j < 3; j++) { float num7 = -0.44f + (float)j * 0.36f; float num8 = -0.4f - (float)(j % 2) * 0.14f; if ((u - num7) * (u - num7) + (v - num8) * (v - num8) * 0.55f < 0.015f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.85f); } } break; } case Shape.Sidestep: { if (u > -0.62f && u < -0.38f && v > -0.42f && v < 0.58f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.3f); break; } if (u > 0.3f && u < 0.54f && v > -0.42f && v < 0.58f) { result = Ink; break; } float num10 = v + 0.66f; Color val = default(Color); ((Color)(ref val))..ctor(Ink.r, Ink.g, Ink.b, 0.8f); if (u > -0.58f && u < 0.34f && Mathf.Abs(num10) < 0.055f) { result = val; } else if (u >= 0.34f && u < 0.62f && Mathf.Abs(num10) < 0.16f * (1f - (u - 0.34f) / 0.28f)) { result = val; } break; } case Shape.Frame: { float num = Mathf.Max(Mathf.Abs(u), Mathf.Abs(v)); if (num > 0.58f && num < 0.72f) { result = Ink; } else if (num < 0.2f) { ((Color)(ref result))..ctor(Ink.r, Ink.g, Ink.b, 0.8f); } break; } } return result; } } internal static class NaoyaBuffs { internal static BuffDef Framed { get; private set; } internal static BuffDef Cracked { get; private set; } internal static void Register() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_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 (!Object.op_Implicit((Object)(object)Framed)) { BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "bdNaoyaFramed"; val.buffColor = NaoyaLanguage.Colour; val.iconSprite = NaoyaAssets.FrameIcon; val.canStack = false; val.isDebuff = true; val.isCooldown = false; val.isHidden = false; JujutsuContentPack.Buffs.Add(val); Framed = val; BuffDef val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "bdNaoyaCracked"; val2.buffColor = NaoyaLanguage.Colour; val2.iconSprite = NaoyaAssets.ShatterIcon; val2.canStack = false; val2.isDebuff = true; val2.isCooldown = false; val2.isHidden = false; JujutsuContentPack.Buffs.Add(val2); Cracked = val2; Plugin.Log.LogInfo((object)"Naoya's frame markers registered; a body the palm reaches wears the first for as long as it is stuck, and one that outlasts its frame wears the cracks for a moment more.", "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaBuffs.cs"); } } } internal static class NaoyaCurseForm { internal sealed class NaoyaCursePending : MonoBehaviour { private CharacterMaster master; private GameObject humanPrefab; private float remaining; internal void Configure(CharacterMaster owner, GameObject human, float delay) { master = owner; humanPrefab = human; remaining = delay; } private void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)master)) { Object.Destroy((Object)(object)this); return; } remaining -= Time.fixedDeltaTime; if (!(remaining > 0f)) { Rise(); Object.Destroy((Object)(object)this); } } private void Rise() { //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_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)BodyPrefab) && Object.op_Implicit((Object)(object)Run.instance)) { master.bodyPrefab = BodyPrefab; if (Object.op_Implicit((Object)(object)master.inventory)) { master.inventory.GiveItemPermanent(Items.HealthDecay, 30); } Vector3 val = master.deathFootPosition + Vector3.up * 1.5f; CharacterBody val2 = master.Respawn(val, Quaternion.identity, false); master.originalBodyPrefab = humanPrefab; if (Object.op_Implicit((Object)(object)val2)) { val2.AddTimedBuff(Buffs.Immune, 3f); ((Component)val2).gameObject.AddComponent(); JujutsuSfxAssets.PlayHeavyWhoosh(val2.corePosition, 1f); } } } } internal sealed class NaoyaCurseRisenHealth : MonoBehaviour { private int ticks; private void FixedUpdate() { if (!NetworkServer.active) { Object.Destroy((Object)(object)this); return; } ticks++; if (ticks >= 2) { CharacterBody component = ((Component)this).GetComponent(); HealthComponent val = (Object.op_Implicit((Object)(object)component) ? component.healthComponent : null); if (Object.op_Implicit((Object)(object)val) && val.alive) { val.Networkhealth = Mathf.Min(val.health, component.maxHealth * 0.5f); } Object.Destroy((Object)(object)this); } } } internal sealed class NaoyaCurseStillness : MonoBehaviour { private CharacterBody body; private NaoyaDomainField field; private EntityStateMachine weapon; private bool Holding { get { if (!((Object)(object)field != (Object)null) || !field.IsActive) { if (Object.op_Implicit((Object)(object)weapon)) { return weapon.state is NaoyaDomainState; } return false; } return true; } } private void Awake() { body = ((Component)this).GetComponent(); field = ((Component)this).GetComponent(); weapon = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Weapon"); } private void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Holding) { return; } HealthComponent healthComponent = body.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.alive) { Inventory inventory = body.inventory; int num = (Object.op_Implicit((Object)(object)inventory) ? inventory.GetItemCountPermanent(Items.HealthDecay) : 0); if (num > 0) { float num2 = body.maxHealth / Mathf.Max(1f, body.cursePenalty) / (float)num; HealThroughGate(healthComponent, num2 * Time.fixedDeltaTime); } } } } internal sealed class NaoyaCurseRam : MonoBehaviour { private const float SpeedThreshold = 25f; private const float MetresPerBlast = 6f; internal const float DamagePerSpeed = 0.1f; private const float Radius = 3.2f; private CharacterBody body; private CharacterMotor motor; private float metresSince; private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); } private void FixedUpdate() { //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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0141: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)motor) || !body.hasEffectiveAuthority) { return; } Vector3 velocity = motor.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (magnitude < 25f) { metresSince = 6f; return; } metresSince += magnitude * Time.fixedDeltaTime; if (!(metresSince < 6f)) { metresSince = 0f; Vector3 normalized = ((Vector3)(ref velocity)).normalized; Vector3 val = body.corePosition + normalized * 1f; if (GojoMeleeAttackUtility.Fire(((Component)this).gameObject, body, (TeamIndex)(Object.op_Implicit((Object)(object)body.teamComponent) ? ((int)body.teamComponent.teamIndex) : 0), val, 3.2f, body.damage * magnitude * 0.1f, normalized * (magnitude * 25f) + Vector3.up * 600f, body.RollCrit(), DamageTypeCombo.GenericPrimary) > 0) { JujutsuImpact.Strike(val, normalized, Colour, 3.2f, JujutsuFxScale.Weight(1.6f), false, true); JujutsuSfxAssets.PlayMeleeLight(val); } } } } internal sealed class NaoyaCursePose : MonoBehaviour { private const float ProneSpeed = 20f; private const float SwingSeconds = 0.25f; private CharacterMotor motor; private Transform container; private float lean; private void Awake() { motor = ((Component)this).GetComponent(); CharacterModel componentInChildren = ((Component)this).GetComponentInChildren(); container = (Object.op_Implicit((Object)(object)componentInChildren) ? ((Component)componentInChildren).transform.Find("NaoyaCurseImported") : null); } private void Update() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)container)) { float num = Mathf.Clamp01(((Object.op_Implicit((Object)(object)motor) ? ((Vector3)(ref motor.velocity)).magnitude : 0f) - 2f) / 18f); lean = Mathf.MoveTowards(lean, num, Time.deltaTime / 0.25f); container.localRotation = Quaternion.Euler(90f * Mathf.SmoothStep(0f, 1f, lean), 0f, 0f); } } } internal const float EnergyThreshold = 0.75f; internal const int LifeSeconds = 30; internal const float KillRefundFraction = 0.04f; private const float TransformDelay = 2f; internal const float SpawnHealthFraction = 0.5f; private const float DrawnHeight = 2.2f; private const string ContainerName = "NaoyaCurseImported"; internal static readonly Color Colour = new Color(0.78f, 0.42f, 0.82f, 1f); private static GameObject humanBodyPrefab; private static readonly HashSet trueKills = new HashSet(); private static bool healGateOpen; internal static GameObject BodyPrefab { get; private set; } private static BodyIndex GhostIndex { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)BodyPrefab)) { return (BodyIndex)(-1); } return BodyPrefab.GetComponent().bodyIndex; } } private static BodyIndex HumanIndex { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)humanBodyPrefab)) { return (BodyIndex)(-1); } return humanBodyPrefab.GetComponent().bodyIndex; } } internal static void Initialize() { //IL_0066: 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) humanBodyPrefab = (Object.op_Implicit((Object)(object)NaoyaSurvivor.SurvivorDef) ? NaoyaSurvivor.SurvivorDef.bodyPrefab : null); if (!Object.op_Implicit((Object)(object)humanBodyPrefab)) { Plugin.Log.LogWarning((object)"Naoya's curse form was skipped: there is no Naoya to die.", "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaCurseForm.cs"); return; } Mark val = JujutsuContentPack.MarkContent(); try { JujutsuContentPack.EntityStates.Add(typeof(NaoyaCurseFlightState)); BuildBody(); InstallHooks(); } catch (Exception ex) { string text = JujutsuContentPack.RollBackTo(val); Plugin.Log.LogError((object)("Naoya's curse form could not be built, so his death is only a death" + ((text == null) ? string.Empty : (" and " + text + " were dropped")) + ": " + ex), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaCurseForm.cs"); BodyPrefab = null; } } private static void BuildBody() { //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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) GameObject obj = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody"); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("CommandoBody was not found; the curse cannot be built."); } BodyPrefab = PrefabAPI.InstantiateClone(obj, "NaoyaCurseBody"); InheritedSkins.DropForeignSkillSlots(BodyPrefab); CharacterBody component = BodyPrefab.GetComponent(); component.baseNameToken = "CODEX_NAOYA_CURSE_NAME"; component.subtitleNameToken = "CODEX_NAOYA_CURSE_SUBTITLE"; component.bodyColor = Colour; component.baseMaxHealth = 110f; component.levelMaxHealth = 33f; component.baseRegen = 0f; component.levelRegen = 0f; component.baseDamage = 15f; component.levelDamage = 3f; component.baseArmor = 0f; component.baseMoveSpeed = 100f; component.baseAcceleration = 300f; component.baseJumpCount = 1; component.bodyFlags = (BodyFlags)(component.bodyFlags | 1); Texture2D val = GojoAssets.LoadPersistentTexture("ui/naoya-curse-portrait.png", "texNaoyaCursePortrait"); if (Object.op_Implicit((Object)(object)val)) { component.portraitIcon = (Texture)(object)val; } if (Object.op_Implicit((Object)(object)JujutsuExpansion.Def)) { BodyPrefab.AddComponent().requiredExpansion = JujutsuExpansion.Def; } AttachModel(); GenericSkill val2 = GiveSkills(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent().Configure(val2, null); JujutsuSkillNetworkFix.RegisterExtraSkills(BodyPrefab); BodyPrefab.AddComponent().Configure((Slot[])(object)new Slot[1] { new Slot { Skill = val2, Icon = NaoyaAssets.DomainIcon, Key = (BindKey)3, ShortName = "DOMAIN", Accent = Colour } }); component.preferredPodPrefab = null; EntityStateMachine[] components = BodyPrefab.GetComponents(); foreach (EntityStateMachine val3 in components) { if (!(val3.customName != "Body")) { val3.mainStateType = new SerializableEntityStateType(typeof(NaoyaCurseFlightState)); val3.initialStateType = val3.mainStateType; } } CharacterDirection component2 = BodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.turnSpeed = Mathf.Max(component2.turnSpeed, 540f); component2.shouldDirectPitch = false; } JujutsuContentPack.BodyPrefabs.Add(BodyPrefab); } private static void AttachModel() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0060: 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_00de: 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_00ed: Unknown result type (might be due to invalid IL or missing references) CharacterModel componentInChildren = BodyPrefab.GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { throw new InvalidOperationException("The CommandoBody clone has no CharacterModel."); } if (!NaoyaCurseModel.Available) { return; } Renderer[] componentsInChildren = ((Component)componentInChildren).GetComponentsInChildren(true); GameObject val = new GameObject("NaoyaCurseImported"); val.transform.SetParent(((Component)componentInChildren).transform, false); val.transform.localPosition = new Vector3(0f, 1.25f, 0f); GameObject val2 = NaoyaCurseModel.Draw(val.transform, 2.2f); if (!Object.op_Implicit((Object)(object)val2)) { Object.DestroyImmediate((Object)(object)val); return; } Renderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { array[i].enabled = false; } MeshRenderer component = val2.GetComponent(); componentInChildren.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { renderer = (Renderer)(object)component, defaultMaterial = ((Renderer)component).sharedMaterial, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false } }; ModelSkinController component2 = ((Component)componentInChildren).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Object.DestroyImmediate((Object)(object)component2); } BodyPrefab.AddComponent(); } private static GenericSkill GiveSkills() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) GenericSkill[] components = BodyPrefab.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } SkillLocator component = BodyPrefab.GetComponent(); SkillDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "NaoyaCurseDomain"; val.skillName = "NaoyaCurseDomain"; val.skillNameToken = "CODEX_NAOYA_CURSE_DOMAIN_NAME"; val.skillDescriptionToken = "CODEX_NAOYA_CURSE_DOMAIN_DESCRIPTION"; val.icon = NaoyaAssets.DomainIcon; val.activationState = new SerializableEntityStateType(typeof(NaoyaDomainState)); val.activationStateMachineName = "Weapon"; val.baseMaxStock = 1; val.baseRechargeInterval = 60f; val.beginSkillCooldownOnSkillEnd = true; val.canceledFromSprinting = false; val.fullRestockOnAssign = true; val.interruptPriority = (InterruptPriority)2; val.isCombatSkill = true; val.mustKeyPress = true; val.rechargeStock = 1; val.requiredStock = 1; val.stockToConsume = 1; val.keywordTokens = Array.Empty(); JujutsuContentPack.SkillDefs.Add(val); SkillFamily val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "NaoyaCurseSpecialFamily"; Variant[] array = new Variant[1]; Variant val3 = new Variant { skillDef = val }; ((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null); array[0] = val3; val2.variants = (Variant[])(object)array; JujutsuContentPack.SkillFamilies.Add(val2); GenericSkill obj = BodyPrefab.AddComponent(); obj.skillName = "NaoyaCurseDomainSlot"; obj._skillFamily = val2; component.primary = null; component.secondary = null; component.utility = null; component.special = null; return obj; } internal static void HealThroughGate(HealthComponent health, float amount) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)health)) { return; } healGateOpen = true; try { health.Heal(amount, default(ProcChainMask), false); } finally { healGateOpen = false; } } private static void InstallHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterMaster.TrueKill_GameObject_GameObject_DamageTypeCombo += new hook_TrueKill_GameObject_GameObject_DamageTypeCombo(MarkTrueKill); CharacterMaster.TryReviveOnBodyDeath += new hook_TryReviveOnBodyDeath(TryBecomeCurse); HealthComponent.Heal += new hook_Heal(RefuseHealing); GlobalEventManager.onCharacterDeathGlobal += FeedOnDeath; CharacterBody.onBodyStartGlobal += CleanFuseOffTheMan; } private static void MarkTrueKill(orig_TrueKill_GameObject_GameObject_DamageTypeCombo orig, CharacterMaster self, GameObject killerOverride, GameObject inflictorOverride, DamageTypeCombo damageTypeOverride) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) trueKills.Add(self); try { orig.Invoke(self, killerOverride, inflictorOverride, damageTypeOverride); } finally { trueKills.Remove(self); } } private static bool TryBecomeCurse(orig_TryReviveOnBodyDeath orig, CharacterMaster self, CharacterBody body) { //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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (orig.Invoke(self, body)) { return true; } if (!NetworkServer.active || !Object.op_Implicit((Object)(object)BodyPrefab) || !Object.op_Implicit((Object)(object)body)) { return false; } if (body.bodyIndex == GhostIndex) { if (Object.op_Implicit((Object)(object)self.inventory)) { int itemCountPermanent = self.inventory.GetItemCountPermanent(Items.HealthDecay); if (itemCountPermanent > 0) { self.inventory.RemoveItemPermanent(Items.HealthDecay, itemCountPermanent); } } return false; } if (!Object.op_Implicit((Object)(object)self.playerCharacterMasterController) || body.bodyIndex != HumanIndex || trueKills.Contains(self)) { return false; } HealthComponent healthComponent = body.healthComponent; if ((Object)(object)healthComponent != (Object)null && (healthComponent.killingDamageType.damageType & -2147418112) != 0) { return false; } if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(Artifacts.randomSurvivorOnRespawnArtifactDef)) { return false; } CursedEnergyController component = ((Component)body).GetComponent(); if ((Object)(object)component == (Object)null || component.Maximum <= 0f || component.Fraction < 0.75f) { return false; } component.Drain(component.Current); ((Component)self).gameObject.AddComponent().Configure(self, humanBodyPrefab, 2f); return true; } private static float RefuseHealing(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_003b: 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 (!healGateOpen && Object.op_Implicit((Object)(object)BodyPrefab) && Object.op_Implicit((Object)(object)self.body) && self.body.bodyIndex == GhostIndex) { return 0f; } return orig.Invoke(self, amount, procChainMask, nonRegen); } private static void FeedOnDeath(DamageReport report) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || report == null || !Object.op_Implicit((Object)(object)BodyPrefab)) { return; } CharacterBody attackerBody = report.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.bodyIndex == GhostIndex) { HealthComponent healthComponent = attackerBody.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.alive) { HealThroughGate(healthComponent, attackerBody.maxHealth * 0.04f); } } } private static void CleanFuseOffTheMan(CharacterBody body) { //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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || body.bodyIndex != HumanIndex || !Object.op_Implicit((Object)(object)body.master) || !Object.op_Implicit((Object)(object)body.master.playerCharacterMasterController)) { return; } Inventory inventory = body.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int itemCountPermanent = inventory.GetItemCountPermanent(Items.HealthDecay); if (itemCountPermanent > 0) { inventory.RemoveItemPermanent(Items.HealthDecay, itemCountPermanent); } } } } internal static class NaoyaLanguage { internal const string Prefix = "CODEX_NAOYA_"; internal static readonly Color Colour = new Color(0.7f, 0.9f, 0.86f, 1f); internal static readonly Color RoomColour = new Color(0.78f, 0.7f, 0.96f, 1f); internal static void Register() { LanguageAPI.Add("CODEX_NAOYA_NAME", "Naoya Zenin"); LanguageAPI.Add("CODEX_NAOYA_SUBTITLE", "The Fastest"); LanguageAPI.Add("CODEX_NAOYA_DESCRIPTION", "Naoya is the frailest body here and by a distance the quickest. He fights unarmed, builds " + StatText.Utility("film") + " by never standing still, and spends it on a technique that divides a second into " + StatText.Utility("twenty-four frames") + " — anything his palm reaches has to keep up, and what cannot is " + StatText.Damage("frozen where it stands") + "."); LanguageAPI.Add("CODEX_NAOYA_PASSIVE_NAME", "Projection Sorcery"); LanguageAPI.Add("CODEX_NAOYA_PASSIVE_DESCRIPTION", "A palm " + StatText.Damage("freezes") + " what it reaches for " + StatText.Damage(StatText.Seconds(1f) + "s") + "; a frozen body takes " + StatText.Damage("+" + StatText.Fraction(0.4f)) + " from every blow, " + StatText.Sub("his and his team's alike") + ".\n\nFilm builds while he moves, to " + StatText.Utility(StatText.Number(24f) + " frames") + ", each " + StatText.Utility(StatText.Fraction(0.009f) + " attack speed") + " and " + StatText.Utility(StatText.Fraction(0.006f) + " movement") + ". Standing spends it; a hit taken costs " + StatText.Damage(StatText.Number(4f)) + ".\n\nA full reel also " + StatText.Healing("refuses " + StatText.Fraction(0.38f)) + " of blows outright.\n\n" + StatText.EnergyRule()); LanguageAPI.Add("CODEX_NAOYA_PRIMARY_NAME", "Zenin Style"); LanguageAPI.Add("CODEX_NAOYA_PRIMARY_DESCRIPTION", StatText.Utility(StatText.Number((float)NaoyaKickState.Steps) + " kicks") + " for " + StatText.Damage(StatText.Percent(NaoyaKickState.Coefficient) + " damage") + " in all, the last a heel that throws what it hits. The run restarts after " + StatText.Number(1.1f) + "s of not swinging.\n\n" + StatText.Utility("No energy to swing") + ", and " + StatText.Healing(StatText.Number(3f) + " back") + " where a kick lands, " + StatText.Healing(StatText.Number(5f)) + " on the heel."); LanguageAPI.Add("CODEX_NAOYA_SECONDARY_NAME", "Frame Lock"); LanguageAPI.Add("CODEX_NAOYA_SECONDARY_DESCRIPTION", "An open palm for " + StatText.Damage(StatText.Percent(3f) + " damage") + ": everything within " + StatText.Metres(4.6f) + " of what he points at, up to " + StatText.Metres(4f) + " away, is " + StatText.Damage("sealed in glass") + " — held still, and nothing can throw it.\n\n" + StatText.Healing("Hit the glass and it breaks") + ", with them still in it, for " + StatText.Damage(StatText.Percent(12.599999f) + " damage") + " on top of the blow. " + StatText.Sub("Any player on your team breaks it too.") + " " + StatText.Healing("Press again") + " to break every frame standing at once instead.\n\n" + StatText.Seconds(4.5f) + "s cooldown, " + StatText.Utility(StatText.Number(14f) + " energy") + ", " + StatText.Healing(StatText.Number(4f) + " back") + " on a hit."); LanguageAPI.Add("CODEX_NAOYA_SHATTER_NAME", "Shatter"); LanguageAPI.Add("CODEX_NAOYA_SHATTER_DESCRIPTION", "Break every frame standing at once, at any range, with what they caught still inside them: " + StatText.Damage(StatText.Percent(9f) + " damage") + ", " + StatText.Damage(StatText.Percent(12.599999f)) + " against anything still standing in glass, " + StatText.Utility("thrown") + " and left bleeding " + StatText.Damage(StatText.Number(3f) + " stacks") + " deep.\n\n" + StatText.Damage("It spends the seal") + ": the " + StatText.Utility("+" + StatText.Fraction(0.4f)) + " everything else collects off a sealed body goes with it.\n\n" + StatText.Utility("No cooldown and no energy") + ": Frame Lock has already paid for both."); LanguageAPI.Add("CODEX_NAOYA_UTILITY_NAME", "Trace"); LanguageAPI.Add("CODEX_NAOYA_UTILITY_DESCRIPTION", "A letter flashes — they run " + StatText.Utility("A → S → D") + " — and " + StatText.Healing("every correct press is one step") + " of " + StatText.Metres(3.3333335f) + "-" + StatText.Metres(7.5f) + ": " + StatText.Damage(StatText.Percent(10f) + " damage") + " to everything on the way, all of it " + StatText.Damage("sealed in glass") + " behind him. " + StatText.Healing("The sooner you answer, the longer the step") + ".\n\n" + StatText.Utility(StatText.Number(8f) + " energy") + " to stand and " + StatText.Utility(StatText.Number(1.5f) + " a step") + ", " + StatText.Seconds(7f) + "s cooldown. Shift, jump, a letter left standing or an empty bar ends it where he stopped.\n\n" + StatText.Damage("A key he did not set") + ", or a step the level stops dead, seals him in his own glass for " + StatText.Damage(StatText.Seconds(0.75f) + "s") + " and " + StatText.Damage("costs him the film") + "."); LanguageAPI.Add("CODEX_NAOYA_CORRIDOR_NAME", "Frame Corridor"); LanguageAPI.Add("CODEX_NAOYA_CORRIDOR_DESCRIPTION", "Write a corridor of glass " + StatText.Utility(StatText.Metres(30f) + " down the aim") + ", " + StatText.Metres(3f) + " wide, and " + StatText.Damage("seal everything standing in it") + " for " + StatText.Utility(StatText.Seconds(2f) + "s") + " (" + StatText.Utility(StatText.Seconds(2.6f) + "s") + " at a full film).\n\n" + StatText.Healing("Then he runs the row.") + " Every frame he reaches " + StatText.Damage("breaks with its body still inside it") + " for " + StatText.Damage(StatText.Percent(8f)) + ", " + StatText.Damage(StatText.Percent(11.2f)) + " against anything the corridor sealed, thrown and left bleeding.\n\nIt " + StatText.Utility("cannot be steered") + ", and " + StatText.Utility("aimed upward it leaves the ground") + ". " + StatText.Damage("A wall stops it") + ".\n\n" + StatText.Seconds(11f) + "s cooldown, " + StatText.Utility(StatText.Number(20f) + " energy") + "."); LanguageAPI.Add("CODEX_NAOYA_SPECIAL_NAME", "Twenty-Four Frames"); LanguageAPI.Add("CODEX_NAOYA_SPECIAL_DESCRIPTION", "The heel brought down: " + StatText.Damage(StatText.Percent(12f) + " damage") + " to everything within " + StatText.Metres(14f) + ", and the whole of it " + StatText.Damage("sealed in glass at once") + " for " + StatText.Utility(StatText.Seconds(3.5f) + "s") + " (" + StatText.Utility(StatText.Seconds(4.5f) + "s") + " at a full film). It " + StatText.Utility("throws nothing") + ".\n\n" + StatText.Healing("The sealed room is the payload.") + " M2 becomes the break for as long as it stands: one press shatters every frame in it for " + StatText.Damage(StatText.Percent(15f)) + " each, " + StatText.Damage(StatText.Percent(21f)) + " against anything still sealed.\n\n" + StatText.Seconds(14f) + "s cooldown, " + StatText.Utility(StatText.Number(33f) + " energy") + "."); LanguageAPI.Add("CODEX_NAOYA_DOMAIN_NAME", "Time Cell Moon Palace"); LanguageAPI.Add("CODEX_NAOYA_DOMAIN_DESCRIPTION", "Seal a " + StatText.Metres(28f) + " palace for " + StatText.Seconds(10f) + "s and " + StatText.Utility("slow everything in it to a crawl") + ".\n\nInside, the bill runs both ways: " + StatText.Damage("+" + StatText.Percent(0.3f) + " a metre it falls short") + " of his " + StatText.Utility(StatText.Number(8.6f) + " m/s") + " pace, and " + StatText.Damage("+" + StatText.Percent(0.13f) + " a metre it actually covers") + " — the cheapest place to be is his own pace, exactly. At least " + StatText.Damage(StatText.Percent(0.39540002f)) + " every " + StatText.Seconds(0.3f) + "s, capped at " + StatText.Damage(StatText.Percent(0.85f)) + ".\n\n" + StatText.Seconds(80f) + "s cooldown, and it does not start until the palace falls." + StatText.Sub("\n\n< ! > The room is the host's to run.")); LanguageAPI.Add("CODEX_NAOYA_BLEEDOUT_NAME", "Bleedout"); LanguageAPI.Add("CODEX_NAOYA_BLEEDOUT_DESCRIPTION", "One stab, projected the whole way down the line: " + StatText.Damage(StatText.Percent(6.5f) + " damage") + " to everything within " + StatText.Metres(1.9f) + " of it, out to " + StatText.Utility(StatText.Metres(42f)) + ", aimed " + StatText.Utility("wherever he is looking") + " — up as well as along.\n\nEverything it opens takes " + StatText.Damage(StatText.Number(3f) + " stacks of Bleed") + " for " + StatText.Seconds(5f) + "s. " + StatText.Healing("Stab something already bleeding") + " and it " + StatText.Damage("hemorrhages") + " for a further " + StatText.Seconds(7f) + "s.\n\n" + StatText.Seconds(12f) + "s cooldown, " + StatText.Utility(StatText.Number(22f) + " energy") + ", " + StatText.Healing(StatText.Number(4f) + " back") + " on a hit."); LanguageAPI.Add("CODEX_NAOYA_SIDESTEP_NAME", "Sidestep"); LanguageAPI.Add("CODEX_NAOYA_SIDESTEP_DESCRIPTION", StatText.Utility("Tap A twice, or D twice.") + " He steps " + StatText.Utility(StatText.Metres(12f)) + " that way in " + StatText.Seconds(0.25f) + "s, still facing where he was looking: the step goes where the key went, not where his shoulders are.\n\nNo damage, no window and " + StatText.Utility("no energy") + ", but it reaches " + StatText.Healing("out of a kick or a palm") + ". " + StatText.Utility(StatText.Number(1f) + " step banked") + ", back " + StatText.Seconds(4f) + "s after the last one ended, and he cannot swing until it is over." + StatText.Sub("\n\n< ! > Not out of a Trace, the reel or the palace.")); LanguageAPI.Add("CODEX_NAOYA_CURSE_NAME", "Cursed Naoya"); LanguageAPI.Add("CODEX_NAOYA_CURSE_SUBTITLE", "Vengeful Cursed Spirit"); LanguageAPI.Add("CODEX_NAOYA_CURSE_DOMAIN_NAME", "Time Cell Moon Palace"); LanguageAPI.Add("CODEX_NAOYA_CURSE_DOMAIN_DESCRIPTION", StatText.Utility("Domain Expansion") + " — the room he died perfecting, and in death it costs nothing: no bar, because there is no bar left. The same palace as in life, " + StatText.Metres(28f) + " for " + StatText.Seconds(10f) + "s, billing everything inside for its speed. The hull is the only other weapon the curse owns: everything it flies through takes " + StatText.Damage(StatText.Percent(0.1f)) + " per metre a second of its own speed, and is thrown." + StatText.Sub("\n\n< ! > From the first frame of the opening until the palace lets go, " + StatText.Healing("the fuse holds") + " — the form does not burn down casting or keeping its own room. It cannot heal; kills feed it " + StatText.Percent(0.04f) + " of its maximum health, and nothing else does.")); LanguageAPI.Add("CODEX_NAOYA_OUTRO_FLAVOR", "..and so he left, certain he had always been the fastest."); LanguageAPI.Add("CODEX_NAOYA_OUTRO_FAILURE", "..and so he vanished, one frame behind."); LogResolvedNumbers(); } private static void LogResolvedNumbers() { Plugin.Log.LogInfo((object)"Naoya skill text assembled from live values:", "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)($" film : {24} frames" + ", +" + StatText.Fraction(0.009f) + " attack speed and +" + StatText.Fraction(0.006f) + " move speed each (full: +" + StatText.Fraction(0.21599999f) + " / +" + StatText.Fraction(0.144f) + "), one every " + StatText.Number(0.22f) + "s moving, one lost every " + StatText.Number(0.8f) + "s still" + $", {4} lost a hit taken"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" rule : " + StatText.Seconds(1f) + "s frozen (" + StatText.Seconds(1.5f) + "s at a full film), +" + StatText.Fraction(0.4f) + " damage against it from every source (his own weighed at the swing, everybody else's at the blow); an unbroken frame collapses for " + StatText.Percent(5f) + $" + {3} cuts" + " and " + StatText.Seconds(4f) + "s cracked"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)($" kicks : {NaoyaKickState.Steps} steps" + ", " + StatText.Percent(NaoyaKickState.Coefficient) + " in all over " + StatText.Number(NaoyaKickState.RunSeconds) + "s = " + StatText.Percent(NaoyaKickState.Coefficient / NaoyaKickState.RunSeconds) + " a second"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" kick fee: none, the swing is free, pays " + StatText.Number(3f) + " a hit and " + StatText.Number(5f) + " on the heel = " + StatText.Number(3f * (float)(NaoyaKickState.Steps - 1) + 5f) + " net on a run that all lands"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" palm : " + StatText.Percent(3f) + ", " + StatText.Metres(4.6f) + " round whatever is nearest along the aim within " + StatText.Metres(4f) + ", cooldown " + StatText.Seconds(4.5f) + "s, energy " + StatText.Number(14f) + " less " + StatText.Number(4f) + " back on a hit"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" shatter : " + StatText.Percent(9f) + " -> " + StatText.Percent(12.599999f) + " against a sealed body" + $", +{3} bleed stacks on what was in the glass" + ", over the seal +" + StatText.Metres(1.4f) + ", free on the same key inside the hold (" + StatText.Seconds(1f) + "-" + StatText.Seconds(1.5f) + "s) = " + StatText.Percent(15.599999f) + " for the pair off one " + StatText.Seconds(4.5f) + "s cooldown"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" trace : " + StatText.Percent(10f) + " a step bought per press, sealing everything it passes through (" + StatText.Metres(3.3333335f) + "-" + StatText.Metres(7.5f) + " a press), at " + StatText.Number(40f) + "-" + StatText.Number(90f) + " m/s wound up by the letters, which run A-S-D in order (no W) and stand " + StatText.Seconds(2.5f) + "s each: +" + StatText.Number(14f) + " for one hit inside " + StatText.Seconds(0.8f) + "s, -" + StatText.Number(8f) + " over " + StatText.Seconds(1.8f) + "s, and up to +" + StatText.Percent(0.5f) + " damage at the top — chained for as long as they are hit" + $" ({3} letters shown ahead," + $" {4} frames a step," + $" film full at {24})" + ", run flat along the ground and turning " + StatText.Number(70f) + " deg a step, cooldown " + StatText.Seconds(7f) + "s, energy " + StatText.Number(8f) + " to stand and " + StatText.Number(1.5f) + " a step after that (" + StatText.Number(0.5f) + " back where a step lands on something, so a run always bills more than it earns); a second press of the key, a jump, a letter let go or a step it cannot pay for just end the run, and the wrong key or a step stopped under " + StatText.Percent(0.25f) + " of its own length = " + StatText.Seconds(0.75f) + "s sealed in his own glass and the film gone"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" special : " + StatText.Percent(12f) + " across " + StatText.Metres(14f) + ", nothing thrown, the whole circle sealed " + StatText.Seconds(3.5f) + "-" + StatText.Seconds(4.5f) + "s with the break hung on M2 while it stands, cooldown " + StatText.Seconds(14f) + "s, energy " + StatText.Number(33f)), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" blade : " + StatText.Percent(6.5f) + " down " + StatText.Metres(42f) + " at " + StatText.Metres(1.9f) + " wide" + $", {3} stacks of bleed for" + " " + StatText.Seconds(5f) + "s and " + StatText.Seconds(7f) + "s of hemorrhage into anything already bleeding, cooldown " + StatText.Seconds(12f) + "s, energy " + StatText.Number(22f)), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" dash : " + StatText.Metres(12f) + " sideways over " + StatText.Seconds(0.25f) + "s = " + StatText.Number(48f) + " m/s, off two taps of A or D inside " + StatText.Seconds(0.18f) + "s" + $", {1} banked" + " and one back every " + StatText.Seconds(4f) + "s (" + StatText.Seconds(3f) + "s in a run), no energy, no damage and no window"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" step : " + StatText.Fraction(0.12f) + "-" + StatText.Fraction(0.38f) + " to refuse a blow" + $" across 0-{24} frames" + ", at most once every " + StatText.Seconds(2.1f) + "s" + $", costing {5} frames a time"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); Plugin.Log.LogInfo((object)(" palace : " + StatText.Metres(28f) + " for " + StatText.Seconds(10f) + "s, " + StatText.Percent(0.06f) + " + " + StatText.Percent(0.3f) + "/m short of " + StatText.Number(8.6f) + " m/s + " + StatText.Percent(0.13f) + "/m covered, every " + StatText.Number(0.3f) + "s capped at " + StatText.Percent(0.85f) + " — the faster it moves the more it pays, cooldown " + StatText.Seconds(80f) + "s at " + StatText.Fraction(JujutsuConfig.DomainEnergyFraction.Value) + " of the pool"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Content\\NaoyaLanguage.cs"); } } internal static class NaoyaSurvivor { internal static class Costs { internal const float KickCooldown = 0f; internal const float HitRestore = 3f; internal const float FinisherRestore = 5f; internal const float BlowRestore = 4f; internal const float LineRestore = 0.5f; internal const float PalmCooldown = 4.5f; internal const float PalmEnergy = 14f; internal const float TraceCooldown = 7f; internal const int TraceCharges = 1; internal const float TraceEnergy = 8f; internal const float TraceStepEnergy = 1.5f; internal const float CorridorCooldown = 11f; internal const float CorridorEnergy = 20f; internal const float FramesCooldown = 14f; internal const float FramesEnergy = 33f; internal const float BleedoutCooldown = 12f; internal const float BleedoutEnergy = 22f; internal const float SidestepCooldown = 4f; internal const int SidestepCharges = 1; internal const float DomainCooldown = 80f; } internal const float BaseMoveSpeed = 8.6f; private const float ModelScale = 1.1f; internal static SurvivorDef SurvivorDef { get; private set; } internal static SkillDef ShatterSkill { get; private set; } internal static void Initialize() { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_009f: 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_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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Expected O, but got Unknown //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Expected O, but got Unknown //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Expected O, but got Unknown //IL_03f2: Expected O, but got Unknown //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Expected O, but got Unknown ShatterSkill = JujutsuNewcomers.BuildSkillDef("CODEX_NAOYA_", new SkillSlot { Name = "NaoyaFrameShatter", TokenSuffix = "SHATTER", State = typeof(NaoyaShatterState), Icon = NaoyaAssets.ShatterIcon, Cooldown = 0f, MustKeyPress = true, Priority = (InterruptPriority)1 }); JujutsuContentPack.EntityStates.Add(typeof(NaoyaShatterState)); JujutsuContentPack.EntityStates.Add(typeof(NaoyaSealedState)); Color colour = NaoyaLanguage.Colour; MixamoCharacterModel val = new MixamoCharacterModel("Naoya", "naoya.model", "naoya", 1.1f, "naoya.anim"); Dictionary dictionary = new Dictionary { ["Primary"] = new SkillSlot { Name = "NaoyaZeninStyle", TokenSuffix = "PRIMARY", State = typeof(NaoyaKickState), Icon = NaoyaAssets.KickIcon, Cooldown = 0f, MustKeyPress = false, Priority = (InterruptPriority)0 }, ["Secondary"] = new SkillSlot { Name = "NaoyaFrameLock", TokenSuffix = "SECONDARY", State = typeof(NaoyaPalmState), Icon = NaoyaAssets.PalmIcon, Cooldown = 4.5f, EnergyCost = 14f } }; SkillSlot val2 = new SkillSlot(); val2.Name = "NaoyaTrace"; val2.TokenSuffix = "UTILITY"; val2.State = typeof(NaoyaTraceState); val2.Icon = NaoyaAssets.TraceIcon; val2.Cooldown = 7f; val2.MaxStock = 1; val2.EnergyCost = 8f; val2.MustKeyPress = true; val2.Alternatives = (SkillSlot[])(object)new SkillSlot[1] { new SkillSlot { Name = "NaoyaFrameCorridor", TokenSuffix = "CORRIDOR", State = typeof(NaoyaCorridorState), Icon = NaoyaAssets.CorridorIcon, Cooldown = 11f, EnergyCost = 20f } }; dictionary["Utility"] = val2; dictionary["Special"] = new SkillSlot { Name = "NaoyaTwentyFourFrames", TokenSuffix = "SPECIAL", State = typeof(NaoyaStompState), Icon = NaoyaAssets.FramesIcon, Cooldown = 14f, EnergyCost = 33f, Priority = (InterruptPriority)2 }; SurvivorDef = JujutsuNewcomers.Build("NaoyaZeninBody", "NaoyaZeninMonsterMaster", "NaoyaZeninDisplay", "NaoyaZenin", "CODEX_NAOYA_", colour, 94f, val, 115f, 15f, 0f, 8.6f, dictionary, new Dictionary { ["SideBleedout"] = new SkillSlot { Name = "NaoyaBleedout", TokenSuffix = "BLEEDOUT", State = typeof(NaoyaBleedoutState), Icon = NaoyaAssets.BleedoutIcon, Cooldown = 12f, EnergyCost = 22f }, ["SideStep"] = new SkillSlot { Name = "NaoyaSidestep", TokenSuffix = "SIDESTEP", State = typeof(NaoyaSidestepState), Icon = NaoyaAssets.SidestepIcon, Cooldown = 4f, MaxStock = 1, Priority = (InterruptPriority)1 }, ["SideDomain"] = new SkillSlot { Name = "NaoyaDomain", TokenSuffix = "DOMAIN", State = typeof(NaoyaDomainState), Icon = NaoyaAssets.DomainIcon, Cooldown = 80f, EnergyCostFraction = JujutsuConfig.DomainEnergyFraction.Value, Priority = (InterruptPriority)2 } }, GojoAssets.LoadPersistentTexture("ui/naoya-portrait.png", "texNaoyaPortrait"), NaoyaAssets.FrameIcon, (Action)ConfigureBody, (Action)null); JujutsuCharacter val3 = new JujutsuCharacter(); val3.Key = "Naoya"; val3.BodyPrefix = "NaoyaZenin"; val3.MenuOrder = 4; val3.Hints = new string[25] { "The film fills while you are moving and empties while you are not", "Frame Lock seals what it touches in glass - everything hits a sealed body harder", "Hit a sealed enemy and the glass breaks with them inside it, for a lot", "M2 again breaks every frame standing at once, without going near them", "A frame nobody breaks collapses on its own way out - hurt, bleeding, and cracked for a while after", "Shift is the stance - nothing moves until you answer the letter, and every press buys a line", "Answer the key faster and the line it buys runs faster", "Every step of a run is paid for out of the bar - the run ends when it cannot buy the next one", "Everything a trace runs through is sealed in glass behind him", "Shift again to put a run down, or jump: it ends there and costs you nothing", "Answer with the wrong key and his own rule catches him - sealed in his own glass, film gone", "A line stopped by a wall in its first metres freezes you where you stand", "Frame Corridor is the other Shift: a row of glass laid down the aim, sealing everything standing in it", "Then he runs the row through and breaks every frame with its body still inside", "A corridor stopped short leaves the frames past it standing, sealed, to collapse on their own", "Tap A twice, or D twice, and he steps that way - one step banked, no energy, a few seconds back", "T seals the palace - everything inside is billed for its speed, and the fastest pay the most", "The special is the heel brought down: everything around the landing is sealed in glass at once", "After the stomp, M2 breaks the whole sealed room in one press", "M5 is the only thing he throws: one stab, projected the whole way down the line", "Stab something that is already bleeding and it starts to hemorrhage", "He steps out of blows on his own sometimes - the fuller the film, the more often", "Die holding three quarters of the bar and the grudge stands up without you: half its health, a burning fuse, free flight, the palace, and the hull for a weapon", "The curse's clock stops for a kill and holds while its palace stands - feed it a crowd, or seal the room and stop burning", "The capsule itself is the weapon, and the blow is the speed - the faster you fly through them, the harder they are hit" }; val3.Survivor = SurvivorDef; JujutsuCharacters.Register(val3); } private static void ConfigureBody(GameObject bodyPrefab, SideSlots slots) { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); JujutsuNewcomers.GiveSkinIcon(bodyPrefab, "naoya-skin-default"); if (((SideSlots)(ref slots)).Made.ContainsKey("SideDomain") && ((SideSlots)(ref slots)).Made.ContainsKey("SideBleedout") && ((SideSlots)(ref slots)).Made.ContainsKey("SideStep")) { bodyPrefab.AddComponent().Configure(((SideSlots)(ref slots)).Made["SideDomain"], ((SideSlots)(ref slots)).Made["SideBleedout"]); bodyPrefab.AddComponent().Configure(((SideSlots)(ref slots)).Made["SideStep"]); bodyPrefab.AddComponent(); bodyPrefab.AddComponent().Configure((Slot[])(object)new Slot[2] { new Slot { Skill = ((SideSlots)(ref slots)).Made["SideBleedout"], Icon = NaoyaAssets.BleedoutIcon, Key = (BindKey)2, ShortName = "BLADE", Accent = ((SideSlots)(ref slots)).Accent }, new Slot { Skill = ((SideSlots)(ref slots)).Made["SideDomain"], Icon = NaoyaAssets.DomainIcon, Key = (BindKey)3, ShortName = "DOMAIN", Accent = ((SideSlots)(ref slots)).Accent } }); } } } } namespace GojoSatoruMod.Components { internal sealed class NaoyaCorridorPath { private readonly Vector3 start; private readonly Vector3 line; private readonly float length; internal float Span => length; internal Vector3 Start => start; internal Vector3 End => start + line * length; internal static NaoyaCorridorPath Build(Vector3 from, Vector3 aim, float span) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return new NaoyaCorridorPath(from, aim, span); } private NaoyaCorridorPath(Vector3 from, Vector3 aim, float span) { //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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0065: 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) start = from; length = Mathf.Max(1f, span); if (((Vector3)(ref aim)).sqrMagnitude > 0.0001f) { ((Vector3)(ref aim)).Normalize(); } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(aim.x, Mathf.Max(0f, aim.y), aim.z); line = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val)).normalized : Vector3.forward); } internal Vector3 PointAt(float arc) { //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_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) return start + line * Mathf.Clamp(arc, 0f, length); } internal Vector3 TangentAt(float arc) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return line; } internal float Closest(Vector3 point, float from, float to, out float at) { //IL_0024: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) from = Mathf.Clamp(from, 0f, length); to = Mathf.Clamp(to, from, length); at = Mathf.Clamp(Vector3.Dot(point - start, line), from, to); return Vector3.Distance(point, start + line * at); } internal bool Anywhere(Vector3 point, float reach) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = length + reach; Vector3 val = point - start; return ((Vector3)(ref val)).sqrMagnitude <= num * num; } internal float Advance(Vector3 point, float from, float window) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Closest(point, from, from + Mathf.Max(1f, window), out var at); return Mathf.Max(from, at); } } internal sealed class NaoyaDomainField : MonoBehaviour, IDomainClock { internal static readonly Color Colour = new Color(1f, 0.82f, 0.3f, 1f); internal static readonly Color ShellColour = new Color(0.07f, 0.06f, 0.04f, 1f); internal const float Radius = 28f; internal const float Duration = 10f; internal const float TickInterval = 0.3f; internal const float FloorPerTick = 0.06f; internal const float PerMetre = 0.3f; internal const float SlowSeconds = 1f; internal const float SpeedPerMetre = 0.13f; internal const float RequiredSpeed = 8.6f; internal const float RequiredPerTick = 2.5800002f; internal const float CeilingPerTick = 0.85f; internal const float FreezeThreshold = 1.2f; internal const float FreezeSeconds = 1f; private const float ThemeLift = 2f; private CharacterBody body; private GenericSkill domainSkill; private RuntimeDomainVisual visual; private Vector3 centre; private float damageStat; private float remaining; private float tickStopwatch; private float themeDelay; private bool themePending; private readonly Dictionary lastSeen = new Dictionary(); private readonly List gone = new List(); private readonly List standing = new List(); internal static BuffDef Slowed => Buffs.Slow80; internal bool IsActive => remaining > 0f; public float RemainingSeconds => Mathf.Max(0f, remaining); public float FullDuration => 10f; public GenericSkill DomainSlot => Slot(); private void Awake() { body = ((Component)this).GetComponent(); } private GenericSkill Slot() { if (!Object.op_Implicit((Object)(object)domainSkill)) { domainSkill = ((Component)this).GetComponent()?.DomainSkill; } return domainSkill; } private void HoldCooldown() { GenericSkill val = Slot(); if (Object.op_Implicit((Object)(object)val)) { val.rechargeStopwatch = 0f; } } internal void Activate(Vector3 worldCentre, float ownerDamageStat) { //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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) centre = worldCentre; damageStat = ownerDamageStat; remaining = 10f; tickStopwatch = 0.3f; lastSeen.Clear(); DomainDepth.ReportOnce(body); Plugin.Log.LogInfo((object)("Time Cell Moon Palace opened: " + $"{28f:0.#}m for {10f:0.#}s, " + StatText.Percent(0.06f) + " a tick + " + StatText.Percent(0.3f) + " a metre short of " + StatText.Number(8.6f) + " m/s + " + StatText.Percent(0.13f) + " a metre covered, capped at " + StatText.Percent(0.85f) + "."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaDomainField.cs"); themeDelay = 0f; themePending = DomainMusic.Open((object)this, centre, 28f); if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); } visual = RuntimeVisuals.CreateDomain(centre, 28f, 10f, (Color?)Colour, (Color?)ShellColour, DomainDepth.Rank); JujutsuFxShake.Domain(centre, 28f); } private void FixedUpdate() { if (remaining <= 0f) { return; } HoldCooldown(); remaining -= Time.fixedDeltaTime; if (remaining <= 0f) { Close(); return; } if (themePending) { themeDelay -= Time.fixedDeltaTime; if (themeDelay <= 0f) { themePending = false; DomainMusic.PlayTheme(NaoyaAssets.DomainTheme, DomainMusic.ThemeVolume * 2f); } } if (NetworkServer.active) { tickStopwatch += Time.fixedDeltaTime; if (tickStopwatch >= 0.3f) { tickStopwatch -= 0.3f; Tick(); } } } private void Tick() { //IL_003c: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: 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_0232: Unknown result type (might be due to invalid IL or missing references) ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.teamComponent)) ? (-1) : ((int)body.teamComponent.teamIndex)); float num = 784f; gone.Clear(); Vector3 val2; foreach (KeyValuePair item in lastSeen) { CharacterBody key = item.Key; if (Object.op_Implicit((Object)(object)key) && Object.op_Implicit((Object)(object)key.healthComponent) && key.healthComponent.alive) { val2 = key.corePosition - centre; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { continue; } } gone.Add(key); } for (int i = 0; i < gone.Count; i++) { lastSeen.Remove(gone[i]); } standing.Clear(); for (int j = 0; j < readOnlyInstancesList.Count; j++) { CharacterBody val3 = readOnlyInstancesList[j]; if (Object.op_Implicit((Object)(object)val3) && !((Object)(object)val3.teamComponent == (Object)null) && val3.teamComponent.teamIndex != val && Object.op_Implicit((Object)(object)val3.healthComponent) && val3.healthComponent.alive) { val2 = val3.corePosition - centre; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { standing.Add(val3); } } } float num2 = LiveDamage(); for (int k = 0; k < standing.Count; k++) { CharacterBody val4 = standing[k]; if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.healthComponent) && val4.healthComponent.alive) { Vector3 corePosition = val4.corePosition; if (Object.op_Implicit((Object)(object)Slowed)) { val4.AddTimedBuff(Slowed, 1f, 1); } if (!lastSeen.TryGetValue(val4, out var value)) { lastSeen[val4] = corePosition; continue; } lastSeen[val4] = corePosition; val2 = corePosition - value; float magnitude = ((Vector3)(ref val2)).magnitude; float num3 = Mathf.Clamp(2.5800002f - magnitude, 0f, 2.5800002f); float num4 = Mathf.Min(0.85f, 0.06f + 0.3f * num3 + 0.13f * magnitude); GojoDamageUtility.ApplyDamage(((Component)this).gameObject, val4.healthComponent, num2 * num4, Vector3.zero, false, 0.05f, DamageTypeCombo.GenericSpecial, (DamageColorIndex)5, (Color?)Colour, (float?)0f); } } } private float LiveDamage() { float num = (Object.op_Implicit((Object)(object)body) ? body.damage : 0f); if (!(num > 0.01f)) { return damageStat; } return num; } private void Close() { remaining = 0f; themePending = false; DomainMusic.Stop((object)this); lastSeen.Clear(); gone.Clear(); standing.Clear(); if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); visual = null; } } private void OnDisable() { if (remaining > 0f) { Plugin.Log.LogInfo((object)($"Time Cell Moon Palace ended early with {remaining:0.00}s " + "left: the field was switched off rather than timing out."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaDomainField.cs"); } Close(); } private void OnDestroy() { themePending = false; DomainMusic.Stop((object)this); lastSeen.Clear(); if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); } } } internal sealed class NaoyaFilm : MonoBehaviour { internal const int MaximumFrames = 24; internal const float AttackSpeedPerFrame = 0.009f; internal const float MoveSpeedPerFrame = 0.006f; internal const float GainSeconds = 0.22f; internal const float DecaySeconds = 0.8f; internal const int FramesLostOnHit = 4; private const float MovingShare = 0.6f; internal const float FrozenDamageBonus = 0.4f; internal const float FreezeSeconds = 1f; internal const float FullFilmFreezeSeconds = 1.5f; private static int active; private static bool hooked; private CharacterBody body; private CharacterMotor motor; private int frames; private float gainStopwatch; private float decayStopwatch; private float lastHealth = -1f; private int lastReported = -1; private int remoteFrames; private int nextComboStep; private float lastComboStepAt; internal const float ComboResetSeconds = 1.1f; internal const float SelfFrameCeiling = 1.5f; internal int Frames { get { if (!Simulates) { return remoteFrames; } return frames; } } internal bool Full => Frames >= 24; internal float Fraction => Mathf.Clamp01((float)Frames / 24f); internal float FreezeLength { get { if (!Full) { return 1f; } return 1.5f; } } internal static int ComboSteps => NaoyaKickState.Steps; private bool Simulates => Util.HasEffectiveAuthority(((Component)this).gameObject); internal void ReportRemote(int count) { remoteFrames = Mathf.Clamp(count, 0, 24); } internal int ConsumeComboStep() { if (Time.time - lastComboStepAt > 1.1f) { 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(AddFilm); NaoyaHold.Initialize(); NetworkingAPI.RegisterMessageType(); } } private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); } private void OnEnable() { active++; } private void OnDisable() { active--; frames = 0; } private void FixedUpdate() { if (!Simulates || !Object.op_Implicit((Object)(object)body)) { return; } WatchHealth(); if (Moving()) { decayStopwatch = 0f; gainStopwatch += Time.fixedDeltaTime; if (gainStopwatch >= 0.22f) { gainStopwatch -= 0.22f; Set(frames + 1); } return; } gainStopwatch = 0f; if (frames > 0) { decayStopwatch += Time.fixedDeltaTime; if (decayStopwatch >= 0.8f) { decayStopwatch -= 0.8f; Set(frames - 1); } } } private bool Moving() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)motor) || !Object.op_Implicit((Object)(object)body)) { return false; } Vector3 velocity = motor.velocity; velocity.y = 0f; float num = body.moveSpeed * 0.6f; return ((Vector3)(ref velocity)).sqrMagnitude > num * num; } private void WatchHealth() { HealthComponent healthComponent = body.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { float health = healthComponent.health; if (lastHealth >= 0f && health < lastHealth - 0.01f && frames > 0) { Set(frames - 4); } lastHealth = health; } } internal void LandedHit() { if (Simulates) { decayStopwatch = 0f; Set(frames + 1); } } internal void Trace(int count) { if (Simulates && count > 0) { decayStopwatch = 0f; Set(frames + count); } } internal void Burn(int count) { if (Simulates && count > 0) { Set(frames - count); } } internal int Spend(float share = 1f) { if (!Simulates) { return 0; } int num = frames; Set(num - Mathf.CeilToInt((float)num * Mathf.Clamp01(share))); decayStopwatch = 0f; gainStopwatch = 0f; return num; } private void Set(int value) { int num = Mathf.Clamp(value, 0, 24); if (num != frames) { frames = num; if (Object.op_Implicit((Object)(object)body)) { body.MarkAllStatsDirty(); } if (frames != lastReported && (frames == 24 || frames == 0)) { lastReported = frames; Plugin.Log.LogInfo((object)((frames == 24) ? ($"Naoya's film is full: {24} frames, " + $"+{0.21599999f:P0} attack " + $"speed and +{0.144f:P0} " + "movement speed.") : "Naoya's film has run out."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaFilm.cs"); } } } private static void AddFilm(orig_RecalculateStats original, CharacterBody self) { original.Invoke(self); if (active > 0 && Object.op_Implicit((Object)(object)self)) { NaoyaFilm component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.frames > 0) { self.attackSpeed += (float)component.frames * 0.009f; self.moveSpeed += self.baseMoveSpeed * (float)component.frames * 0.006f; } } } internal static void ReportHit(CharacterBody owner) { NaoyaFilm naoyaFilm = (Object.op_Implicit((Object)(object)owner) ? ((Component)owner).GetComponent() : null); if (Object.op_Implicit((Object)(object)naoyaFilm)) { naoyaFilm.LandedHit(); } } internal static NaoyaFilm Of(CharacterBody owner) { if (!Object.op_Implicit((Object)(object)owner)) { return null; } return ((Component)owner).GetComponent(); } internal static int Freeze(TeamIndex team, Vector3 centre, float radius, float seconds, CharacterBody sealer = null) { //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!NetworkServer.active) { return 0; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return 0; } int num = 0; 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 != team && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { float num2 = radius + val.radius; Vector3 val2 = val.corePosition - centre; if (!(((Vector3)(ref val2)).sqrMagnitude > num2 * num2)) { num++; Catch(val, seconds); NaoyaHold.Pin(val, seconds, sealer); } } } return num; } internal static bool Catch(CharacterBody victim, float seconds) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)victim) || !Object.op_Implicit((Object)(object)victim.healthComponent) || !victim.healthComponent.alive) { return false; } SetStateOnHurt.SetStunOnObject(((Component)victim).gameObject, seconds); if (Object.op_Implicit((Object)(object)NaoyaBuffs.Framed)) { victim.AddTimedBuff(NaoyaBuffs.Framed, seconds, 1); } Refuse(victim, seconds); return true; } private static void Refuse(CharacterBody victim, float seconds) { if (Object.op_Implicit((Object)(object)Buffs.Slow80)) { victim.AddTimedBuff(Buffs.Slow80, seconds, 1); } } internal static void FrameSelf(CharacterBody body, float seconds) { if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)NaoyaBuffs.Framed)) { body.AddTimedBuff(NaoyaBuffs.Framed, seconds, 1); } } internal static void AskSelfFrame(CharacterBody body, float seconds) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { if (NetworkServer.active) { FrameSelf(body, seconds); } else { NetMessageExtensions.Send((INetMessage)(object)new NaoyaSelfFrameMessage(((NetworkBehaviour)body).netId, seconds), (NetworkDestination)2); } } } internal static void ShatterFrame(CharacterBody victim) { //IL_0022: 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) if (NetworkServer.active && Object.op_Implicit((Object)(object)victim) && Object.op_Implicit((Object)(object)NaoyaBuffs.Framed)) { victim.ClearTimedBuffs(NaoyaBuffs.Framed.buffIndex); if (Object.op_Implicit((Object)(object)NaoyaBuffs.Cracked)) { victim.ClearTimedBuffs(NaoyaBuffs.Cracked.buffIndex); } } } internal static bool FramedWithin(TeamIndex team, Vector3 centre, float radius) { //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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)NaoyaBuffs.Framed)) { return false; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return false; } 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 != team && (val.HasBuff(NaoyaBuffs.Framed) || (Object.op_Implicit((Object)(object)NaoyaBuffs.Cracked) && val.HasBuff(NaoyaBuffs.Cracked)))) { float num = radius + val.radius; Vector3 val2 = val.corePosition - centre; if (((Vector3)(ref val2)).sqrMagnitude <= num * num) { return true; } } } return false; } internal static float Weigh(TeamIndex team, Vector3 centre, 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) if (!FramedWithin(team, centre, radius)) { return 1f; } return 1.4f; } } public sealed class NaoyaSelfFrameMessage : INetMessage, ISerializableObject { private NetworkInstanceId bodyId; private float seconds; public NaoyaSelfFrameMessage() { } public NaoyaSelfFrameMessage(NetworkInstanceId bodyId, float seconds) { //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.bodyId = bodyId; this.seconds = seconds; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(bodyId); writer.Write(seconds); } 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) bodyId = reader.ReadNetworkId(); seconds = reader.ReadSingle(); } public void OnReceived() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { GameObject val = Util.FindNetworkObject(bodyId); CharacterBody val2 = (Object.op_Implicit((Object)(object)(Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null)) ? val.GetComponent() : null); if (Object.op_Implicit((Object)(object)val2)) { NaoyaFilm.FrameSelf(val2, Mathf.Clamp(seconds, 0f, 1.5f)); } } } } internal sealed class NaoyaFilmSync : MonoBehaviour { private const float SendInterval = 0.25f; private const int MinimumChange = 2; private CharacterBody body; private NaoyaFilm film; private float lastSentAt = -1000f; private int lastSentValue = -1; private bool logged; internal static void Initialize() { NetworkingAPI.RegisterMessageType(); } private void Awake() { body = ((Component)this).GetComponent(); film = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_00ce: 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) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)film) || NetworkServer.active || !Util.HasEffectiveAuthority(((Component)this).gameObject) || Time.time - lastSentAt < 0.25f) { return; } int frames = film.Frames; if (lastSentValue < 0 || Mathf.Abs(frames - lastSentValue) >= 2) { lastSentAt = Time.time; lastSentValue = frames; if (!logged) { logged = true; Plugin.Log.LogInfo((object)($"Naoya's film: first report for netId {((NetworkBehaviour)body).netId} at " + $"{frames} frames."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaFilmSync.cs"); } NetMessageExtensions.Send((INetMessage)(object)new NaoyaFilmMessage(((NetworkBehaviour)body).netId, frames), (NetworkDestination)2); } } } public sealed class NaoyaFilmMessage : INetMessage, ISerializableObject { private NetworkInstanceId bodyId; private int frames; public NaoyaFilmMessage() { } public NaoyaFilmMessage(NetworkInstanceId bodyId, int frames) { //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.bodyId = bodyId; this.frames = frames; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(bodyId); writer.Write(frames); } 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) bodyId = reader.ReadNetworkId(); frames = reader.ReadInt32(); } public void OnReceived() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { GameObject val = Util.FindNetworkObject(bodyId); (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null)?.ReportRemote(frames); } } } internal static class NaoyaFrameMark { private static bool hooked; 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; HealthComponent.TakeDamage += new hook_TakeDamage(Amplify); } } private static void Amplify(orig_TakeDamage original, HealthComponent self, DamageInfo damageInfo) { try { if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && damageInfo != null && !damageInfo.rejected && damageInfo.damage > 0f && Marked(self.body) && !His(((Component)self.body).gameObject) && !His(damageInfo.attacker)) { damageInfo.damage *= 1.4f; } } catch (Exception arg) { JujutsuLog log = Plugin.Log; if (log != null) { log.LogWarning((object)("Naoya's frame could not be weighed against a blow; the " + $"blow itself is unaffected: {arg}"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaFrameMark.cs"); } } original.Invoke(self, damageInfo); } private static bool Marked(CharacterBody victim) { if (!Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) || !victim.HasBuff(NaoyaBuffs.Framed)) { if (Object.op_Implicit((Object)(object)NaoyaBuffs.Cracked)) { return victim.HasBuff(NaoyaBuffs.Cracked); } return false; } return true; } private static bool His(GameObject candidate) { if (Object.op_Implicit((Object)(object)candidate)) { return Object.op_Implicit((Object)(object)candidate.GetComponent()); } return false; } } internal sealed class NaoyaFrameStep : MonoBehaviour { internal const float BaseChance = 0.12f; internal const float FullChance = 0.38f; internal const float Interval = 2.1f; internal const int FilmCost = 5; private const float StepSpeed = 6.5f; private static int active; private static bool hooked; private CharacterBody body; private float nextStepAt = -1000f; internal static void Initialize() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (!hooked) { hooked = true; NetworkingAPI.RegisterMessageType(); HealthComponent.TakeDamage += new hook_TakeDamage(StepAside); } } private void Awake() { body = ((Component)this).GetComponent(); } private void OnEnable() { active++; } private void OnDisable() { active--; nextStepAt = -1000f; } private bool TryStep(DamageInfo damageInfo) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 if (Time.time < nextStepAt || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive || damageInfo == null || !Object.op_Implicit((Object)(object)damageInfo.attacker) || (int)damageInfo.dotIndex != -1) { return false; } NaoyaFilm naoyaFilm = NaoyaFilm.Of(body); if (!Util.CheckRoll(Mathf.Lerp(0.12f, 0.38f, Object.op_Implicit((Object)(object)naoyaFilm) ? naoyaFilm.Fraction : 0f) * 100f, Object.op_Implicit((Object)(object)body.master) ? body.master : null)) { return false; } nextStepAt = Time.time + 2.1f; return true; } private Vector3 Across(DamageInfo damageInfo) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00aa: Unknown result type (might be due to invalid IL or missing references) Vector3 val = body.corePosition - damageInfo.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = body.transform.forward; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = body.transform.right; } if ((int)Mathf.Abs(damageInfo.position.x * 7f + damageInfo.position.z * 13f) % 2 != 0) { return -val3; } return val3; } private static void StepAside(orig_TakeDamage original, HealthComponent self, DamageInfo damageInfo) { //IL_0070: 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) if (active > 0 && NetworkServer.active && Object.op_Implicit((Object)(object)self) && damageInfo != null && !damageInfo.rejected && Object.op_Implicit((Object)(object)self.body)) { NaoyaFrameStep component = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.TryStep(damageInfo)) { damageInfo.rejected = true; if (Object.op_Implicit((Object)(object)self.body.networkIdentity)) { NetMessageExtensions.Send((INetMessage)(object)new NaoyaFrameStepMessage(self.body.networkIdentity.netId, component.Across(damageInfo)), (NetworkDestination)1); } } } original.Invoke(self, damageInfo); } internal static void Land(CharacterBody body, Vector3 across) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return; } NaoyaFx.Afterimage(body, across); JujutsuMotes.Burst(body.corePosition, across, NaoyaLanguage.Colour, NaoyaFx.Reach(body, 1.1f), (JujutsuMoteKind)2, 7); JujutsuSfxAssets.PlayLightWhoosh(body.corePosition, 0.65f); if (Util.HasEffectiveAuthority(((Component)body).gameObject)) { NaoyaFilm.Of(body)?.Burn(5); CharacterMotor characterMotor = body.characterMotor; if (Object.op_Implicit((Object)(object)characterMotor) && ((Vector3)(ref across)).sqrMagnitude > 0.01f) { Vector3 velocity = characterMotor.velocity; Vector3 val = ((Vector3)(ref across)).normalized * 6.5f; characterMotor.velocity = new Vector3(velocity.x + val.x, velocity.y, velocity.z + val.z); } } } } public sealed class NaoyaFrameStepMessage : INetMessage, ISerializableObject { private NetworkInstanceId bodyId; private Vector3 across; public NaoyaFrameStepMessage() { } public NaoyaFrameStepMessage(NetworkInstanceId bodyId, Vector3 across) { //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.bodyId = bodyId; this.across = across; } 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(bodyId); writer.Write(across); } 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) bodyId = reader.ReadNetworkId(); across = reader.ReadVector3(); } public void OnReceived() { //IL_0001: 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) GameObject val = Util.FindNetworkObject(bodyId); NaoyaFrameStep.Land(Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null, across); } } [DefaultExecutionOrder(-150)] internal sealed class NaoyaGroundGlide : MonoBehaviour { private const float ReachTicks = 6f; private const float MaxReach = 4f; private const float PeakHold = 0.15f; private const float HoldOff = 0.2f; private CharacterBody body; private CharacterMotor motor; private bool wasStable; private float peakSpeed; private float peakExpiresAt; private float holdOffUntil; private Vector3 lastSeenAt; private static float TeleportSpan(float peakSpeed) { return peakSpeed * Time.fixedDeltaTime + 4f + 2f; } private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); } private void OnEnable() { //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) lastSeenAt = ((Component)this).transform.position; holdOffUntil = Time.fixedTime + 0.2f; } private void FixedUpdate() { //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_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_0092: 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_00b0: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)motor) || !Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor)) { return; } KinematicCharacterMotor val = ((BaseCharacterController)motor).Motor; float fixedTime = Time.fixedTime; Vector3 velocity = motor.velocity; velocity.y = 0f; float magnitude = ((Vector3)(ref velocity)).magnitude; if (magnitude >= peakSpeed || fixedTime >= peakExpiresAt) { peakSpeed = magnitude; peakExpiresAt = fixedTime + 0.15f; } Vector3 position = ((Component)this).transform.position; float num = TeleportSpan(peakSpeed); Vector3 val2 = position - lastSeenAt; bool num2 = ((Vector3)(ref val2)).sqrMagnitude > num * num; lastSeenAt = position; if (num2 || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive || !Util.HasEffectiveAuthority(((Component)this).gameObject) || !((Behaviour)motor).enabled || !((Behaviour)val).enabled || !motor.useGravity) { Release(val); holdOffUntil = fixedTime + 0.2f; return; } if (fixedTime < holdOffUntil) { val.GroundDetectionExtraDistance = 0f; wasStable = val.GroundingStatus.IsStableOnGround; return; } bool isStableOnGround = val.GroundingStatus.IsStableOnGround; if (isStableOnGround) { val.GroundDetectionExtraDistance = Mathf.Min(peakSpeed * Time.fixedDeltaTime * 6f, 4f); } else { val.GroundDetectionExtraDistance = 0f; if (wasStable && !val.MustUnground()) { Vector3 velocity2 = motor.velocity; if (velocity2.y > 0f) { velocity2.y = 0f; motor.velocity = velocity2; } } } wasStable = isStableOnGround; } private void Release(KinematicCharacterMotor kinematic) { kinematic.GroundDetectionExtraDistance = 0f; wasStable = false; } private void OnDisable() { if (Object.op_Implicit((Object)(object)motor) && Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor)) { Release(((BaseCharacterController)motor).Motor); } } } internal sealed class NaoyaHold : MonoBehaviour { private const float RestunInterval = 0.5f; private const float DriftAllowance = 0.12f; private const float BreakGrace = 0.2f; internal const float ExitCoefficient = 5f; internal const float CrackedSeconds = 4f; private static bool hooked; private CharacterBody body; private CharacterMotor motor; private RigidbodyMotor rigidbodyMotor; private Rigidbody physicsBody; private CharacterBody sealer; private Vector3 anchor; private float age; private float life; private float sinceRestun; private bool holding; private bool breaking; internal static void Initialize() { if (!hooked) { hooked = true; GlobalEventManager.onServerDamageDealt += Struck; } } private static void Struck(DamageReport report) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if (report == null || !NetworkServer.active || report.damageDealt <= 0f || (int)report.dotType != -1) { return; } try { CharacterBody victimBody = report.victimBody; CharacterBody attackerBody = report.attackerBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody)) { NaoyaHold component = ((Component)victimBody).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.holding && component.age >= 0.2f && component.MayBreak(attackerBody)) { component.Shatter(attackerBody); } } } catch (Exception arg) { JujutsuLog log = Plugin.Log; if (log != null) { log.LogWarning((object)("Naoya's glass could not be broken by a blow; the seal " + $"itself is unaffected: {arg}"), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaHold.cs"); } } } private bool MayBreak(CharacterBody breaker) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) if (Object.op_Implicit((Object)(object)((Component)breaker).GetComponent())) { return true; } if (!breaker.isPlayerControlled || !Object.op_Implicit((Object)(object)breaker.teamComponent)) { return false; } TeamIndex teamIndex = breaker.teamComponent.teamIndex; if (Object.op_Implicit((Object)(object)sealer) && Object.op_Implicit((Object)(object)sealer.teamComponent)) { return teamIndex == sealer.teamComponent.teamIndex; } if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.teamComponent)) { return teamIndex != body.teamComponent.teamIndex; } return false; } internal static void LetGo(CharacterBody victim) { NaoyaHold naoyaHold = (Object.op_Implicit((Object)(object)victim) ? ((Component)victim).GetComponent() : null); if (Object.op_Implicit((Object)(object)naoyaHold)) { naoyaHold.Sleep(quiet: true); } } internal static void LetGoAllSealedBy(CharacterBody by, Vector3 centre, float reach) { //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_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) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)by) || reach <= 0f) { return; } ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return; } for (int i = 0; i < readOnlyInstancesList.Count; i++) { CharacterBody val = readOnlyInstancesList[i]; NaoyaHold naoyaHold = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (Object.op_Implicit((Object)(object)naoyaHold) && naoyaHold.holding && !((Object)(object)naoyaHold.sealer != (Object)(object)by)) { float num = reach + val.radius; Vector3 val2 = val.corePosition - centre; if (((Vector3)(ref val2)).sqrMagnitude <= num * num) { naoyaHold.Sleep(quiet: true); } } } } private void Shatter(CharacterBody breaker) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if (breaking || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)breaker)) { return; } breaking = true; try { float num = 1.4f; NaoyaFilm.ShatterFrame(body); NaoyaGlassCase.Break(body); Sleep(quiet: true); HealthComponent healthComponent = body.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { Vector3 val = body.corePosition - breaker.corePosition; val.y = 0f; val = ((((Vector3)(ref val)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val)).normalized : Vector3.forward); GojoDamageUtility.ApplyDamage(((Component)breaker).gameObject, healthComponent, breaker.damage * 9f * num, val * 2400f + Vector3.up * 700f, Util.CheckRoll(breaker.crit, breaker.master), 1f, DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)1024), (DamageColorIndex)0, (Color?)NaoyaLanguage.Colour, (float?)null); for (int i = 0; i < 3; i++) { DotController.InflictDot(((Component)body).gameObject, ((Component)breaker).gameObject, (HurtBox)null, (DotIndex)0, 5f, 1f, (uint?)null); } Plugin.Log.LogInfo((object)("Naoya's frame on " + ((Object)this).name + " was broken by a blow from " + $"{breaker.GetDisplayName()} after {age:0.##}s for " + StatText.Percent(9f * num) + " of the breaker's damage and " + $"{3} cuts."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaHold.cs"); } } finally { breaking = false; } } private void Lash() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (breaking || !Object.op_Implicit((Object)(object)body)) { return; } breaking = true; try { NaoyaFilm.ShatterFrame(body); NaoyaGlassCase.Break(body); if (Object.op_Implicit((Object)(object)NaoyaBuffs.Cracked)) { body.AddTimedBuff(NaoyaBuffs.Cracked, 4f, 1); } HealthComponent healthComponent = body.healthComponent; if (Object.op_Implicit((Object)(object)sealer) && Object.op_Implicit((Object)(object)healthComponent)) { GojoDamageUtility.ApplyDamage(((Component)sealer).gameObject, healthComponent, sealer.damage * 5f, Vector3.zero, Util.CheckRoll(sealer.crit, sealer.master), 1f, DamageTypeCombo.GenericSecondary, (DamageColorIndex)0, (Color?)NaoyaLanguage.Colour, (float?)null); for (int i = 0; i < 3; i++) { DotController.InflictDot(((Component)body).gameObject, ((Component)sealer).gameObject, (HurtBox)null, (DotIndex)0, 5f, 1f, (uint?)null); } Plugin.Log.LogInfo((object)("Naoya's frame on " + ((Object)this).name + " ran out unbroken after " + $"{age:0.##}s; it collapses for " + StatText.Percent(5f) + ", " + $"{3} cuts, and the cracks " + $"stay for {4f:0.#}s."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaHold.cs"); } } finally { breaking = false; } } internal static void Pin(CharacterBody victim, float seconds, CharacterBody sealer = null) { if (NetworkServer.active && Object.op_Implicit((Object)(object)victim) && !(seconds <= 0f)) { NaoyaHold naoyaHold = ((Component)victim).GetComponent(); if (!Object.op_Implicit((Object)(object)naoyaHold)) { naoyaHold = ((Component)victim).gameObject.AddComponent(); } ((Behaviour)naoyaHold).enabled = true; naoyaHold.Begin(seconds, sealer); } } private void Awake() { body = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); rigidbodyMotor = ((Component)this).GetComponent(); physicsBody = ((Component)this).GetComponent(); } private void Begin(float seconds, CharacterBody by) { //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) age = 0f; life = seconds; sealer = by; sinceRestun = 0.5f; holding = true; breaking = false; anchor = ((Component)this).transform.position; } private void FixedUpdate() { if (!holding) { return; } if (!NetworkServer.active) { Sleep(quiet: true); return; } age += Time.fixedDeltaTime; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { Sleep(quiet: false); return; } if (age >= life || (Object.op_Implicit((Object)(object)NaoyaBuffs.Framed) && !body.HasBuff(NaoyaBuffs.Framed))) { Lash(); Sleep(quiet: true); return; } Still(); sinceRestun += Time.fixedDeltaTime; if (sinceRestun >= 0.5f) { sinceRestun = 0f; SetStateOnHurt.SetStunOnObject(((Component)body).gameObject, Mathf.Max(0.1f, life - age)); } } private void Still() { //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_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)motor)) { motor.moveDirection = Vector3.zero; motor.rootMotion = Vector3.zero; motor.velocity = Vector3.zero; Vector3 val = ((Component)this).transform.position - anchor; if (((Vector3)(ref val)).sqrMagnitude > 0.0144f) { if (Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor)) { ((BaseCharacterController)motor).Motor.SetPosition(anchor, true); } else { ((Component)this).transform.position = anchor; } } } if (Object.op_Implicit((Object)(object)rigidbodyMotor)) { rigidbodyMotor.moveVector = Vector3.zero; } if (Object.op_Implicit((Object)(object)physicsBody) && !physicsBody.isKinematic) { physicsBody.velocity = Vector3.zero; physicsBody.angularVelocity = Vector3.zero; physicsBody.position = anchor; } } private void Sleep(bool quiet) { if (holding && !quiet) { Plugin.Log.LogInfo((object)($"Naoya's frame let go of {((Object)this).name} after {age:0.##}s of " + $"{life:0.##}s; nothing here is holding it now."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaHold.cs"); } holding = false; ((Behaviour)this).enabled = false; } } internal sealed class NaoyaSeal : MonoBehaviour { internal const float BreakMargin = 1.4f; internal const int MaxCases = 16; private CharacterBody body; private GenericSkill slot; private bool held; private bool spent; private int keptStock; private float keptStopwatch; private float openedAt; private Vector3 centre; private float radius; private float closesAt; private float payload = 9f; private readonly List emptied = new List(8); internal static NaoyaSeal Of(CharacterBody owner) { if (!Object.op_Implicit((Object)(object)owner)) { return null; } return ((Component)owner).GetComponent(); } private void Awake() { body = ((Component)this).GetComponent(); } internal void Open(Vector3 at, float reach, float seconds, float worth) { //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) centre = at; radius = reach; payload = worth; closesAt = Time.time + Mathf.Max(0.1f, seconds); if (!held || spent) { Close(); slot = ((Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.skillLocator)) ? body.skillLocator.secondary : null); SkillDef shatterSkill = NaoyaSurvivor.ShatterSkill; if (Object.op_Implicit((Object)(object)slot) && Object.op_Implicit((Object)(object)shatterSkill)) { keptStock = slot.stock; keptStopwatch = slot.rechargeStopwatch; openedAt = Time.time; held = true; slot.SetSkillOverride((object)this, shatterSkill, (SkillOverridePriority)4); } } } internal bool Take(out Vector3 at, out float reach, out float worth) { //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 = centre; reach = radius; worth = payload; if (!held || spent) { return false; } spent = true; return true; } private void Update() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (held) { if (spent || Time.time >= closesAt) { Close(); } else if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.teamComponent) && Sealed(body.teamComponent.teamIndex, centre, radius + 1.4f, emptied) == 0) { Close(); } } } private void Close() { if (!held) { return; } held = false; spent = false; if (!Object.op_Implicit((Object)(object)slot)) { slot = null; return; } SkillDef shatterSkill = NaoyaSurvivor.ShatterSkill; if (Object.op_Implicit((Object)(object)shatterSkill)) { slot.UnsetSkillOverride((object)this, shatterSkill, (SkillOverridePriority)4); } slot.stock = keptStock; slot.rechargeStopwatch = Mathf.Max(0f, keptStopwatch + (Time.time - openedAt)); slot = null; } private void OnDisable() { Close(); } internal static int Sealed(TeamIndex team, Vector3 centre, float radius, List into) { //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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (into == null) { return 0; } into.Clear(); ReadOnlyCollection readOnlyInstancesList = CharacterBody.readOnlyInstancesList; if (readOnlyInstancesList == null) { return 0; } 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 != team && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { float num = radius + val.radius; Vector3 val2 = val.corePosition - centre; if (((Vector3)(ref val2)).sqrMagnitude <= num * num) { into.Add(val); } } } return into.Count; } } internal sealed class NaoyaSideSkillController : MonoBehaviour { [SerializeField] private GenericSkill domainSkill; [SerializeField] private GenericSkill bleedoutSkill; private bool wasDomainHeld; private bool wasBleedoutHeld; internal GenericSkill DomainSkill => domainSkill; internal void Configure(GenericSkill domain, GenericSkill bleedout) { domainSkill = domain; bleedoutSkill = bleedout; } private void Update() { //IL_003b: 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) CharacterBody component = ((Component)this).GetComponent(); if (JujutsuInput.IsBlocked || !Object.op_Implicit((Object)(object)component) || !component.isPlayerControlled || !component.hasEffectiveAuthority) { wasDomainHeld = false; wasBleedoutHeld = false; } else { wasDomainHeld = Edge(JujutsuConfig.DomainKey.Value, wasDomainHeld, domainSkill); wasBleedoutHeld = Edge(JujutsuConfig.SideSkill2Key.Value, wasBleedoutHeld, bleedoutSkill); } } private static bool Edge(KeyboardShortcut key, bool wasHeld, GenericSkill skill) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) bool key2 = JujutsuInput.GetKey(key); if (key2 && !wasHeld && Object.op_Implicit((Object)(object)skill)) { skill.ExecuteIfReady(); } return key2; } } internal sealed class NaoyaSidestep : MonoBehaviour { internal const float TapWindow = 0.18f; private const float RefusedVolume = 0.28f; [SerializeField] private GenericSkill sidestepSkill; private CharacterBody body; private InputBankTest input; private EntityStateMachine bodyMachine; private bool leftHeld; private bool rightHeld; private bool waiting; private bool waitingLeft; private float waitingSince; internal float Side { get; private set; } = 1f; internal void Configure(GenericSkill sidestep) { sidestepSkill = sidestep; } private void Awake() { body = ((Component)this).GetComponent(); input = ((Component)this).GetComponent(); bodyMachine = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Body"); } private void Update() { if (JujutsuInput.IsBlocked || !Object.op_Implicit((Object)(object)input) || !Object.op_Implicit((Object)(object)body) || !body.isPlayerControlled || !body.hasEffectiveAuthority) { Forget(); return; } bool down = input.rawMoveLeft.down; bool down2 = input.rawMoveRight.down; bool flag = down && !leftHeld; bool flag2 = down2 && !rightHeld; leftHeld = down; rightHeld = down2; if (flag == flag2) { if (flag) { waiting = false; } } else if (waiting && flag == waitingLeft && Time.time - waitingSince <= 0.18f) { waiting = false; Step(flag); } else { waiting = true; waitingLeft = flag; waitingSince = Time.time; } } private void Forget() { waiting = false; leftHeld = Object.op_Implicit((Object)(object)input) && input.rawMoveLeft.down; rightHeld = Object.op_Implicit((Object)(object)input) && input.rawMoveRight.down; } private void Step(bool left) { if (Object.op_Implicit((Object)(object)sidestepSkill) && (!Object.op_Implicit((Object)(object)bodyMachine) || bodyMachine.CanInterruptState((InterruptPriority)1))) { if (sidestepSkill.stock < 1) { Refuse(); return; } Side = (left ? (-1f) : 1f); sidestepSkill.ExecuteIfReady(); } } private void Refuse() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) JujutsuSfxAssets.PlayLightWhoosh(body.corePosition, 0.28f); } } internal sealed class NaoyaTraceCheck : MonoBehaviour { internal enum Way { None, Up, Left, Down, Right } internal const int Lookahead = 3; private const float FlashSeconds = 0.22f; private bool running; private float left = 1f; private Way key; private readonly Way[] ahead = new Way[3]; private int frames; private int chain; private float step; private float litAt = -99f; private float wrongAt = -99f; internal bool Asking => running; internal bool Showing { get { if (!running) { return Time.time - wrongAt < 0.22f; } return true; } } internal float Left => left; internal float Age => Time.time - litAt; internal Way Key => key; internal int Frames => frames; internal int Chain => chain; internal float Step => step; internal bool Wrong => Time.time - wrongAt < 0.22f; internal Way Ahead(int index) { if (index < 0 || index >= 3) { return Way.None; } return ahead[index]; } internal void Begin(Way[] letters, int chainLength, int tracedFrames, float metres) { running = true; left = 1f; key = ((letters != null && letters.Length != 0) ? letters[0] : Way.None); for (int i = 0; i < 3; i++) { ahead[i] = ((letters != null && letters.Length > i + 1) ? letters[i + 1] : Way.None); } chain = chainLength; frames = tracedFrames; step = metres; litAt = Time.time; } internal void Advance(float remaining, int tracedFrames) { left = Mathf.Clamp01(remaining); frames = tracedFrames; } internal void Missed() { wrongAt = Time.time; running = false; Forget(); } internal void Close() { running = false; left = 0f; Forget(); } private void Forget() { for (int i = 0; i < 3; i++) { ahead[i] = Way.None; } } internal static void Initialize() { NetworkingAPI.RegisterMessageType(); } internal static void Publish(CharacterBody body, Vector3 origin, Vector3 heading, float speed, bool relayed = false) { //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_0010: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { NetMessageExtensions.Send((INetMessage)(object)new NaoyaTraceSegmentMessage(((NetworkBehaviour)body).netId, origin, heading, speed, relayed), (NetworkDestination)(NetworkServer.active ? 1 : 2)); } } } public sealed class NaoyaTraceSegmentMessage : INetMessage, ISerializableObject { private NetworkInstanceId bodyId; private Vector3 origin; private Vector3 heading; private float speed; private bool relayed; public NaoyaTraceSegmentMessage() { } public NaoyaTraceSegmentMessage(NetworkInstanceId bodyId, Vector3 origin, Vector3 heading, float speed, bool relayed) { //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.bodyId = bodyId; this.origin = origin; this.heading = heading; this.speed = speed; 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(bodyId); writer.Write(origin); writer.Write(heading); writer.Write(speed); 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) bodyId = reader.ReadNetworkId(); origin = reader.ReadVector3(); heading = reader.ReadVector3(); speed = reader.ReadSingle(); relayed = reader.ReadBoolean(); } public void OnReceived() { //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_000d: Unknown result type (might be due to invalid IL or missing references) NaoyaTraceState.AcceptSegment(bodyId, origin, heading, speed, relayed); } } internal sealed class NaoyaTraceCheckHud : MonoBehaviour { private sealed class Cap { internal RectTransform Rect; internal Image Border; internal Image Plate; internal TextMeshProUGUI Letter; } private const float LiftAboveCentre = 104f; private const float CapSize = 74f; private const float SmallCapSize = 40f; private const float SmallCapStep = 48f; private const float PopScale = 1.22f; private const float PopSeconds = 0.1f; private static readonly Color Waiting = Color.white; private static readonly Color Missed = new Color(1f, 0.35f, 0.3f, 1f); private static readonly Color Plate = new Color(0.02f, 0.05f, 0.06f, 0.86f); private static bool hooked; private static bool reportedAnchor; private HUD hud; private CanvasGroup group; private Cap current; private Cap[] upcoming; private TextMeshProUGUI caption; 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)("Naoya's trace letters could not be built: " + ex), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaTraceCheckHud.cs"); } } private static void Build(HUD hud) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_005f: 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_0089: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01fa: 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_0223: Unknown result type (might be due to invalid IL or missing references) Transform val = JujutsuHudAnchor.Container(hud, ref reportedAnchor); if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = new GameObject("NaoyaTraceKeys", 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, 0.5f); val3.sizeDelta = new Vector2(288f, 170f); val3.anchoredPosition = new Vector2(0f, 104f); NaoyaTraceCheckHud naoyaTraceCheckHud = val2.AddComponent(); naoyaTraceCheckHud.hud = hud; naoyaTraceCheckHud.group = val2.GetComponent(); naoyaTraceCheckHud.group.blocksRaycasts = false; naoyaTraceCheckHud.group.interactable = false; naoyaTraceCheckHud.group.alpha = 0f; naoyaTraceCheckHud.current = MakeCap(val3, "Key", 74f, 40f, 0f, 2f); naoyaTraceCheckHud.upcoming = new Cap[3]; float num = -48f; for (int i = 0; i < naoyaTraceCheckHud.upcoming.Length; i++) { naoyaTraceCheckHud.upcoming[i] = MakeCap(val3, "Next" + (i + 1), 40f, -22f, num + 48f * (float)i, 1.5f); } naoyaTraceCheckHud.caption = JujutsuHudAnchor.Text(val3, "Caption", 13f, NaoyaLanguage.Colour); ((TMP_Text)naoyaTraceCheckHud.caption).alignment = (TextAlignmentOptions)514; RectTransform rectTransform = ((TMP_Text)naoyaTraceCheckHud.caption).rectTransform; rectTransform.anchorMin = new Vector2(0.5f, 0.5f); rectTransform.anchorMax = new Vector2(0.5f, 0.5f); rectTransform.pivot = new Vector2(0.5f, 1f); rectTransform.sizeDelta = new Vector2(288f, 18f); rectTransform.anchoredPosition = new Vector2(0f, -50f); Plugin.Log.LogInfo((object)("Naoya's trace letters built as a HUD element, " + 3 + " queued behind the one asked for."), "C:\\Users\\user\\Documents\\risk of rain 2\\src\\Naoya\\Components\\NaoyaTraceCheckHud.cs"); } } private static Cap MakeCap(RectTransform parent, string name, float size, float y, float x, float border) { //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_0024: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00bc: 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_00f6: Unknown result type (might be due to invalid IL or missing references) RectTransform val = (RectTransform)new GameObject(name, new Type[1] { typeof(RectTransform) }).transform; ((Transform)val).SetParent((Transform)(object)parent, false); val.anchorMin = new Vector2(0.5f, 0.5f); val.anchorMax = new Vector2(0.5f, 0.5f); val.pivot = new Vector2(0.5f, 0.5f); val.sizeDelta = new Vector2(size, size); val.anchoredPosition = new Vector2(x, y); Cap obj = new Cap { Rect = val, Border = JujutsuHudAnchor.Fill(val, "Border", new Color(NaoyaLanguage.Colour.r, NaoyaLanguage.Colour.g, NaoyaLanguage.Colour.b, 0.55f), border), Plate = JujutsuHudAnchor.Fill(val, "Plate", Plate, 0f), Letter = JujutsuHudAnchor.Text(val, "Letter", size * 0.72f, Waiting) }; ((TMP_Text)obj.Letter).alignment = (TextAlignmentOptions)514; ((TMP_Text)obj.Letter).fontStyle = (FontStyles)1; return obj; } private void Update() { GameObject val = (Object.op_Implicit((Object)(object)hud) ? hud.targetBodyObject : null); NaoyaTraceCheck naoyaTraceCheck = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); bool flag = Object.op_Implicit((Object)(object)naoyaTraceCheck) && naoyaTraceCheck.Showing; if (group.alpha != (flag ? 1f : 0f)) { group.alpha = (flag ? 1f : 0f); } if (flag) { DrawCurrent(naoyaTraceCheck); DrawQueue(naoyaTraceCheck); ((TMP_Text)caption).text = "×" + naoyaTraceCheck.Chain + " · " + naoyaTraceCheck.Step.ToString("0.0") + " M · FILM " + naoyaTraceCheck.Frames + " / " + 24; } } private void DrawCurrent(NaoyaTraceCheck check) { //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_004f: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_011d: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)current.Letter).text = Letter(check.Key); Color color = (check.Wrong ? Missed : ((check.Age < 0.1f) ? NaoyaLanguage.Colour : Waiting)); ((Graphic)current.Letter).color = color; float num = (check.Asking ? Mathf.Lerp(0.4f, 1f, check.Left) : 1f); ((TMP_Text)current.Letter).alpha = num; Tint(current.Border, check.Wrong ? Missed : NaoyaLanguage.Colour, 0.2f + 0.5f * num); Tint(current.Plate, Plate, Plate.a); float num2 = (check.Asking ? Mathf.Lerp(1.22f, 1f, Mathf.Clamp01(check.Age / 0.1f)) : 1f); ((Transform)current.Rect).localScale = new Vector3(num2, num2, 1f); } private void DrawQueue(NaoyaTraceCheck check) { //IL_0080: 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_00ce: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < upcoming.Length; i++) { NaoyaTraceCheck.Way way = check.Ahead(i); bool flag = way != NaoyaTraceCheck.Way.None; if (((Component)upcoming[i].Rect).gameObject.activeSelf != flag) { ((Component)upcoming[i].Rect).gameObject.SetActive(flag); } if (flag) { float num = 1f - (float)i * 0.22f; ((TMP_Text)upcoming[i].Letter).text = Letter(way); ((Graphic)upcoming[i].Letter).color = Waiting; ((TMP_Text)upcoming[i].Letter).alpha = 0.55f * num; Tint(upcoming[i].Border, NaoyaLanguage.Colour, 0.3f * num); Tint(upcoming[i].Plate, Plate, Plate.a * 0.7f * num); } } } private static void Tint(Image image, Color colour, float alpha) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) ((Graphic)image).color = new Color(colour.r, colour.g, colour.b, alpha); } private static string Letter(NaoyaTraceCheck.Way way) { return way switch { NaoyaTraceCheck.Way.Up => "W", NaoyaTraceCheck.Way.Left => "A", NaoyaTraceCheck.Way.Down => "S", NaoyaTraceCheck.Way.Right => "D", _ => string.Empty, }; } } }