using System; using System.Collections; using System.Collections.Generic; 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 System.Text; using BepInEx; using EntityStates; using GojoSatoruMod.Components; using GojoSatoruMod.Content; using GojoSatoruMod.States; using GojoSatoruMod.Visuals; using R2API; using R2API.Utils; using RoR2; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RyomenSukuna")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.6.0")] [assembly: AssemblyInformationalVersion("1.1.6+979ebb1e7dfa654951bfcb18204e3745b8f33ff9")] [assembly: AssemblyProduct("RyomenSukuna")] [assembly: AssemblyTitle("RyomenSukuna")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.6.0")] [module: UnverifiableCode] namespace GojoSatoruMod.Visuals { internal sealed class RuntimeFugaPillar : MonoBehaviour { private const int TongueCount = 20; private const int CoreCount = 6; private const int Segments = 14; private const float ClimbSeconds = 0.62f; private readonly List materials = new List(); private LineRenderer[] tongues; private LineRenderer[] core; private Material tongueMaterial; private Material coreMaterial; private Color tongueBase; private Color coreBase; private Vector3 root; private float radius; private float height; private float ignition; private float fade = 1f; private float age; internal void Initialize(Vector3 basePosition, float effectRadius) { //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_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_003e: 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_0089: Unknown result type (might be due to invalid IL or missing references) root = basePosition; radius = Mathf.Max(1f, effectRadius); tongueBase = new Color(1f, 0.42f, 0.03f, 0.95f); tongueMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaPillarTongues", tongueBase, 1.5f); materials.Add(tongueMaterial); coreBase = new Color(1f, 0.86f, 0.42f, 0.95f); coreMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaPillarCore", coreBase, 1.5f); materials.Add(coreMaterial); tongues = Build("FugaPillarTongue_", 20, tongueMaterial); core = Build("FugaPillarCore_", 6, coreMaterial); } internal void SetState(float takeHold, float remaining) { ignition = Mathf.Clamp01(takeHold); fade = Mathf.Clamp01(remaining); } private LineRenderer[] Build(string prefix, int count, Material material) { //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) LineRenderer[] array = (LineRenderer[])(object)new LineRenderer[count]; for (int i = 0; i < count; i++) { GameObject val = new GameObject(prefix + i); val.transform.SetParent(((Component)this).transform, true); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = true; val2.positionCount = 14; val2.numCornerVertices = 3; val2.numCapVertices = 3; ((Renderer)val2).material = material; array[i] = val2; } return array; } private void Update() { //IL_0071: 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) age += Time.deltaTime; height = Mathf.Lerp(3f, radius * 1.7f, ignition); Shape(tongues, 0.3f, 1f, 0.62f); Shape(core, 0.085f, 0.78f, 1f); JujutsuFxMaterials.SetEnvelope(tongueMaterial, tongueBase, fade, 1.5f); JujutsuFxMaterials.SetEnvelope(coreMaterial, coreBase, fade, 1.5f); } private void Shape(LineRenderer[] set, float spread, float reach, float weight) { //IL_0147: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) if (set == null) { return; } Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); Color endColor = default(Color); for (int i = 0; i < set.Length; i++) { LineRenderer val = set[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i * 2.39996f; float num2 = Mathf.Repeat(age / 0.62f + (float)i / (float)set.Length, 1f); float num3 = Mathf.SmoothStep(0f, 1f, num2); float num4 = height * reach * Mathf.Lerp(0.55f, 1f, num3); float num5 = radius * spread * (0.35f + (float)(i % 5) * 0.19f); float num6 = ((i % 2 == 0) ? 1f : (-1f)) * (0.9f + (float)(i % 3) * 0.35f); for (int j = 0; j < 14; j++) { float num7 = (float)j / 13f; float num8 = Mathf.Lerp(1f, 0.28f, num7) + num7 * num7 * 0.85f; float num9 = num + num7 * 2.1f + age * num6; float num10 = Mathf.Sin(num7 * 6.5f - age * 7.5f + num) * radius * 0.055f * (0.25f + num7); ((Vector3)(ref val2))..ctor(Mathf.Cos(num9), 0f, Mathf.Sin(num9)); ((Vector3)(ref val3))..ctor(0f - val2.z, 0f, val2.x); val.SetPosition(j, root + Vector3.up * (num4 * num7) + val2 * (num5 * num8) + val3 * num10); } float num11 = (1f - num3) * fade * ignition; Color startColor = ((i % 4 == 0) ? new Color(1f, 0.88f, 0.45f, 0.95f * num11) : new Color(1f, 0.36f, 0.03f, 0.88f * num11)); ((Color)(ref endColor))..ctor(0.42f, 0.02f, 0.004f, 0f); val.startColor = startColor; val.endColor = endColor; val.widthMultiplier = radius * weight * (0.055f + (float)(i % 4) * 0.014f) * (0.45f + (1f - num3) * 0.85f) * fade; } } } private void OnDestroy() { for (int i = 0; i < materials.Count; i++) { if (Object.op_Implicit((Object)(object)materials[i])) { Object.Destroy((Object)(object)materials[i]); } } materials.Clear(); } } internal static class SukunaFugaVisuals { internal static RuntimeFugaExplosionVisual CreateFugaExplosion(Vector3 impactPosition, Vector3 groundPosition, float radius, float duration = 8.5f, FugaExplosionDetail detail = FugaExplosionDetail.Blast) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) RuntimeFugaExplosionVisual runtimeFugaExplosionVisual = new GameObject("SukunaFugaExplosion").AddComponent(); runtimeFugaExplosionVisual.Initialize(impactPosition, groundPosition, radius, duration, detail); return runtimeFugaExplosionVisual; } internal static RuntimeFugaProjectileVisual AddFugaProjectileFlames(GameObject projectileObject, Vector3 direction) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)projectileObject)) { return null; } RuntimeFugaProjectileVisual runtimeFugaProjectileVisual = projectileObject.AddComponent(); runtimeFugaProjectileVisual.Initialize(direction); return runtimeFugaProjectileVisual; } } internal enum FugaExplosionDetail { Blast, Flare } internal sealed class RuntimeFugaProjectileVisual : MonoBehaviour { private const int FlameCount = 10; private const int FlameSegments = 7; private readonly List materials = new List(); private LineRenderer[] flames; private TrailRenderer[] trails; private Vector3 direction; private Vector3 lastPosition; private float age; internal void Initialize(Vector3 initialDirection) { //IL_0018: 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_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_002e: Unknown result type (might be due to invalid IL or missing references) direction = ((((Vector3)(ref initialDirection)).sqrMagnitude > 0.001f) ? ((Vector3)(ref initialDirection)).normalized : Vector3.forward); lastPosition = ((Component)this).transform.position; BuildFlames(); BuildTrails(); } internal void SetDirection(Vector3 newDirection) { //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) if (((Vector3)(ref newDirection)).sqrMagnitude > 0.001f) { direction = ((Vector3)(ref newDirection)).normalized; } } internal void Stop() { if (flames != null) { for (int i = 0; i < flames.Length; i++) { if (Object.op_Implicit((Object)(object)flames[i])) { ((Renderer)flames[i]).enabled = false; } } } if (trails != null) { for (int j = 0; j < trails.Length; j++) { if (Object.op_Implicit((Object)(object)trails[j])) { trails[j].emitting = false; } } } ((Behaviour)this).enabled = false; } private void BuildFlames() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) flames = (LineRenderer[])(object)new LineRenderer[10]; Material val = JujutsuFxMaterials.CreateLineMaterial("matFugaProjectileFlames", new Color(1f, 0.25f, 0.015f, 0.92f), 1.5f); materials.Add(val); for (int i = 0; i < 10; i++) { GameObject val2 = new GameObject("FugaProjectileFlame_" + i); val2.transform.SetParent(((Component)this).transform, false); LineRenderer val3 = val2.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val3); val3.useWorldSpace = true; val3.positionCount = 7; val3.numCornerVertices = 4; val3.numCapVertices = 4; Color val4 = (val3.startColor = (Color)((i % 3) switch { 0 => new Color(1f, 0.76f, 0.12f, 0.95f), 1 => new Color(1f, 0.2f, 0.015f, 0.9f), _ => new Color(0.72f, 0.025f, 0.008f, 0.82f), })); Color endColor = val4; endColor.a = 0f; val3.endColor = endColor; ((Renderer)val3).material = val; flames[i] = val3; } } private void BuildTrails() { //IL_0025: 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_0085: 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_0131: 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_0136: 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_013a: 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_0151: Unknown result type (might be due to invalid IL or missing references) trails = (TrailRenderer[])(object)new TrailRenderer[3]; Material val = JujutsuFxMaterials.CreateLineMaterial("matFugaInfernoTrails", new Color(1f, 0.15f, 0.008f, 0.88f), 1.5f); materials.Add(val); for (int i = 0; i < trails.Length; i++) { GameObject val2 = new GameObject("FugaInfernoTrail_" + i); val2.transform.SetParent(((Component)this).transform, false); float num = (float)i / 3f * MathF.PI * 2f; val2.transform.localPosition = new Vector3(Mathf.Cos(num) * 0.28f, Mathf.Sin(num) * 0.28f, 0f); TrailRenderer val3 = val2.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val3); val3.time = 0.38f + (float)i * 0.09f; val3.minVertexDistance = 0.08f; val3.numCornerVertices = 4; val3.numCapVertices = 3; val3.widthMultiplier = 0.72f - (float)i * 0.12f; Color val4 = ((i == 0) ? new Color(1f, 0.7f, 0.08f, 0.95f) : new Color(1f, 0.08f, 0.005f, 0.82f)); Color endColor = val4; endColor.a = 0f; val3.startColor = val4; val3.endColor = endColor; ((Renderer)val3).material = val; trails[i] = val3; } } private void Update() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00bd: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; Vector3 val = ((Component)this).transform.position - lastPosition; if (((Vector3)(ref val)).sqrMagnitude > 0.0025f) { direction = Vector3.Slerp(direction, ((Vector3)(ref val)).normalized, Mathf.Clamp01(Time.deltaTime * 18f)); } lastPosition = ((Component)this).transform.position; Vector3 val2 = Vector3.Cross(Vector3.up, direction); if (((Vector3)(ref val2)).sqrMagnitude < 0.001f) { val2 = Vector3.right; } ((Vector3)(ref val2)).Normalize(); Vector3 val3 = Vector3.Cross(direction, val2); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Mathf.Max(0.45f, ((Component)this).transform.localScale.x); for (int i = 0; i < flames.Length; i++) { LineRenderer val4 = flames[i]; if (Object.op_Implicit((Object)(object)val4)) { float num2 = (float)i / 10f * MathF.PI * 2f; float num3 = num * (2.4f + (float)(i % 4) * 0.42f); for (int j = 0; j < 7; j++) { float num4 = (float)j / 6f; float num5 = Mathf.Sin(age * (13f + (float)i * 0.22f) + num4 * 9f + num2) * num * (0.18f + num4 * 0.36f); float num6 = num2 + num4 * 2.4f + age * (2.5f + (float)i * 0.08f); Vector3 val5 = val2 * Mathf.Cos(num6) + normalized * Mathf.Sin(num6); val4.SetPosition(j, ((Component)this).transform.position - direction * num3 * num4 + val5 * (num * (0.26f + num4 * 0.52f)) + normalized * num5); } val4.widthMultiplier = num * (0.26f + (float)(i % 3) * 0.07f) * (1f + Mathf.Sin(age * 17f + num2) * 0.18f); } } } private void OnDestroy() { for (int i = 0; i < materials.Count; i++) { if (Object.op_Implicit((Object)(object)materials[i])) { Object.Destroy((Object)(object)materials[i]); } } materials.Clear(); } } internal sealed class RuntimeFugaExplosionVisual : MonoBehaviour { private const int RingSegments = 72; private const int FlameRayCount = 14; private const int FlameTongueCount = 30; private const int FlameTongueSegments = 8; private const int EmberCount = 24; private const int ShockwaveCount = 3; internal const float BlastDuration = 8.5f; internal const float FlareDuration = 1.7f; private const int BlastGroundSpokes = 36; private const int BlastGroundRings = 12; private const int FlareGroundSpokes = 16; private const int FlareGroundRings = 5; private readonly List materials = new List(); private JujutsuGroundField ground; private RuntimeFugaPillar pillar; private LineRenderer[] shockwaves; private Material shockwaveMaterial; private Color shockwaveBaseColor; private LineRenderer[] flameRays; private Material flameRayMaterial; private Color flameRayBaseColor; private LineRenderer[] flameTongues; private Material flameTongueMaterial; private Color flameTongueBaseColor; private LineRenderer[] embers; private Material emberMaterial; private Color emberBaseColor; private Light explosionLight; private Vector3 groundPosition; private float radius; private float duration; private float fadeWindow; private float age; internal void Initialize(Vector3 impactPosition, Vector3 floorPosition, float effectRadius, float lifetime, FugaExplosionDetail detail) { //IL_0006: 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_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) ((Component)this).transform.position = Vector3.zero; radius = Mathf.Max(2f, effectRadius); duration = Mathf.Max(0.4f, lifetime); fadeWindow = Mathf.Min(1.05f, duration * 0.35f); bool flag = detail == FugaExplosionDetail.Blast; ground = JujutsuGroundField.Sample(floorPosition, radius, flag ? 36 : 16, flag ? 12 : 5); groundPosition = ground.PointAt(0f, 0f, 0.08f); BuildFlameTongues(flag ? 30 : 10); BuildEmbers(flag ? 24 : 6); if (flag) { BuildPillar(); BuildShockwave(); BuildFlameRays(); } BuildLight(flag); } private void BuildPillar() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FugaFirePillar"); val.transform.SetParent(((Component)this).transform, true); pillar = val.AddComponent(); pillar.Initialize(groundPosition, radius); } private void BuildShockwave() { //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_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_0071: Unknown result type (might be due to invalid IL or missing references) shockwaves = (LineRenderer[])(object)new LineRenderer[3]; shockwaveBaseColor = new Color(1f, 0.46f, 0.04f, 0.95f); shockwaveMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaShockwave", shockwaveBaseColor, 1.5f); materials.Add(shockwaveMaterial); for (int i = 0; i < shockwaves.Length; i++) { GameObject val = new GameObject("FugaShockwave_" + i); val.transform.SetParent(((Component)this).transform, true); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = true; val2.loop = true; val2.positionCount = 72; val2.numCapVertices = 4; val2.numCornerVertices = 3; ((Renderer)val2).material = shockwaveMaterial; shockwaves[i] = val2; } } private void BuildFlameTongues(int count) { //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_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_0071: Unknown result type (might be due to invalid IL or missing references) flameTongues = (LineRenderer[])(object)new LineRenderer[count]; flameTongueBaseColor = new Color(1f, 0.32f, 0.015f, 0.88f); flameTongueMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaFlameTongues", flameTongueBaseColor, 1.5f); materials.Add(flameTongueMaterial); for (int i = 0; i < flameTongues.Length; i++) { GameObject val = new GameObject("FugaFlameTongue_" + i); val.transform.SetParent(((Component)this).transform, true); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = true; val2.positionCount = 8; val2.numCornerVertices = 5; val2.numCapVertices = 4; ((Renderer)val2).material = flameTongueMaterial; flameTongues[i] = val2; } } private void BuildEmbers(int count) { //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_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_0071: Unknown result type (might be due to invalid IL or missing references) embers = (LineRenderer[])(object)new LineRenderer[count]; emberBaseColor = new Color(1f, 0.65f, 0.08f, 0.95f); emberMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaEmbers", emberBaseColor, 1.5f); materials.Add(emberMaterial); for (int i = 0; i < embers.Length; i++) { GameObject val = new GameObject("FugaEmber_" + i); val.transform.SetParent(((Component)this).transform, true); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = true; val2.positionCount = 2; val2.numCapVertices = 3; ((Renderer)val2).material = emberMaterial; embers[i] = val2; } } private void BuildFlameRays() { //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_0033: 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) flameRays = (LineRenderer[])(object)new LineRenderer[14]; flameRayBaseColor = new Color(0.95f, 0.055f, 0.006f, 0.68f); flameRayMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaFugaFloorFlames", flameRayBaseColor, 1.5f); materials.Add(flameRayMaterial); for (int i = 0; i < 14; i++) { GameObject val = new GameObject("FugaFloorFlame_" + i); val.transform.SetParent(((Component)this).transform, true); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = true; val2.positionCount = 4; val2.numCapVertices = 3; ((Renderer)val2).material = flameRayMaterial; flameRays[i] = val2; } } private void BuildLight(bool blast) { //IL_0016: 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_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) explosionLight = JujutsuFxLights.TryAdd(((Component)this).gameObject, new Color(1f, 0.2f, 0.02f), 11f, radius * 1.55f, blast); if (Object.op_Implicit((Object)(object)explosionLight)) { ((Component)explosionLight).transform.position = groundPosition + Vector3.up * 7f; } } private void Update() { //IL_008d: 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_00bb: 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) age += Time.deltaTime; float num = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(age / 0.34f)); float num2 = Mathf.Clamp01((duration - age) / fadeWindow); Mathf.Sin(age * 18f); UpdatePillar(num, num2); UpdateShockwave(num2); UpdateFlameRays(num, num2); UpdateFlameTongues(num, num2); UpdateEmbers(num, num2); JujutsuFxMaterials.SetEnvelope(shockwaveMaterial, shockwaveBaseColor, num2, 1.5f); JujutsuFxMaterials.SetEnvelope(flameRayMaterial, flameRayBaseColor, num2, 1.5f); JujutsuFxMaterials.SetEnvelope(flameTongueMaterial, flameTongueBaseColor, num2, 1.5f); JujutsuFxMaterials.SetEnvelope(emberMaterial, emberBaseColor, num2 * num, 1.5f); if (Object.op_Implicit((Object)(object)explosionLight)) { explosionLight.intensity = (11f + Mathf.Sin(age * 23f) * 2.2f) * num2; } if (age >= duration) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void UpdatePillar(float ignition, float fade) { if (Object.op_Implicit((Object)(object)pillar)) { pillar.SetState(ignition, fade); } } private void UpdateShockwave(float fade) { //IL_00ac: 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_00b1: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) if (shockwaves == null) { return; } for (int i = 0; i < shockwaves.Length; i++) { LineRenderer val = shockwaves[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i * 0.16f; float num2 = Mathf.Clamp01((age - num) / (0.72f + (float)i * 0.12f)); float num3 = radius * (1.18f + (float)i * 0.16f) * Mathf.SmoothStep(0f, 1f, num2); Color endColor = (val.startColor = ((i == 0) ? new Color(1f, 0.82f, 0.22f, (1f - num2) * fade) : new Color(1f, 0.18f, 0.015f, (1f - num2) * fade))); val.endColor = endColor; val.widthMultiplier = Mathf.Lerp(2.2f - (float)i * 0.35f, 0.06f, num2); for (int j = 0; j < 72; j++) { float num4 = (float)j / 72f * MathF.PI * 2f; float num5 = 1f + Mathf.Sin(num4 * (7f + (float)i) + age * 12f) * 0.035f; val.SetPosition(j, ground.PointAt(num4, num3 * num5, 0.15f + (float)i * 0.12f)); } } } } private void UpdateFlameRays(float ignition, float fade) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01d2: Unknown result type (might be due to invalid IL or missing references) if (flameRays == null) { return; } Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); Color val4 = default(Color); for (int i = 0; i < flameRays.Length; i++) { LineRenderer val = flameRays[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i / 14f * MathF.PI * 2f + Mathf.Sin((float)i * 4.17f) * 0.18f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); ((Vector3)(ref val3))..ctor(0f - val2.z, 0f, val2.x); float num2 = radius * (0.62f + (float)(i % 5) * 0.075f) * ignition; float num3 = Mathf.Sin(age * 5f + (float)i * 1.7f) * radius * 0.035f; val.SetPosition(0, ground.PointAt(num, 0f, 0.12f)); val.SetPosition(1, ground.PointAt(num, num2 * 0.34f, 0.18f) + val3 * num3); val.SetPosition(2, ground.PointAt(num, num2 * 0.7f, 0.1f) - val3 * num3 * 0.55f); val.SetPosition(3, ground.PointAt(num, num2, 0.08f) + val3 * num3 * 0.25f); float num4 = ground.CoverageAt(num, num2); ((Color)(ref val4))..ctor(1f, 0.08f + (float)(i % 3) * 0.045f, 0.005f, 0.64f * fade); val.startColor = val4; val.endColor = new Color(val4.r, val4.g, val4.b, 0f); val.widthMultiplier = (0.5f + (float)(i % 4) * 0.12f) * fade * num4; } } } private void UpdateFlameTongues(float ignition, float fade) { //IL_00c0: 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_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_017f: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0209: 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_0249: 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) if (flameTongues == null) { return; } Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); Color endColor = default(Color); for (int i = 0; i < flameTongues.Length; i++) { LineRenderer val = flameTongues[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i / 30f * MathF.PI * 2f; float num2 = 0.16f + (float)(i % 6) * 0.115f; float num3 = radius * num2 * Mathf.Lerp(0.12f, 1f, ignition); float num4 = radius * (0.42f + (float)(i % 7) * 0.105f) * ignition * (0.78f + Mathf.Sin(age * 8f + num * 3f) * 0.16f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); ((Vector3)(ref val3))..ctor(0f - val2.z, 0f, val2.x); Vector3 val4 = ground.PointAt(num, num3, 0.05f); float num5 = ground.CoverageAt(num, num3); for (int j = 0; j < 8; j++) { float num6 = (float)j / 7f; float num7 = Mathf.Sin(age * (6.5f + (float)i * 0.035f) + num6 * 8f + num * 2f) * radius * 0.055f * num6; float num8 = Mathf.Cos(age * 4.7f + num6 * 11f + num) * radius * 0.024f * num6; val.SetPosition(j, val4 + Vector3.up * num4 * num6 + val3 * num7 + val2 * num8 - val2 * num4 * 0.08f * num6 * num6); } Color startColor = ((i % 4 == 0) ? new Color(1f, 0.82f, 0.15f, 0.95f * fade) : new Color(1f, 0.16f, 0.008f, 0.82f * fade)); ((Color)(ref endColor))..ctor(0.35f, 0.005f, 0.001f, 0f); val.startColor = startColor; val.endColor = endColor; val.widthMultiplier = radius * (0.028f + (float)(i % 5) * 0.005f) * fade * num5 * (1f + Mathf.Sin(age * 13f + num) * 0.22f); } } } private void UpdateEmbers(float ignition, float fade) { //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_00b9: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0175: 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) if (embers == null) { return; } Color val4 = default(Color); for (int i = 0; i < embers.Length; i++) { LineRenderer val = embers[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i * 1.618034f; float num2 = Mathf.Repeat(age * (0.42f + (float)(i % 5) * 0.045f) + (float)i / 24f, 1f); float num3 = num + age * (0.35f + (float)(i % 3) * 0.16f); float num4 = radius * (0.08f + (float)(i % 8) * 0.035f) * (0.5f + num2 * 0.5f); Vector3 val2 = ground.PointAt(num3, num4, 0f) + Vector3.up * radius * (0.08f + num2 * 1.15f); Vector3 val3 = (Vector3.up * (0.45f + num2) + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * 0.18f) * radius * 0.075f; val.SetPosition(0, val2); val.SetPosition(1, val2 - val3); ((Color)(ref val4))..ctor(1f, 0.72f, 0.16f, fade * ignition * (1f - num2 * 0.72f)); Color endColor = val4; endColor.a = 0f; val.startColor = val4; val.endColor = endColor; val.widthMultiplier = radius * (0.007f + (float)(i % 3) * 0.002f) * fade; } } } private void OnDestroy() { for (int i = 0; i < materials.Count; i++) { if (Object.op_Implicit((Object)(object)materials[i])) { Object.Destroy((Object)(object)materials[i]); } } materials.Clear(); } } internal static class SukunaShrineVisuals { internal static RuntimeMalevolentShrineVisual CreateShrine(Vector3 center, Vector3 facing, float radius, float duration) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SukunaMalevolentShrine"); val.transform.position = center; Vector3 val2 = Vector3.ProjectOnPlane(facing, Vector3.up); if (((Vector3)(ref val2)).sqrMagnitude > 0.0001f) { val.transform.rotation = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); } RuntimeMalevolentShrineVisual runtimeMalevolentShrineVisual = val.AddComponent(); runtimeMalevolentShrineVisual.Initialize(radius, duration); return runtimeMalevolentShrineVisual; } } internal sealed class RuntimeMalevolentShrineVisual : MonoBehaviour { private const int RingSegments = 96; private const int SigilRayCount = 16; private const int CurseWispCount = 18; private const int WispSegments = 7; private const int HazeShells = 2; private const float StandOff = 23f; private const float RiseDuration = 1.1f; private const float UnsealedGrace = 8f; private const float MaximumGroundRise = 8f; private const float MaximumGroundDrop = 45f; private const float GroundSampleRadius = 7f; private Renderer[] shrineRenderers; private Transform shrineStand; private float standDrop; private Vector3 domainCentre; private bool placementReported; private Material shrineMaterial; private Material ringMaterial; private Color sphereBaseColor; private Transform sphereRoot; private Transform[] hazeShells; private Material[] hazeMaterials; private float nextAirCutAt; private LineRenderer boundary; private LineRenderer[] sigilRays; private LineRenderer[] curseWisps; private Material sigilMaterial; private Material wispMaterial; private Color sigilBaseColor; private Color wispBaseColor; private Light shrineLight; private float radius; private float duration; private float shrineHeight = 5.5f; private float age; private float sealAge = -1f; private bool domainSealed; internal void Initialize(float domainRadius, float lifetime) { //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_004d: 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) radius = Mathf.Max(8f, domainRadius); duration = Mathf.Max(1f, lifetime); domainCentre = ((Component)this).transform.position; shrineMaterial = SukunaVisuals.CreateSafeMaterial("matSukunaShrine", new Color(0.25f, 0.006f, 0.018f, 1f)); ringMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaShrineBoundary", SukunaAssets.Crimson, 1.5f); BuildShrine(); } internal void Seal() { if (!domainSealed) { domainSealed = true; sealAge = 0f; BuildBoundary(); BuildSphere(); BuildSigil(); BuildCurseWisps(); BuildLight(); } } private void BuildSphere() { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0078: 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_00b6: 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_0118: Unknown result type (might be due to invalid IL or missing references) sphereBaseColor = new Color(0.5f, 0.02f, 0.03f, 0.05f); GameObject val = new GameObject("MalevolentShrineAir"); val.transform.SetParent(((Component)this).transform, false); sphereRoot = val.transform; hazeShells = (Transform[])(object)new Transform[2]; hazeMaterials = (Material[])(object)new Material[2]; for (int i = 0; i < 2; i++) { GameObject val2 = JujutsuPrimitives.Sphere("ShrineHaze_" + i, Vector3.zero, false); val2.transform.SetParent(sphereRoot, false); val2.transform.localScale = Vector3.one * (radius * (1.98f - (float)i * 0.3f)); hazeShells[i] = val2.transform; Renderer component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { JujutsuFxMaterials.PrepareRenderer(component); Color val3 = sphereBaseColor; val3.a = 0.05f - (float)i * 0.015f; hazeMaterials[i] = JujutsuFxMaterials.CreateLineMaterial("matSukunaShrineHaze" + i, val3, 1f); component.material = hazeMaterials[i]; } } } private void CutTheAir() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_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_0050: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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) if (!(age < nextAirCutAt)) { nextAirCutAt = age + Random.Range(0.12f, 0.3f); Vector3 position = ((Component)this).transform.position; Vector3 val = Random.insideUnitSphere * (radius * 0.85f); val.y = Mathf.Abs(val.y) * 0.7f + 0.5f; Vector3 onUnitSphere = Random.onUnitSphere; float num = radius * Random.Range(0.12f, 0.3f); SukunaVisuals.CreateSlash(position + val - onUnitSphere * num, position + val + onUnitSphere * num, Random.Range(0.12f, 0.3f), Random.Range(0.25f, 0.45f), (Random.value > 0.5f) ? SukunaVisuals.DarkSlash : SukunaVisuals.GreySlash, true); } } private void BuildLight() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0064: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MalevolentShrineLight"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = (Object.op_Implicit((Object)(object)shrineStand) ? shrineStand.localPosition : Vector3.zero) + Vector3.up * (shrineHeight * 0.55f); shrineLight = JujutsuFxLights.TryAdd(val, SukunaAssets.Crimson, 3.4f, radius * 0.9f, true); } private Transform CreateStand() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00e0: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) GameObject val = new GameObject("MalevolentShrineStand"); val.transform.SetParent(((Component)this).transform, false); float num = 23f; float num2 = 0f; bool flag = false; for (int i = 0; i < 3; i++) { if (flag) { break; } num = 23f * (1f - (float)i * 0.25f); flag = TryFindGround(((Component)this).transform.position - ((Component)this).transform.forward * num, out var groundHeight); if (flag) { num2 = groundHeight - ((Component)this).transform.position.y; } } if (!flag) { num = 23f; Plugin.Log.LogWarning((object)("Malevolent Shrine found no ground behind the caster " + $"within {45f:0}m at any stand-off; standing " + "it on his own level.")); } standDrop = num2; val.transform.localPosition = new Vector3(0f, num2, 0f - num); val.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); return val.transform; } private bool TryFindGround(Vector3 centre, out float groundHeight) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //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_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_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_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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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) groundHeight = 0f; bool flag = false; RaycastHit val = default(RaycastHit); for (int i = 0; i < 5; i++) { if (Physics.Raycast(centre + (Vector3)(i switch { 1 => (((Component)this).transform.right + ((Component)this).transform.forward) * 7f, 2 => (((Component)this).transform.right - ((Component)this).transform.forward) * 7f, 3 => (-((Component)this).transform.right + ((Component)this).transform.forward) * 7f, 4 => (-((Component)this).transform.right - ((Component)this).transform.forward) * 7f, _ => Vector3.zero, }) + Vector3.up * 8f, Vector3.down, ref val, 53f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1) && (!flag || ((RaycastHit)(ref val)).point.y < groundHeight)) { groundHeight = ((RaycastHit)(ref val)).point.y; flag = true; } } return flag; } private void BuildShrine() { //IL_004a: 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_007d: 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_00b7: 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_00ed: 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_0128: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) shrineStand = CreateStand(); float num = default(float); if (RuntimeShrineModel.TryBuild(shrineStand, ref num)) { shrineHeight = num; shrineRenderers = ((Component)shrineStand).GetComponentsInChildren(true); return; } CreateBlock("ShrineBase", new Vector3(0f, 0.18f, 0f), new Vector3(7.5f, 0.36f, 5.2f)); CreateBlock("ShrineStep", new Vector3(0f, 0.48f, 0f), new Vector3(6.1f, 0.28f, 4.2f)); for (int i = -1; i <= 1; i += 2) { CreateBlock("ShrinePillarFront", new Vector3((float)i * 2.55f, 2.7f, 1.35f), new Vector3(0.48f, 4.7f, 0.48f)); CreateBlock("ShrinePillarBack", new Vector3((float)i * 2.55f, 2.7f, -1.35f), new Vector3(0.48f, 4.7f, 0.48f)); } CreateBlock("ShrineRoofLower", new Vector3(0f, 4.85f, 0f), new Vector3(6.9f, 0.38f, 4.15f)); CreateBlock("ShrineRoofUpper", new Vector3(0f, 5.35f, 0f), new Vector3(5.45f, 0.34f, 3.35f)); CreateBlock("ShrineAltar", new Vector3(0f, 1.45f, -0.5f), new Vector3(2.8f, 2.1f, 1.25f)); shrineRenderers = ((Component)shrineStand).GetComponentsInChildren(true); } private void CreateBlock(string blockName, Vector3 localPosition, Vector3 localScale) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) GameObject obj = JujutsuPrimitives.Cube(blockName, Vector3.zero, false); obj.transform.SetParent(shrineStand, false); obj.transform.localPosition = localPosition; obj.transform.localScale = localScale; Renderer component = obj.GetComponent(); component.sharedMaterial = shrineMaterial; component.shadowCastingMode = (ShadowCastingMode)1; component.receiveShadows = true; } private void BuildBoundary() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00ff: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MalevolentShrineBoundary"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.up * 0.08f; boundary = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)boundary); boundary.useWorldSpace = false; boundary.loop = true; boundary.positionCount = 96; boundary.widthMultiplier = 0.22f; boundary.numCornerVertices = 2; boundary.startColor = SukunaAssets.Crimson; boundary.endColor = SukunaAssets.Crimson; ((Renderer)boundary).material = ringMaterial; for (int i = 0; i < 96; i++) { float num = (float)i / 96f * MathF.PI * 2f; boundary.SetPosition(i, new Vector3(Mathf.Cos(num) * radius, 0f, Mathf.Sin(num) * radius)); } } private void BuildSigil() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_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) sigilBaseColor = new Color(0.75f, 0.015f, 0.025f, 0.82f); sigilMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaShrineSigil", sigilBaseColor, 1.5f); sigilRays = (LineRenderer[])(object)new LineRenderer[16]; for (int i = 0; i < sigilRays.Length; i++) { GameObject val = new GameObject("ShrineSigilRay_" + i); val.transform.SetParent(((Component)this).transform, false); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = false; val2.positionCount = 5; val2.numCornerVertices = 3; val2.numCapVertices = 3; ((Renderer)val2).material = sigilMaterial; sigilRays[i] = val2; } } private void BuildCurseWisps() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_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) wispBaseColor = new Color(0.18f, 0.002f, 0.008f, 0.78f); wispMaterial = JujutsuFxMaterials.CreateLineMaterial("matSukunaShrineCurseWisps", wispBaseColor, 1.5f); curseWisps = (LineRenderer[])(object)new LineRenderer[18]; for (int i = 0; i < curseWisps.Length; i++) { GameObject val = new GameObject("ShrineCurseWisp_" + i); val.transform.SetParent(((Component)this).transform, false); LineRenderer val2 = val.AddComponent(); JujutsuFxMaterials.PrepareRenderer((Renderer)(object)val2); val2.useWorldSpace = false; val2.positionCount = 7; val2.numCornerVertices = 4; val2.numCapVertices = 3; ((Renderer)val2).material = wispMaterial; curseWisps[i] = val2; } } private void Update() { //IL_0157: 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_0218: 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; if (domainSealed) { sealAge += Time.deltaTime; } float num = Mathf.Clamp01(age / 1.1f); float num2 = (domainSealed ? Mathf.Clamp01((duration - sealAge) / 0.8f) : 1f); float num3 = Mathf.Min(num, num2); float num4 = (domainSealed ? Mathf.Min(Mathf.Clamp01(sealAge / 0.55f), num2) : 0f); float num5 = 1f + Mathf.Sin(age * 3.4f) * 0.025f; if (shrineRenderers != null) { for (int i = 0; i < shrineRenderers.Length; i++) { if (Object.op_Implicit((Object)(object)shrineRenderers[i])) { shrineRenderers[i].enabled = num3 > 0.01f; } } } if (Object.op_Implicit((Object)(object)boundary)) { boundary.widthMultiplier = 0.22f * num4 * (1f + Mathf.Sin(age * 9f) * 0.22f); ((Component)boundary).transform.localRotation = Quaternion.Euler(0f, age * 4f, 0f); ((Component)boundary).transform.localScale = new Vector3(num5, 1f, num5); } if (Object.op_Implicit((Object)(object)sphereRoot)) { sphereRoot.localRotation = Quaternion.Euler(0f, (0f - age) * 2.5f, 0f); for (int j = 0; j < hazeMaterials.Length; j++) { Color val = sphereBaseColor; val.a = 0.05f - (float)j * 0.015f; JujutsuFxMaterials.SetEnvelope(hazeMaterials[j], val, num4, 1.5f); } } CutTheAir(); UpdateSigil(num4); UpdateCurseWisps(num4); JujutsuFxMaterials.SetEnvelope(ringMaterial, SukunaAssets.Crimson, num4, 1.5f); JujutsuFxMaterials.SetEnvelope(sigilMaterial, sigilBaseColor, num4, 1.5f); JujutsuFxMaterials.SetEnvelope(wispMaterial, wispBaseColor, num4, 1.5f); ((Component)this).transform.localScale = new Vector3(1f, Mathf.Lerp(0.12f, 1f, num), 1f); if (Object.op_Implicit((Object)(object)shrineLight)) { shrineLight.intensity = (3.4f + Mathf.Sin(age * 7f) * 0.6f) * num4; } if (!placementReported) { placementReported = true; RuntimeShrineModel.ReportPlacement(shrineStand, ((Component)this).transform, domainCentre, standDrop); } if (domainSealed ? (sealAge >= duration) : (age >= 8f)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void UpdateSigil(float alpha) { //IL_006c: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) if (sigilRays == null) { return; } Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); Color startColor = default(Color); Color endColor = default(Color); for (int i = 0; i < sigilRays.Length; i++) { LineRenderer val = sigilRays[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i / 16f * MathF.PI * 2f + age * ((i % 2 == 0) ? 0.08f : (-0.06f)); ((Vector3)(ref val2))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); ((Vector3)(ref val3))..ctor(0f - val2.z, 0f, val2.x); float num2 = radius * 0.16f; float num3 = radius * (0.82f + (float)(i % 4) * 0.045f) * (1f + Mathf.Sin(age * 3.2f + (float)i) * 0.018f); val.SetPosition(0, val2 * num2 + Vector3.up * 0.1f); val.SetPosition(1, val2 * num3 * 0.34f + val3 * radius * 0.025f + Vector3.up * 0.11f); val.SetPosition(2, val2 * num3 * 0.62f - val3 * radius * 0.035f + Vector3.up * 0.12f); val.SetPosition(3, val2 * num3 * 0.82f + val3 * radius * 0.02f + Vector3.up * 0.1f); val.SetPosition(4, val2 * num3 + Vector3.up * 0.09f); ((Color)(ref startColor))..ctor(0.85f, 0.025f, 0.035f, 0.78f * alpha); ((Color)(ref endColor))..ctor(0.08f, 0.001f, 0.003f, 0f); val.startColor = startColor; val.endColor = endColor; val.widthMultiplier = (0.15f + (float)(i % 3) * 0.035f) * alpha * (1f + Mathf.Sin(age * 11f + (float)i) * 0.18f); } } } private void UpdateCurseWisps(float alpha) { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0165: 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_016a: 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_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) //IL_0185: Unknown result type (might be due to invalid IL or missing references) if (curseWisps == null) { return; } Vector3 val2 = default(Vector3); Vector3 val3 = default(Vector3); for (int i = 0; i < curseWisps.Length; i++) { LineRenderer val = curseWisps[i]; if (Object.op_Implicit((Object)(object)val)) { float num = (float)i * 2.39996f; float num2 = radius * (0.24f + (float)(i % 7) * 0.095f); float num3 = num + age * (0.2f + (float)(i % 3) * 0.09f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num3) * num2, 0.15f, Mathf.Sin(num3) * num2); ((Vector3)(ref val3))..ctor(0f - Mathf.Sin(num3), 0f, Mathf.Cos(num3)); for (int j = 0; j < 7; j++) { float num4 = (float)j / 6f; float num5 = radius * (0.08f + (float)(i % 5) * 0.018f) * num4; float num6 = Mathf.Sin(age * 4.5f + num + num4 * 8f) * radius * 0.018f * num4; val.SetPosition(j, val2 + Vector3.up * num5 + val3 * num6); } Color val4 = ((i % 4 == 0) ? new Color(0.75f, 0.02f, 0.035f, 0.76f * alpha) : new Color(0.045f, 0.005f, 0.012f, 0.7f * alpha)); Color endColor = val4; endColor.a = 0f; val.startColor = val4; val.endColor = endColor; val.widthMultiplier = (0.18f + (float)(i % 4) * 0.035f) * alpha; } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)shrineMaterial)) { Object.Destroy((Object)(object)shrineMaterial); } if (Object.op_Implicit((Object)(object)ringMaterial)) { Object.Destroy((Object)(object)ringMaterial); } if (hazeMaterials != null) { for (int i = 0; i < hazeMaterials.Length; i++) { if (Object.op_Implicit((Object)(object)hazeMaterials[i])) { Object.Destroy((Object)(object)hazeMaterials[i]); } } } if (Object.op_Implicit((Object)(object)sigilMaterial)) { Object.Destroy((Object)(object)sigilMaterial); } if (Object.op_Implicit((Object)(object)wispMaterial)) { Object.Destroy((Object)(object)wispMaterial); } } } internal static class SukunaImportedModel { private sealed class ModelData { internal string[] BoneNames; internal int[] ParentIndices; internal Vector3[] BonePositions; internal Quaternion[] BoneRotations; internal Vector3[] BoneScales; internal MeshData[] Meshes; } private sealed class MeshData { internal string Name; internal int OutfitIndex; internal string MaterialName; internal string TextureName; internal bool IsDecal; internal Vector3[] Vertices; internal Vector3[] Normals; internal Vector2[] Uvs; internal BoneWeight[] BoneWeights; internal int[] Triangles; } private const string ModelFileName = "sukuna.model"; private const string TextureDirectoryName = "sukuna"; private const int OutfitCount = 5; private const int SharedOutfitIndex = 5; private static readonly int[] SelfContainedOutfits = new int[2] { 3, 4 }; private const int OutfitGroupCount = 6; private const float NativeModelScale = 1.27f; private static ModelData cachedModel; private static readonly Dictionary textureCache = new Dictionary(StringComparer.Ordinal); private static readonly Dictionary iconCache = new Dictionary(StringComparer.Ordinal); private static Material cachedTemplateMaterial; private static readonly HashSet loggedShaders = new HashSet(StringComparer.Ordinal); internal static bool Apply(GameObject prefab) { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_0179: 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_01a0: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; try { Plugin.Log.LogInfo((object)("Preparing supplied Sukuna rig for " + ((Object)prefab).name + ".")); CharacterModel componentInChildren = prefab.GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)componentInChildren)) { Plugin.Log.LogWarning((object)("CharacterModel was not found while applying Sukuna model to " + ((Object)prefab).name + ".")); return false; } ModelData modelData = LoadModel(); Material val2 = FindTemplateMaterial(componentInChildren); if (modelData == null) { Plugin.Log.LogError((object)("Sukuna model data could not be loaded for " + ((Object)prefab).name + "; the Mercenary fallback will remain visible.")); return false; } if (!Object.op_Implicit((Object)(object)val2)) { Plugin.Log.LogError((object)("No safe material template was available for " + ((Object)prefab).name + "; the Mercenary fallback will remain visible.")); return false; } Plugin.Log.LogInfo((object)("Loaded Sukuna runtime data for " + ((Object)prefab).name + ": " + $"{modelData.BoneNames.Length} bones, " + $"{modelData.Meshes.Length} mesh parts.")); Renderer[] componentsInChildren = ((Component)componentInChildren).GetComponentsInChildren(true); Light[] componentsInChildren2 = ((Component)componentInChildren).GetComponentsInChildren(true); Animator animator = ((Component)componentInChildren).GetComponent() ?? ((Component)componentInChildren).GetComponentInChildren(true); val = new GameObject("SukunaImportedModel"); val.layer = ((Component)componentInChildren).gameObject.layer; Transform transform = val.transform; transform.SetParent(((Component)componentInChildren).transform, false); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); transform.localScale = Vector3.one * ((JujutsuConfig.SukunaModelScale != null) ? JujutsuConfig.SukunaModelScale.Value : 1.27f); Transform[] array = BuildSkeleton(modelData, transform); GameObject[] outfitGroups = BuildOutfitGroups(transform); List list = BuildMeshes(modelData, array, outfitGroups, val2, ((Component)componentInChildren).gameObject.layer); if (list.Count == 0) { Object.DestroyImmediate((Object)(object)val); Plugin.Log.LogError((object)("Sukuna model contained no usable renderers for " + ((Object)prefab).name + ".")); return false; } RendererInfo[] baseRendererInfos = componentInChildren.baseRendererInfos; foreach (RendererInfo val3 in baseRendererInfos) { if (Object.op_Implicit((Object)(object)val3.renderer)) { val3.renderer.enabled = false; } } RendererInfo[] array2 = (componentInChildren.baseRendererInfos = list.ToArray()); componentInChildren.mainSkinnedMeshRenderer = FindMainRenderer(array2); componentInChildren.materialsDirty = true; componentInChildren.forceUpdate = true; Renderer[] array3 = (Renderer[])(object)new Renderer[array2.Length]; for (int j = 0; j < array2.Length; j++) { array3[j] = array2[j].renderer; } val.AddComponent().Configure(componentsInChildren, array3, componentsInChildren2); val.AddComponent().Configure(modelData.BoneNames, array); bool flag = Array.IndexOf(modelData.BoneNames, "mixamorig:Hips") >= 0; if (!flag) { val.AddComponent().Configure(modelData.BoneNames, array); } val.AddComponent().Configure(componentInChildren, modelData.BoneNames, array); val.AddComponent(); ConfigureSkins(componentInChildren, animator, array2, outfitGroups, FindOutfitsWithGeometry(modelData)); Plugin.Log.LogInfo((object)("Applied supplied Sukuna rig to " + ((Object)prefab).name + ": " + $"{modelData.BoneNames.Length} bones, " + $"{array2.Length} skinned renderers, " + $"{modelData.Meshes.Length} mesh parts, " + (flag ? "native Mixamo animation" : "retarget animation") + ".")); return true; } catch (Exception arg) { if (Object.op_Implicit((Object)(object)val)) { Object.DestroyImmediate((Object)(object)val); } Plugin.Log.LogError((object)$"Could not build imported Sukuna model: {arg}"); return false; } } private static ModelData LoadModel() { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_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_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) if (cachedModel != null) { return cachedModel; } string text = JujutsuAssetPaths.Find(new string[2] { "assets", "sukuna.model" }); if (!File.Exists(text)) { Plugin.Log.LogWarning((object)("Sukuna model data was not found: " + text)); return null; } using FileStream fileStream = File.OpenRead(text); using BinaryReader binaryReader = new BinaryReader(fileStream); byte[] array = new byte[8] { 83, 85, 75, 78, 77, 68, 76, 49 }; byte[] array2 = binaryReader.ReadBytes(array.Length); if (array2.Length != array.Length) { throw new InvalidDataException("Sukuna model header is incomplete."); } for (int i = 0; i < array.Length; i++) { if (array2[i] != array[i]) { throw new InvalidDataException("Sukuna model header is invalid."); } } int num = binaryReader.ReadInt32(); if (num != 2) { throw new InvalidDataException($"Unsupported Sukuna model version {num}."); } int num2 = ReadSafeCount(binaryReader, 1, 1024, "bone"); ModelData modelData = new ModelData { BoneNames = new string[num2], ParentIndices = new int[num2], BonePositions = (Vector3[])(object)new Vector3[num2], BoneRotations = (Quaternion[])(object)new Quaternion[num2], BoneScales = (Vector3[])(object)new Vector3[num2] }; for (int j = 0; j < num2; j++) { modelData.BoneNames[j] = binaryReader.ReadString(); modelData.ParentIndices[j] = binaryReader.ReadInt32(); modelData.BonePositions[j] = ReadVector3(binaryReader); modelData.BoneRotations[j] = ReadQuaternion(binaryReader); modelData.BoneScales[j] = ReadVector3(binaryReader); if (modelData.ParentIndices[j] >= j || modelData.ParentIndices[j] < -1) { throw new InvalidDataException($"Sukuna bone {j} has an invalid parent."); } } int num3 = ReadSafeCount(binaryReader, 1, 128, "mesh"); modelData.Meshes = new MeshData[num3]; Vector2 val3 = default(Vector2); for (int k = 0; k < num3; k++) { MeshData meshData = new MeshData { Name = binaryReader.ReadString(), OutfitIndex = binaryReader.ReadInt32(), MaterialName = binaryReader.ReadString(), TextureName = binaryReader.ReadString(), IsDecal = binaryReader.ReadBoolean() }; if ((uint)meshData.OutfitIndex >= 6u) { throw new InvalidDataException("Sukuna mesh " + meshData.Name + " has an invalid outfit."); } int num4 = ReadSafeCount(binaryReader, 3, 100000, "vertex"); meshData.Vertices = (Vector3[])(object)new Vector3[num4]; meshData.Normals = (Vector3[])(object)new Vector3[num4]; meshData.Uvs = (Vector2[])(object)new Vector2[num4]; meshData.BoneWeights = (BoneWeight[])(object)new BoneWeight[num4]; for (int l = 0; l < num4; l++) { Vector3 val = ReadVector3(binaryReader); Vector3 val2 = ReadVector3(binaryReader); ((Vector2)(ref val3))..ctor(binaryReader.ReadSingle(), binaryReader.ReadSingle()); BoneWeight val4 = default(BoneWeight); ((BoneWeight)(ref val4)).boneIndex0 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex1 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex2 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).boneIndex3 = binaryReader.ReadInt32(); ((BoneWeight)(ref val4)).weight0 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight1 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight2 = binaryReader.ReadSingle(); ((BoneWeight)(ref val4)).weight3 = binaryReader.ReadSingle(); BoneWeight val5 = val4; ValidateVertex(meshData.Name, l, val, val2, val5, num2); meshData.Vertices[l] = val; meshData.Normals[l] = val2; meshData.Uvs[l] = val3; meshData.BoneWeights[l] = val5; } int num5 = ReadSafeCount(binaryReader, 3, 1000000, "index"); if (num5 % 3 != 0) { throw new InvalidDataException("Sukuna mesh " + meshData.Name + " has incomplete triangles."); } meshData.Triangles = new int[num5]; for (int m = 0; m < num5; m++) { int num6 = binaryReader.ReadInt32(); if ((uint)num6 >= (uint)num4) { throw new InvalidDataException("Sukuna mesh " + meshData.Name + " references a missing vertex."); } meshData.Triangles[m] = num6; } modelData.Meshes[k] = meshData; } if (fileStream.Position != fileStream.Length) { Plugin.Log.LogWarning((object)$"Sukuna model has {fileStream.Length - fileStream.Position} trailing bytes."); } cachedModel = modelData; return cachedModel; } private static int ReadSafeCount(BinaryReader reader, int minimum, int maximum, string label) { int num = reader.ReadInt32(); if (num < minimum || num > maximum) { throw new InvalidDataException($"Unsafe Sukuna {label} count {num}."); } return num; } private static void ValidateVertex(string meshName, int vertexIndex, Vector3 vertex, Vector3 normal, BoneWeight weight, int boneCount) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_005d: 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_0077: Unknown result type (might be due to invalid IL or missing references) if (!IsFinite(vertex.x) || !IsFinite(vertex.y) || !IsFinite(vertex.z) || Mathf.Abs(vertex.x) > 20f || Mathf.Abs(vertex.y) > 20f || Mathf.Abs(vertex.z) > 20f || !IsFinite(normal.x) || !IsFinite(normal.y) || !IsFinite(normal.z)) { throw new InvalidDataException($"Sukuna mesh {meshName} has an unsafe vertex {vertexIndex}."); } int[] array = new int[4] { ((BoneWeight)(ref weight)).boneIndex0, ((BoneWeight)(ref weight)).boneIndex1, ((BoneWeight)(ref weight)).boneIndex2, ((BoneWeight)(ref weight)).boneIndex3 }; for (int i = 0; i < array.Length; i++) { if ((uint)array[i] >= (uint)boneCount) { throw new InvalidDataException("Sukuna mesh " + meshName + " references an invalid bone."); } } } private static bool IsFinite(float value) { if (!float.IsNaN(value)) { return !float.IsInfinity(value); } return false; } private static Transform[] BuildSkeleton(ModelData modelData, Transform container) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_007c: Unknown result type (might be due to invalid IL or missing references) Transform[] array = (Transform[])(object)new Transform[modelData.BoneNames.Length]; for (int i = 0; i < array.Length; i++) { Transform transform = new GameObject(modelData.BoneNames[i]) { layer = ((Component)container).gameObject.layer }.transform; int num = modelData.ParentIndices[i]; transform.SetParent((num >= 0) ? array[num] : container, false); transform.localPosition = modelData.BonePositions[i]; transform.localRotation = modelData.BoneRotations[i]; transform.localScale = modelData.BoneScales[i]; array[i] = transform; } return array; } private static GameObject[] BuildOutfitGroups(Transform container) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown string[] array = new string[6] { "SukunaOutfitDefault", "SukunaOutfitShirtless", "SukunaOutfitKimono", "SukunaOutfitShinjuku", "SukunaOutfitSendai", "SukunaOutfitShared" }; GameObject[] array2 = (GameObject[])(object)new GameObject[6]; for (int i = 0; i < array2.Length; i++) { array2[i] = new GameObject(array[i]); array2[i].layer = ((Component)container).gameObject.layer; array2[i].transform.SetParent(container, false); array2[i].SetActive(i == 0 || i == 5); } return array2; } private static List BuildMeshes(ModelData modelData, Transform[] skeleton, GameObject[] outfitGroups, Material template, int layer) { //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_0044: 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_0069: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) List list = new List(modelData.Meshes.Length); Dictionary dictionary = new Dictionary(StringComparer.Ordinal); for (int i = 0; i < modelData.Meshes.Length; i++) { MeshData meshData = modelData.Meshes[i]; Mesh val = new Mesh { name = "meshSukuna_" + meshData.Name, indexFormat = (IndexFormat)(meshData.Vertices.Length > 65535), vertices = meshData.Vertices, normals = meshData.Normals, uv = meshData.Uvs, triangles = meshData.Triangles }; GameObject val2 = new GameObject(meshData.Name); val2.layer = layer; Transform transform = val2.transform; transform.SetParent(outfitGroups[meshData.OutfitIndex].transform, false); BuildCompactSkinningData(meshData.BoneWeights, skeleton, out var compactWeights, out var compactBones, out var bindPoses); val.boneWeights = compactWeights; for (int j = 0; j < compactBones.Length; j++) { bindPoses[j] = compactBones[j].worldToLocalMatrix * transform.localToWorldMatrix; } val.bindposes = bindPoses; val.RecalculateBounds(); string key = meshData.MaterialName + "\n" + meshData.TextureName + "\n" + meshData.IsDecal; if (!dictionary.TryGetValue(key, out var value)) { value = CreateMaterial(template, meshData.MaterialName, meshData.TextureName, meshData.IsDecal); dictionary.Add(key, value); } SkinnedMeshRenderer val3 = val2.AddComponent(); val3.sharedMesh = val; val3.bones = compactBones; val3.rootBone = skeleton[0]; ((Renderer)val3).sharedMaterial = value; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)val3).receiveShadows = true; val3.quality = (SkinQuality)4; val3.updateWhenOffscreen = false; Bounds bounds = val.bounds; ((Bounds)(ref bounds)).Expand(3f); ((Renderer)val3).localBounds = bounds; ((Renderer)val3).enabled = true; if (meshData.Name.StartsWith("Haori", StringComparison.OrdinalIgnoreCase)) { JujutsuSleevePhysics.Attach(val3, skeleton); } list.Add(new RendererInfo { renderer = (Renderer)(object)val3, defaultMaterial = value, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }); } return list; } private static void BuildCompactSkinningData(BoneWeight[] sourceWeights, Transform[] skeleton, out BoneWeight[] compactWeights, out Transform[] compactBones, out Matrix4x4[] bindPoses) { //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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_01b2: Unknown result type (might be due to invalid IL or missing references) SortedSet sortedSet = new SortedSet { 0 }; for (int i = 0; i < sourceWeights.Length; i++) { BoneWeight val = sourceWeights[i]; AddUsedBone(sortedSet, ((BoneWeight)(ref val)).boneIndex0, ((BoneWeight)(ref val)).weight0); AddUsedBone(sortedSet, ((BoneWeight)(ref val)).boneIndex1, ((BoneWeight)(ref val)).weight1); AddUsedBone(sortedSet, ((BoneWeight)(ref val)).boneIndex2, ((BoneWeight)(ref val)).weight2); AddUsedBone(sortedSet, ((BoneWeight)(ref val)).boneIndex3, ((BoneWeight)(ref val)).weight3); } int[] array = new int[sortedSet.Count]; sortedSet.CopyTo(array); int[] array2 = new int[skeleton.Length]; for (int j = 0; j < array2.Length; j++) { array2[j] = -1; } compactBones = (Transform[])(object)new Transform[array.Length]; bindPoses = (Matrix4x4[])(object)new Matrix4x4[array.Length]; for (int k = 0; k < array.Length; k++) { int num = array[k]; array2[num] = k; compactBones[k] = skeleton[num]; } compactWeights = (BoneWeight[])(object)new BoneWeight[sourceWeights.Length]; for (int l = 0; l < sourceWeights.Length; l++) { BoneWeight val2 = sourceWeights[l]; BoneWeight[] obj = compactWeights; int num2 = l; BoneWeight val3 = default(BoneWeight); ((BoneWeight)(ref val3)).boneIndex0 = RemapBone(array2, ((BoneWeight)(ref val2)).boneIndex0, ((BoneWeight)(ref val2)).weight0); ((BoneWeight)(ref val3)).boneIndex1 = RemapBone(array2, ((BoneWeight)(ref val2)).boneIndex1, ((BoneWeight)(ref val2)).weight1); ((BoneWeight)(ref val3)).boneIndex2 = RemapBone(array2, ((BoneWeight)(ref val2)).boneIndex2, ((BoneWeight)(ref val2)).weight2); ((BoneWeight)(ref val3)).boneIndex3 = RemapBone(array2, ((BoneWeight)(ref val2)).boneIndex3, ((BoneWeight)(ref val2)).weight3); ((BoneWeight)(ref val3)).weight0 = ((BoneWeight)(ref val2)).weight0; ((BoneWeight)(ref val3)).weight1 = ((BoneWeight)(ref val2)).weight1; ((BoneWeight)(ref val3)).weight2 = ((BoneWeight)(ref val2)).weight2; ((BoneWeight)(ref val3)).weight3 = ((BoneWeight)(ref val2)).weight3; obj[num2] = val3; } } private static void AddUsedBone(SortedSet indices, int index, float weight) { if (weight > 1E-06f) { indices.Add(index); } } private static int RemapBone(int[] localIndexByGlobal, int globalIndex, float weight) { if (weight <= 1E-06f) { return 0; } int num = localIndexByGlobal[globalIndex]; if (num < 0) { return 0; } return num; } private static Material CreateMaterial(Material template, string materialName, string textureName, bool isDecal) { //IL_0085: 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_00a5: 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) Material val = Object.Instantiate(template); ((Object)val).name = "matSukuna_" + materialName; Texture2D texture = LoadTexture(textureName); SetTextureIfPresent(val, "_NormalTex", null); SetTextureIfPresent(val, "_BumpMap", null); SetTextureIfPresent(val, "_EmTex", null); SetTextureIfPresent(val, "_EmissionMap", null); SetTextureIfPresent(val, "_DetailAlbedoMap", null); SetTextureIfPresent(val, "_DetailNormalMap", null); SetTextureIfPresent(val, "_MainTex", (Texture)(object)texture); SetTextureIfPresent(val, "_BaseColorMap", (Texture)(object)texture); SetColorIfPresent(val, "_Color", Color.white); SetColorIfPresent(val, "_MainColor", Color.white); SetColorIfPresent(val, "_EmissionColor", Color.black); SetColorIfPresent(val, "_EmColor", Color.black); val.DisableKeyword("_EMISSION"); val.DisableKeyword("_NORMALMAP"); if (val.HasProperty("_EmPower")) { val.SetFloat("_EmPower", 0f); } if (val.HasProperty("_NormalStrength")) { val.SetFloat("_NormalStrength", 0f); } if (val.HasProperty("_SpecularStrength")) { bool flag = materialName.IndexOf("eye", StringComparison.OrdinalIgnoreCase) >= 0 || materialName.IndexOf("pupil", StringComparison.OrdinalIgnoreCase) >= 0; val.SetFloat("_SpecularStrength", flag ? 0.42f : 0.1f); } if (val.HasProperty("_Cull")) { val.SetFloat("_Cull", 0f); } bool flag2 = isDecal || materialName.IndexOf("hair", StringComparison.OrdinalIgnoreCase) >= 0; if (val.HasProperty("_Cutoff")) { val.SetFloat("_Cutoff", flag2 ? 0.18f : 0f); } if (flag2) { val.EnableKeyword("_ALPHATEST_ON"); val.renderQueue = 2450; } else { val.DisableKeyword("_ALPHATEST_ON"); } if (flag2 && !val.HasProperty("_Cutoff")) { LogShaderProperties(val); } return val; } private static void LogShaderProperties(Material material) { Shader shader = material.shader; if (!Object.op_Implicit((Object)(object)shader) || !loggedShaders.Add(((Object)shader).name)) { return; } StringBuilder stringBuilder = new StringBuilder(); int propertyCount = shader.GetPropertyCount(); for (int i = 0; i < propertyCount; i++) { if (stringBuilder.Length > 0) { stringBuilder.Append(", "); } stringBuilder.Append(shader.GetPropertyName(i)); } Plugin.Log.LogInfo((object)("Shader '" + ((Object)shader).name + "' has no _Cutoff; alpha masking is not " + $"available. Its {propertyCount} properties: {stringBuilder}")); } private static Texture2D LoadTexture(string textureName) { if (string.IsNullOrEmpty(textureName)) { return Texture2D.whiteTexture; } if (textureCache.TryGetValue(textureName, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } string text = JujutsuAssetPaths.Find(new string[3] { "assets", "sukuna", textureName }); bool flag = File.Exists(text); TextureAudit.Record("sukuna", textureName, flag); if (!flag) { Plugin.Log.LogWarning((object)("Sukuna texture was not found: " + text)); return Texture2D.whiteTexture; } value = JujutsuTextures.Load(text, "texSukuna_" + Path.GetFileNameWithoutExtension(textureName), (TextureWrapMode)0, true); if (!Object.op_Implicit((Object)(object)value)) { throw new InvalidDataException("Sukuna texture could not be decoded: " + textureName); } textureCache[textureName] = value; return value; } private static Material FindTemplateMaterial(CharacterModel characterModel) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown RendererInfo[] baseRendererInfos = characterModel.baseRendererInfos; foreach (RendererInfo val in baseRendererInfos) { if (Object.op_Implicit((Object)(object)val.defaultMaterial)) { cachedTemplateMaterial = val.defaultMaterial; return cachedTemplateMaterial; } } Renderer[] componentsInChildren = ((Component)characterModel).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.sharedMaterial)) { cachedTemplateMaterial = val2.sharedMaterial; Plugin.Log.LogWarning((object)("Sukuna material template for " + ((Object)characterModel).name + " was recovered from a live renderer.")); return cachedTemplateMaterial; } } if (Object.op_Implicit((Object)(object)cachedTemplateMaterial)) { Plugin.Log.LogWarning((object)("Sukuna material template for " + ((Object)characterModel).name + " was recovered from the previous model instance.")); return cachedTemplateMaterial; } Shader val3 = Shader.Find("Hopoo Games/Deferred/Standard") ?? Shader.Find("Standard"); if (!Object.op_Implicit((Object)(object)val3)) { return null; } cachedTemplateMaterial = new Material(val3) { name = "matSukunaRuntimeFallback" }; Plugin.Log.LogWarning((object)("Sukuna material template for " + ((Object)characterModel).name + " was created from shader {shader.name}.")); return cachedTemplateMaterial; } private static SkinnedMeshRenderer FindMainRenderer(RendererInfo[] rendererInfos) { for (int i = 0; i < rendererInfos.Length; i++) { Renderer renderer = rendererInfos[i].renderer; SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (val != null && ((Object)((Component)val).gameObject).name.IndexOf("body", StringComparison.OrdinalIgnoreCase) >= 0) { return val; } } for (int j = 0; j < rendererInfos.Length; j++) { Renderer renderer2 = rendererInfos[j].renderer; SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((renderer2 is SkinnedMeshRenderer) ? renderer2 : null); if (val2 != null) { return val2; } } return null; } private static bool[] FindOutfitsWithGeometry(ModelData modelData) { bool[] array = new bool[5]; MeshData[] meshes = modelData.Meshes; foreach (MeshData meshData in meshes) { if ((uint)meshData.OutfitIndex < 5u) { array[meshData.OutfitIndex] = true; } } return array; } private static void ConfigureSkins(CharacterModel characterModel, Animator animator, RendererInfo[] rendererInfos, GameObject[] outfitGroups, bool[] outfitsWithGeometry) { //IL_0171: 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_019a: Unknown result type (might be due to invalid IL or missing references) ModelSkinController val = ((Component)characterModel).GetComponent(); if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)characterModel).gameObject.AddComponent(); } val.characterModel = characterModel; if (Object.op_Implicit((Object)(object)animator)) { val.animator = animator; } string[] array = new string[5] { "DEFAULT", "SHIRTLESS", "KIMONO", "SHINJUKU", "SENDAI" }; string[] array2 = new string[5] { "skin-default.png", "skin-shirtless.png", "skin-kimono.png", "skin-shinjuku.png", "skin-sendai.png" }; List list = new List(5); for (int i = 0; i < 5; i++) { if (outfitsWithGeometry == null || i >= outfitsWithGeometry.Length || outfitsWithGeometry[i]) { SkinDef val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "skinSukuna" + array[i]; val2.nameToken = "CODEX_SUKUNA_SKIN_" + array[i] + "_NAME"; val2.icon = LoadSkinIcon(array2[i]); val2.rootObject = ((Component)characterModel).gameObject; val2.baseSkins = Array.Empty(); val2.unlockableDef = null; SkinDefParams val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "skinParamsSukuna" + array[i]; val3.rendererInfos = rendererInfos; val3.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[6]; int num = i; bool flag = Array.IndexOf(SelfContainedOutfits, num) < 0; for (int j = 0; j < 6; j++) { val3.gameObjectActivations[j] = new GameObjectActivation { gameObject = outfitGroups[j], shouldActivate = ((j == 5) ? flag : (j == num)) }; } val3.meshReplacements = Array.Empty(); val3.projectileGhostReplacements = Array.Empty(); val3.minionSkinReplacements = Array.Empty(); val3.lightReplacements = Array.Empty(); val2.skinDefParams = val3; val2.Bake(); list.Add(val2); } } val.skins = list.ToArray(); Plugin.Log.LogInfo((object)($"Registered {list.Count} Sukuna skin(s) on " + ((Object)characterModel).name + ", one per outfit the model carries.")); for (int k = 0; k < outfitGroups.Length; k++) { GameObject val4 = outfitGroups[k]; if (Object.op_Implicit((Object)(object)val4)) { Plugin.Log.LogInfo((object)($" outfit group {k} '{((Object)val4).name}': " + $"{val4.transform.childCount} renderer(s), " + $"active={val4.activeSelf}" + ((k == 5) ? " (shared)" : string.Empty))); } } for (int l = 0; l < list.Count; l++) { Plugin.Log.LogInfo((object)$" skin {l} = {list[l].nameToken}"); } } private static Sprite LoadSkinIcon(string fileName) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (iconCache.TryGetValue(fileName, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } Texture2D val = LoadTexture(fileName); if (!Object.op_Implicit((Object)(object)val) || (Object)(object)val == (Object)(object)Texture2D.whiteTexture) { return null; } JujutsuTextures.EnsureLoaded(val); Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val2).name = "texSukunaSkin" + Path.GetFileNameWithoutExtension(fileName); GojoAssets.PreparePersistentSprite(val2); iconCache[fileName] = val2; return val2; } private static void SetTextureIfPresent(Material material, string propertyName, Texture texture) { if (material.HasProperty(propertyName)) { material.SetTexture(propertyName, texture); } } private static void SetColorIfPresent(Material material, string propertyName, Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (material.HasProperty(propertyName)) { material.SetColor(propertyName, color); } } private static Vector3 ReadVector3(BinaryReader reader) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); } private static Quaternion ReadQuaternion(BinaryReader reader) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); } } internal sealed class SukunaModelRetargeter : MonoBehaviour { private sealed class BoneLink { internal Transform Source; internal Transform Target; internal Quaternion RotationOffset; } [SerializeField] private Animator sourceAnimator; [SerializeField] private string[] targetNames; [SerializeField] private Transform[] targetBones; private readonly List links = new List(); private readonly Dictionary sourceBonesByName = new Dictionary(StringComparer.Ordinal); private BoneLink hipsLink; private bool initialized; private bool warned; internal void Configure(Animator animator, string[] names, Transform[] bones) { sourceAnimator = animator; targetNames = names; targetBones = bones; } private void Start() { Initialize(); } private void Initialize() { //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) if (initialized || !Object.op_Implicit((Object)(object)sourceAnimator) || targetNames == null || targetBones == null) { if (!warned && !Object.op_Implicit((Object)(object)sourceAnimator)) { warned = true; Plugin.Log.LogWarning((object)"Sukuna source Animator was not found; the imported rig will remain in its bind pose."); } return; } Dictionary dictionary = new Dictionary(StringComparer.Ordinal); int num = Mathf.Min(targetNames.Length, targetBones.Length); for (int i = 0; i < num; i++) { if (Object.op_Implicit((Object)(object)targetBones[i])) { dictionary[targetNames[i]] = targetBones[i]; } } AddLink(dictionary, "root.x", (HumanBodyBones)0, isHips: true, (HumanBodyBones)55); AddLink(dictionary, "spine_str_cns_01.x", (HumanBodyBones)7, isHips: false, (HumanBodyBones)55); AddLink(dictionary, "spine_str_cns_02.x", (HumanBodyBones)8, isHips: false, (HumanBodyBones)55); AddLink(dictionary, "spine_str_cns_03.x", (HumanBodyBones)54, isHips: false, (HumanBodyBones)8); AddLink(dictionary, "neck.x", (HumanBodyBones)9, isHips: false, (HumanBodyBones)55); AddLink(dictionary, "head.x", (HumanBodyBones)10, isHips: false, (HumanBodyBones)55); AddLimbLinks(dictionary, ".l", left: true); AddLimbLinks(dictionary, ".r", left: false); AddFingerLinks(dictionary, ".l", left: true); AddFingerLinks(dictionary, ".r", left: false); ScaleAndAlign(dictionary); for (int j = 0; j < links.Count; j++) { BoneLink boneLink = links[j]; boneLink.RotationOffset = Quaternion.Inverse(boneLink.Source.rotation) * boneLink.Target.rotation; } initialized = links.Count > 0; if (initialized) { Plugin.Log.LogInfo((object)($"Sukuna rig retargeting initialized with {links.Count} " + "generic Mercenary bone links on " + ((Object)sourceAnimator).name + ".")); } else if (!warned) { warned = true; Plugin.Log.LogWarning((object)("Sukuna could not resolve animated Mercenary bones on " + ((Object)sourceAnimator).name + "; inspected " + $"{sourceBonesByName.Count} source transforms.")); } } private void AddLimbLinks(Dictionary targets, string suffix, bool left) { AddLink(targets, "shoulder" + suffix, (HumanBodyBones)(left ? 11 : 12), isHips: false, (HumanBodyBones)55); AddLink(targets, "arm_stretch" + suffix, (HumanBodyBones)(left ? 13 : 14), isHips: false, (HumanBodyBones)55); AddLink(targets, "forearm_stretch" + suffix, (HumanBodyBones)(left ? 15 : 16), isHips: false, (HumanBodyBones)55); AddLink(targets, "hand" + suffix, (HumanBodyBones)(left ? 17 : 18), isHips: false, (HumanBodyBones)55); AddLink(targets, "thigh_stretch" + suffix, (HumanBodyBones)(left ? 1 : 2), isHips: false, (HumanBodyBones)55); AddLink(targets, "leg_stretch" + suffix, (HumanBodyBones)(left ? 3 : 4), isHips: false, (HumanBodyBones)55); AddLink(targets, "foot" + suffix, (HumanBodyBones)(left ? 5 : 6), isHips: false, (HumanBodyBones)55); AddLink(targets, "toes_01" + suffix, (HumanBodyBones)(left ? 19 : 20), isHips: false, (HumanBodyBones)55); } private void AddFingerLinks(Dictionary targets, string suffix, bool left) { string[] array = new string[15] { "thumb1", "c_thumb2", "c_thumb3", "index1", "c_index2", "c_index3", "middle1", "c_middle2", "c_middle3", "ring1", "c_ring2", "c_ring3", "pinky1", "c_pinky2", "c_pinky3" }; HumanBodyBones[] array2; if (!left) { array2 = new HumanBodyBones[15]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); } else { array2 = new HumanBodyBones[15]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); } HumanBodyBones[] array3 = (HumanBodyBones[])(object)array2; for (int i = 0; i < array.Length; i++) { AddLink(targets, array[i] + suffix, array3[i], isHips: false, (HumanBodyBones)55); } } private void AddLink(Dictionary targets, string targetName, HumanBodyBones sourceBone, bool isHips = false, HumanBodyBones fallback = (HumanBodyBones)55) { //IL_000d: 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_0020: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!targets.TryGetValue(targetName, out var value)) { return; } Transform sourceBone2 = GetSourceBone(sourceBone); if (!Object.op_Implicit((Object)(object)sourceBone2) && (int)fallback != 55) { sourceBone2 = GetSourceBone(fallback); } if (Object.op_Implicit((Object)(object)sourceBone2)) { BoneLink item = new BoneLink { Source = sourceBone2, Target = value }; links.Add(item); if (isHips) { hipsLink = item; } } } private Transform GetSourceBone(HumanBodyBones bone) { //IL_0006: 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) try { Transform boneTransform = sourceAnimator.GetBoneTransform(bone); if (Object.op_Implicit((Object)(object)boneTransform)) { return boneTransform; } } catch { } EnsureGenericSourceBones(); string[] genericAliases = GetGenericAliases(bone); for (int i = 0; i < genericAliases.Length; i++) { string key = NormalizeBoneName(genericAliases[i]); if (sourceBonesByName.TryGetValue(key, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } } foreach (KeyValuePair item in sourceBonesByName) { for (int j = 0; j < genericAliases.Length; j++) { if (item.Key.EndsWith(NormalizeBoneName(genericAliases[j]), StringComparison.Ordinal) && Object.op_Implicit((Object)(object)item.Value)) { return item.Value; } } } return null; } private void EnsureGenericSourceBones() { if (sourceBonesByName.Count > 0 || !Object.op_Implicit((Object)(object)sourceAnimator)) { return; } Transform[] componentsInChildren = ((Component)sourceAnimator).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)((Component)this).transform) && !val.IsChildOf(((Component)this).transform)) { string text = NormalizeBoneName(((Object)val).name); if (text.Length > 0 && !sourceBonesByName.ContainsKey(text)) { sourceBonesByName.Add(text, val); } } } } private static string NormalizeBoneName(string value) { if (string.IsNullOrEmpty(value)) { return string.Empty; } char[] array = new char[value.Length]; int length = 0; foreach (char c in value) { if (char.IsLetterOrDigit(c)) { array[length++] = char.ToLowerInvariant(c); } } return new string(array, 0, length); } private static string[] GetGenericAliases(HumanBodyBones bone) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected I4, but got Unknown return (int)bone switch { 0 => new string[4] { "Pelvis", "Hips", "Hip", "Base" }, 7 => new string[3] { "Stomach", "Spine", "Spine1" }, 8 => new string[3] { "Chest", "Spine2", "UpperBody" }, 54 => new string[3] { "Chest", "Spine2", "Spine3" }, 9 => new string[2] { "Neck", "Neck1" }, 10 => new string[1] { "Head" }, 11 => new string[4] { "ShoulderL", "ClavicleL", "LShoulder", "LClavicle" }, 13 => new string[4] { "UpperArmL", "ArmL", "LUpperArm", "LArm" }, 15 => new string[4] { "LowerArmL", "ForearmL", "LLowerArm", "LForearm" }, 17 => new string[2] { "HandL", "LHand" }, 12 => new string[4] { "ShoulderR", "ClavicleR", "RShoulder", "RClavicle" }, 14 => new string[4] { "UpperArmR", "ArmR", "RUpperArm", "RArm" }, 16 => new string[4] { "LowerArmR", "ForearmR", "RLowerArm", "RForearm" }, 18 => new string[2] { "HandR", "RHand" }, 1 => new string[4] { "ThighL", "UpperLegL", "LThigh", "LUpperLeg" }, 3 => new string[5] { "CalfL", "LowerLegL", "ShinL", "LCalf", "LLowerLeg" }, 5 => new string[2] { "FootL", "LFoot" }, 19 => new string[4] { "ToeL", "ToesL", "LToe", "LToes" }, 2 => new string[4] { "ThighR", "UpperLegR", "RThigh", "RUpperLeg" }, 4 => new string[5] { "CalfR", "LowerLegR", "ShinR", "RCalf", "RLowerLeg" }, 6 => new string[2] { "FootR", "RFoot" }, 20 => new string[4] { "ToeR", "ToesR", "RToe", "RToes" }, 24 => new string[3] { "Finger0L", "Thumb1L", "LThumb1" }, 25 => new string[3] { "Finger01L", "Thumb2L", "LThumb2" }, 26 => new string[3] { "Finger02L", "Thumb3L", "LThumb3" }, 27 => new string[3] { "Finger1L", "Index1L", "LIndex1" }, 28 => new string[3] { "Finger11L", "Index2L", "LIndex2" }, 29 => new string[3] { "Finger12L", "Index3L", "LIndex3" }, 30 => new string[3] { "Finger2L", "Middle1L", "LMiddle1" }, 31 => new string[3] { "Finger21L", "Middle2L", "LMiddle2" }, 32 => new string[3] { "Finger22L", "Middle3L", "LMiddle3" }, 33 => new string[3] { "Finger3L", "Ring1L", "LRing1" }, 34 => new string[3] { "Finger31L", "Ring2L", "LRing2" }, 35 => new string[3] { "Finger32L", "Ring3L", "LRing3" }, 36 => new string[3] { "Finger4L", "Pinky1L", "LPinky1" }, 37 => new string[3] { "Finger41L", "Pinky2L", "LPinky2" }, 38 => new string[3] { "Finger42L", "Pinky3L", "LPinky3" }, 39 => new string[3] { "Finger0R", "Thumb1R", "RThumb1" }, 40 => new string[3] { "Finger01R", "Thumb2R", "RThumb2" }, 41 => new string[3] { "Finger02R", "Thumb3R", "RThumb3" }, 42 => new string[3] { "Finger1R", "Index1R", "RIndex1" }, 43 => new string[3] { "Finger11R", "Index2R", "RIndex2" }, 44 => new string[3] { "Finger12R", "Index3R", "RIndex3" }, 45 => new string[3] { "Finger2R", "Middle1R", "RMiddle1" }, 46 => new string[3] { "Finger21R", "Middle2R", "RMiddle2" }, 47 => new string[3] { "Finger22R", "Middle3R", "RMiddle3" }, 48 => new string[3] { "Finger3R", "Ring1R", "RRing1" }, 49 => new string[3] { "Finger31R", "Ring2R", "RRing2" }, 50 => new string[3] { "Finger32R", "Ring3R", "RRing3" }, 51 => new string[3] { "Finger4R", "Pinky1R", "RPinky1" }, 52 => new string[3] { "Finger41R", "Pinky2R", "RPinky2" }, 53 => new string[3] { "Finger42R", "Pinky3R", "RPinky3" }, _ => Array.Empty(), }; } private void ScaleAndAlign(Dictionary targets) { //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00b1: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (hipsLink == null) { return; } Transform sourceBone = GetSourceBone((HumanBodyBones)10); Transform sourceBone2 = GetSourceBone((HumanBodyBones)5); Transform sourceBone3 = GetSourceBone((HumanBodyBones)6); targets.TryGetValue("head.x", out var value); targets.TryGetValue("foot.l", out var value2); targets.TryGetValue("foot.r", out var value3); if (Object.op_Implicit((Object)(object)sourceBone) && Object.op_Implicit((Object)(object)sourceBone2) && Object.op_Implicit((Object)(object)sourceBone3) && Object.op_Implicit((Object)(object)value) && Object.op_Implicit((Object)(object)value2) && Object.op_Implicit((Object)(object)value3)) { float num = (sourceBone2.position.y + sourceBone3.position.y) * 0.5f; float num2 = (value2.position.y + value3.position.y) * 0.5f; float num3 = Mathf.Abs(sourceBone.position.y - num); float num4 = Mathf.Abs(value.position.y - num2); if (num3 > 0.1f && num4 > 0.1f) { float num5 = Mathf.Clamp(num3 / num4, 0.65f, 1.7f); ((Component)this).transform.localScale = Vector3.one * num5; } } Transform transform = ((Component)this).transform; transform.position += hipsLink.Source.position - hipsLink.Target.position; } private void LateUpdate() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { Initialize(); if (!initialized) { return; } } for (int i = 0; i < links.Count; i++) { BoneLink boneLink = links[i]; boneLink.Target.rotation = boneLink.Source.rotation * boneLink.RotationOffset; } if (hipsLink != null) { hipsLink.Target.position = hipsLink.Source.position; } } } } namespace GojoSatoruMod.Sukuna { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("dev.marmennz.ryomensukuna", "Ryomen Sukuna", "1.1.6")] public sealed class SukunaPlugin : BaseUnityPlugin { public const string PluginGuid = "dev.marmennz.ryomensukuna"; public const string PluginVersion = "1.1.6"; public const string PluginName = "Ryomen Sukuna"; private void Awake() { JujutsuStartup.UseHost((MonoBehaviour)(object)this); JujutsuAssetPaths.AddPlugin(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); JujutsuStartup.Step("Sukuna's parting blade", (Action)delegate { JujutsuHitSync.Register("sukuna-step-cleave", 45f, (Action)SukunaReverseCursedTechniqueState.LandCleave); }); JujutsuStartup.Step("Sukuna's world cut", (Action)delegate { JujutsuHitSync.Register("sukuna-world-cut", 12f, (Action)SukunaWorldCutState.LandCut); }); JujutsuStartup.Step("Sukuna's text", (Action)SukunaLanguage.Register); JujutsuStartup.Step("Sukuna's assets", (Action)SukunaAssets.Initialize); JujutsuStartup.Step("Sukuna's sounds", (Func)SukunaAssets.LoadAttackSounds); JujutsuStartup.Survivor("Sukuna", (Action)SukunaSurvivor.Initialize); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Ryomen Sukuna 1.1.6 loaded."); } } internal static class GeneratedVersion { internal const string Value = "1.1.6"; } } namespace GojoSatoruMod.States { public sealed class SukunaBladeWallState : BaseSkillState, IPosedState { private const float WindupDuration = 1.35f; private const float RecoveryDuration = 0.3f; private const float WallDistance = 6f; internal const float WallHalfWidth = 21f; internal const float WallHalfHeight = 12f; private const int WallRows = 7; private const float RowRadius = 3.3f; private const int Verticals = 9; private const int TotalLines = 16; private const float WallDrawDuration = 0.25f; private const float LatticeTilt = 45f; private const float AdvanceSpeed = 14f; private const float AdvanceDuration = 5f; private const float RedrawInterval = 0.18f; internal const float WallDamage = 62f; private Vector3 direction; private Vector3 right; private Vector3 up; private Vector3 wallCentre; private float nextRedrawAt; private int drawnLines; private bool struck; private readonly HashSet cutVictims = new HashSet(); private const float PoseHoldAfterStrike = 1f; bool IPosedState.DrivesPose => HoldsPose; GojoCpuPose IPosedState.Pose => (GojoCpuPose)13; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => -8f; bool IPosedState.HoldsSlashPose => true; int IPosedState.PosePriority => 30; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 1.35f); internal bool HoldsPose { get { if (struck) { return ((EntityState)this).fixedAge < 2.35f; } return true; } } public override void OnEnter() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(1.6500001f); RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Push(); } UpdateBasis(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.55f); if (((EntityState)this).isAuthority) { SukunaAssets.PlayLaugh(((EntityState)this).characterBody.corePosition); } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); if (!struck) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } UpdateBasis(); if (((EntityState)this).fixedAge >= 1.35f) { Strike(); } } if (struck && drawnLines < 16) { DrawWallProgressively(); } if (struck && ((EntityState)this).fixedAge >= 1.6500001f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void Advance() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (((EntityState)this).fixedAge - 1.35f > 5f) { return; } Vector3 val = wallCentre; wallCentre += direction * (14f * Time.fixedDeltaTime); SweepSlab(val, wallCentre); if (drawnLines < 16) { DrawWallProgressively(); } else if (((EntityState)this).fixedAge >= nextRedrawAt) { nextRedrawAt = ((EntityState)this).fixedAge + 0.18f; for (int i = 0; i < 16; i++) { DrawLine(i, 0.24300002f); } } } private void DrawWallProgressively() { if (drawnLines < 16) { float num = ((EntityState)this).fixedAge - 1.35f; int num2 = Mathf.Clamp(Mathf.CeilToInt(16f * (num / 0.25f)), 0, 16); while (drawnLines < num2) { DrawLine(drawnLines, 0.7f); drawnLines++; } } } private void DrawLine(int index, float lifetime) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: 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_00f6: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.AngleAxis(45f, direction); Vector3 val2 = val * right; Vector3 val3 = val * up; float num = Mathf.Sqrt(585f); if (index < 9) { if (index != 0 && index != 8) { float num2 = (float)index / 8f; float num3 = Mathf.Lerp(0f - num, num, num2); Vector3 val4 = wallCentre + val2 * num3; SukunaVisuals.CreateSlash(val4 - val3 * num, val4 + val3 * num, 0.55f, lifetime, SukunaAssets.Slash, true); } } else { int num4 = index - 9; if (num4 != 0 && num4 != 6) { float num5 = Mathf.Lerp(0f - num, num, (float)num4 / 6f); Vector3 val5 = wallCentre + val3 * num5; SukunaVisuals.CreateSlash(val5 - val2 * num, val5 + val2 * num, 0.55f, lifetime, (num4 % 2 == 0) ? SukunaVisuals.DarkSlash : SukunaVisuals.GreySlash, true); } } } private void UpdateBasis() { //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_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 forward = ((Ray)(ref aimRay)).direction; if (((Vector3)(ref forward)).sqrMagnitude < 0.01f) { forward = ((EntityState)this).characterBody.transform.forward; } direction = ((Vector3)(ref forward)).normalized; right = Vector3.Cross(Vector3.up, direction); if (((Vector3)(ref right)).sqrMagnitude < 0.001f) { right = Vector3.Cross(((EntityState)this).characterBody.transform.forward, direction); if (((Vector3)(ref right)).sqrMagnitude < 0.001f) { right = Vector3.Cross(Vector3.right, direction); } } ((Vector3)(ref right)).Normalize(); Vector3 val = Vector3.Cross(direction, right); up = ((Vector3)(ref val)).normalized; } private void Strike() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) struck = true; wallCentre = ((EntityState)this).characterBody.corePosition + direction * 6f; ShowWallBurst(wallCentre); JujutsuSfxAssets.PlayHeavyWhoosh(wallCentre, 0.95f); JujutsuSfxAssets.PlaySlash(wallCentre, 0.8f); ((BaseState)this).AddRecoil(-4f, -7f, -1.2f, 1.2f); SukunaBladeWallRider.Launch(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), ((BaseState)this).damageStat * 62f, wallCentre, direction, right, up, cutVictims, ((BaseState)this).RollCrit()); } private void SweepSlab(Vector3 from, Vector3 to) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) bool flag = ((BaseState)this).RollCrit(); for (int i = 0; i < 7; i++) { float num = (float)i / 6f; float num2 = Mathf.Lerp(-12f, 12f, num); Vector3 val = up * num2; JujutsuDamageUtility.FireCapsule(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), from + val - right * 21f, to + val + right * 21f, 3.3f, ((BaseState)this).damageStat * 62f, -direction * 900f + Vector3.up * 420f, flag, 1f, DamageTypeCombo.GenericSpecial | DamageTypeCombo.op_Implicit((DamageType)1024), cutVictims); } } private void ShowWallBurst(Vector3 centre) { //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_0012: Unknown result type (might be due to invalid IL or missing references) GojoTechniqueVisuals.CreateBurst(centre, SukunaAssets.Slash, 16.800001f, 0.85f, (GojoTechniqueStyle)3, direction); } 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)2; } } public sealed class SukunaReverseCursedHealState : BaseSkillState { internal const float Duration = 1.05f; internal const float HealFraction = 0.4f; private float healedTarget; private RuntimeOrbVisual auraVisual; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 1.05f); public override void OnEnter() { //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_0075: 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_0092: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(1.05f); RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Push(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } auraVisual = RuntimeVisuals.CreateOrb(((EntityState)this).characterBody.corePosition, SukunaAssets.Curse, 1.6f, 0.4f, (GojoTechniqueStyle)0); JujutsuSfxAssets.PlayLightWhoosh(((EntityState)this).characterBody.corePosition, 0.45f); if (((EntityState)this).isAuthority) { SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.12f, SukunaAssets.KnowYourPlaceSound, SukunaAssets.Voice8Sound); } } public override void FixedUpdate() { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)auraVisual)) { auraVisual.SetPosition(((EntityState)this).characterBody.corePosition); auraVisual.SetRadius(Mathf.Lerp(1.6f, 0.5f, AnimationPhase)); } if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.healthComponent) && ((EntityState)this).characterBody.healthComponent.alive) { HealthComponent healthComponent = ((EntityState)this).characterBody.healthComponent; float num = healthComponent.fullHealth * 0.4f * AnimationPhase; float num2 = num - healedTarget; if (num2 > 0f) { healthComponent.Heal(num2, default(ProcChainMask), true); healedTarget = num; } } if (((EntityState)this).fixedAge >= 1.05f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Pop(); } if (Object.op_Implicit((Object)(object)auraVisual)) { auraVisual.BurstAndDestroy(3.2f, 0.28f); auraVisual = null; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaReverseCursedTechniqueState : BaseSkillState, IPosedState { internal const float TargetRadius = 30f; internal const float DashSpeed = 62f; internal const float DashDuration = 0.42f; private const float ExitSpeed = 62f; private const float BehindGap = 3.2f; private const float BladeLaunchHeight = 0.75f; private const float ExitSpeedFraction = 0.6f; internal const float ExitCleaveDamage = 15f; internal const float DashDistance = 26.039999f; private CharacterBody target; private bool steppedForRemotes; private Vector3 travelDirection; private Vector3 entryDirection; private bool striking; private bool finished; private bool gravityDisabled; private readonly JujutsuCloseDash closing = new JujutsuCloseDash(); private Vector3 behindOffset; internal const string CleaveHit = "sukuna-step-cleave"; bool IPosedState.DrivesPose => SteppedThroughTarget; GojoCpuPose IPosedState.Pose => (GojoCpuPose)13; float IPosedState.PosePhase => 0f; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => -6f; bool IPosedState.HoldsSlashPose => true; int IPosedState.PosePriority => 20; internal bool SteppedThroughTarget { get { if (!Object.op_Implicit((Object)(object)target)) { return steppedForRemotes; } return true; } } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write((Object)(object)target != (Object)null); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); steppedForRemotes = reader.ReadBoolean(); } public override void OnEnter() { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(0.7f); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); target = FindAimedTarget(aimRay); Vector3 val = ((Ray)(ref aimRay)).direction; travelDirection = ((Vector3)(ref val)).normalized; if (((Vector3)(ref travelDirection)).sqrMagnitude < 0.01f) { travelDirection = ((EntityState)this).characterBody.transform.forward; } entryDirection = travelDirection; if (Object.op_Implicit((Object)(object)target)) { val = target.corePosition - ((EntityState)this).characterBody.corePosition; travelDirection = ((Vector3)(ref val)).normalized; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = false; gravityDisabled = true; JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, true); ((EntityState)this).characterMotor.velocity = travelDirection * (Object.op_Implicit((Object)(object)target) ? 0f : 62f); ((EntityState)this).characterMotor.rootMotion = Vector3.zero; } if (Object.op_Implicit((Object)(object)target)) { behindOffset = -TargetFacing() * (3.2f + target.radius); closing.Begin(((EntityState)this).characterBody.footPosition, BehindPoint(), 150f, "sukuna"); FaceCentre(target.corePosition); } else { FaceTravel(); } JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.4f); } } public override void FixedUpdate() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d9: 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) ((EntityState)this).FixedUpdate(); if (!((EntityState)this).isAuthority || finished) { return; } if (!Object.op_Implicit((Object)(object)target)) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = travelDirection * 62f; } if (((EntityState)this).fixedAge >= 0.42f) { Finish(withCleave: false); } return; } if (!Object.op_Implicit((Object)(object)target.healthComponent) || !target.healthComponent.alive) { Finish(striking); return; } if (closing.Running) { if (!closing.Advance(((EntityState)this).characterMotor, ((EntityState)this).characterBody.footPosition, BehindPoint(), Time.fixedDeltaTime)) { return; } striking = true; JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.55f); Plugin.Log.LogInfo((object)($"step: crossed to {((EntityState)this).characterBody.corePosition} in " + $"{((EntityState)this).fixedAge:0.000}s, " + (closing.Stopped ? "stopped short by something in the way" : ("behind " + ((Object)target).name)) + ".")); } StrikeBack(); } private Vector3 BehindPoint() { //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_001f: 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) Vector3 result = target.corePosition + behindOffset; result.y = target.footPosition.y; return result; } private Vector3 TargetFacing() { //IL_0027: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) CharacterDirection component = ((Component)target).GetComponent(); Vector3 val = (Object.op_Implicit((Object)(object)component) ? component.forward : target.transform.forward); val = Vector3.ProjectOnPlane(val, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.ProjectOnPlane(travelDirection, Vector3.up); } if (!(((Vector3)(ref val)).sqrMagnitude > 0.01f)) { return Vector3.forward; } return ((Vector3)(ref val)).normalized; } private void StrikeBack() { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 corePosition = target.corePosition; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } Vector3 val = Vector3.ProjectOnPlane(corePosition - ((EntityState)this).characterBody.corePosition, Vector3.up); travelDirection = ((Vector3)(ref val)).normalized; FaceCentre(corePosition); Finish(withCleave: true); } internal static void LandCleave(CharacterBody body, Vector3 centre, Vector3 towards, float delay, bool blackFlash) { //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_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_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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00a2: Unknown result type (might be due to invalid IL or missing references) Vector3 val = towards - centre; Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = body.transform.forward; } TravellingBladeController.DelayedSphere(((Component)body).gameObject, (TeamIndex)((!Object.op_Implicit((Object)(object)body.teamComponent)) ? 1 : ((int)body.teamComponent.teamIndex)), centre, 5.5f, Mathf.Clamp(delay, 0f, 0.5f), body.damage * 15f, val2 * 1200f + Vector3.up * 380f, Util.CheckRoll(body.crit, body.master), 1f, DamageTypeCombo.GenericSecondary); } private void Finish(bool withCleave) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Plugin.Log.LogInfo((object)($"step: finishing at {((EntityState)this).fixedAge:0.000}s, cleave={withCleave}, " + $"gravity restored={gravityDisabled}, motor={Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)}.")); finished = true; RestoreGravity(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Flattened(entryDirection) * 37.2f; } if (withCleave) { ThrowExitCleave(); } ((EntityState)this).outer.SetNextStateToMain(); } private void ThrowExitCleave() { //IL_002a: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a7: 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_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) //IL_00af: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = ((((Vector3)(ref entryDirection)).sqrMagnitude > 0.01f) ? ((Vector3)(ref entryDirection)).normalized : ((EntityState)this).characterBody.transform.forward); Vector3 val2 = ((EntityState)this).characterBody.corePosition + Vector3.up * 0.75f + val * 1.2f; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val3; if (!Object.op_Implicit((Object)(object)target)) { Vector3 origin = ((Ray)(ref aimRay)).origin; Vector3 direction = ((Ray)(ref aimRay)).direction; val3 = origin + ((Vector3)(ref direction)).normalized * 18f; } else { val3 = target.corePosition; } Vector3 val4 = val3; Vector3 val5 = val4 - val2; Vector3 val6 = ((((Vector3)(ref val5)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val5)).normalized : val); JujutsuHitSync.Request(((EntityState)this).characterBody, "sukuna-step-cleave", val4, val4 + val6, ((Vector3)(ref val5)).magnitude / 156f, false); Vector3 val7 = Vector3.Cross(Vector3.up, val6); if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val7 = ((EntityState)this).characterBody.transform.right; } ((Vector3)(ref val7)).Normalize(); float num = Mathf.Clamp(((Vector3)(ref val5)).magnitude / 156f + 0.06f, 0.14f, 0.5f); SukunaVisuals.CreateFlyingSlash(val2 + val7 * 0.3f, val6, 156f, num, 12.9f, 0.065f, 38f, SukunaVisuals.DarkSlash); SukunaVisuals.CreateFlyingSlash(val2 - val7 * 0.3f, val6, 156f, num, 12.9f, 0.08f, -38f, SukunaVisuals.GreySlash); JujutsuSfxAssets.PlaySlashVariant(4, val4, 0.5f); } public override void OnExit() { RestoreGravity(); ((EntityState)this).OnExit(); } private Vector3 Flattened(Vector3 direction) { //IL_0000: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (direction.y <= 0f) { Vector3 val = Vector3.ProjectOnPlane(direction, Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude > 0.0001f)) { if (!Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { return ((EntityState)this).transform.forward; } return ((EntityState)this).characterDirection.forward; } return ((Vector3)(ref val)).normalized; } return direction; } private void RestoreGravity() { if (gravityDisabled && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = true; } if (gravityDisabled) { JujutsuCloseDash.IgnoreFalls(((EntityState)this).characterBody, false); } gravityDisabled = false; } private void FaceTravel() { //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_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_003b: 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(travelDirection, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = normalized; } } } private void FaceCentre(Vector3 centre) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0046: 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(centre - ((EntityState)this).characterBody.corePosition, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = normalized; } } } private CharacterBody FindAimedTarget(Ray aimRay) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) TeamMask allButNeutral = TeamMask.allButNeutral; ((TeamMask)(ref allButNeutral)).RemoveTeam(((BaseState)this).GetTeam()); BullseyeSearch val = new BullseyeSearch { searchOrigin = ((Ray)(ref aimRay)).origin, searchDirection = ((Ray)(ref aimRay)).direction, maxDistanceFilter = 30f, maxAngleFilter = 22f, teamMaskFilter = allButNeutral, filterByLoS = false, sortMode = (SortMode)2 }; val.RefreshCandidates(); val.FilterOutGameObject(((EntityState)this).gameObject); foreach (HurtBox result in val.GetResults()) { CharacterBody val2 = ((Object.op_Implicit((Object)(object)result) && Object.op_Implicit((Object)(object)result.healthComponent)) ? result.healthComponent.body : null); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.healthComponent) && val2.healthComponent.alive) { return val2; } } return null; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaJabState : BaseSkillState { internal const float FirstDamage = 2.5f; internal const float SecondDamage = 2.8f; internal const float ThirdDamage = 3.3f; internal const float FinisherDamage = 5.8f; internal const float RestoreMultiplier = 2f; internal const float ThirdRestoreMultiplier = 2.4f; internal const float FinisherRestoreMultiplier = 1.8f; private float duration; private Vector3 aimDirection; private bool attacked; private bool rightHand; private int comboStep; private float hitFrame; private float damageCoefficient; private float hitRadius; private float hitForce; private float lungeDistance; private float energyRestored; private bool finisher; internal static float RestorePerHit => 18f; internal static float RestorePerFinisher => 25.199999f; 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_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_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_00d6: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); SukunaSideSkillController component = ((Component)((EntityState)this).characterBody).GetComponent(); comboStep = (Object.op_Implicit((Object)(object)component) ? component.ConsumeNextPunchStep() : 0); ConfigureComboStep(); duration /= Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; aimDirection = ((Vector3)(ref val)).normalized; ((EntityState)this).characterBody.SetAimTimer(duration + 0.25f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = normalized; } } rightHand = (comboStep & 1) != 0; JujutsuSfxAssets.PlayMeleeLight(((EntityState)this).characterBody.corePosition); GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.TriggerPunch(rightHand, duration, comboStep, hitFrame); } } public override void FixedUpdate() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_00f3: 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_013e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.7f); if (!attacked && ((EntityState)this).fixedAge >= duration * hitFrame) { attacked = true; if (((EntityState)this).isAuthority) { 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 * (1.35f + (float)comboStep * 0.12f); if (GojoMeleeAttackUtility.Fire(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), val3, hitRadius, ((BaseState)this).damageStat * damageCoefficient, val2 * hitForce, ((BaseState)this).RollCrit(), finisher ? (DamageTypeCombo.GenericPrimary | DamageTypeCombo.op_Implicit((DamageType)1024)) : DamageTypeCombo.GenericPrimary) > 0) { JujutsuSfxAssets.PlayMeleeHeavy(val3); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(energyRestored); } SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.08f, SukunaAssets.LaughSound, SukunaAssets.Laugh2Sound, SukunaAssets.Voice3Sound); } } if (finisher && ((EntityState)this).isAuthority) { ThrowFinisherSlash(); } ApplyLunge(lungeDistance); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void ThrowFinisherSlash() { //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_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_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_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_00c1: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) 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 * 1.6f; Vector3 val4 = val3 + val2 * 9f; JujutsuDamageUtility.FireCapsule(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), val3, val4, 1.6f, ((BaseState)this).damageStat * 0.6f, val2 * 300f, ((BaseState)this).RollCrit(), 0.4f, DamageTypeCombo.GenericPrimary, (HashSet)null); val = Vector3.Cross(Vector3.up, val2); Vector3 normalized = ((Vector3)(ref val)).normalized; for (int i = -1; i <= 1; i += 2) { SukunaVisuals.CreateSlash(val3 + normalized * ((float)i * 1.5f) + Vector3.up * 0.5f, val4 - normalized * ((float)i * 1.1f), 0.06f, 0.16f, SukunaVisuals.DarkSlash, true); } JujutsuSfxAssets.PlaySlashVariant(2, val3, 0.34f); } private void ConfigureComboStep() { finisher = false; switch (comboStep) { case 1: duration = 1.28f; hitFrame = 0.36f; damageCoefficient = 2.8f; hitRadius = 2.9f; hitForce = 1000f; lungeDistance = 0.6f; energyRestored = RestorePerHit; break; case 2: duration = 1.44f; hitFrame = 0.4f; damageCoefficient = 3.3f; hitRadius = 3.1f; hitForce = 1300f; lungeDistance = 0.7f; energyRestored = 21.6f; break; case 3: duration = 1.92f; hitFrame = 0.45f; damageCoefficient = 5.8f; hitRadius = 3.9f; hitForce = 2600f; lungeDistance = 1.1f; energyRestored = RestorePerFinisher; finisher = true; break; default: duration = 1.2f; hitFrame = 0.33f; damageCoefficient = 2.5f; hitRadius = 2.8f; hitForce = 900f; lungeDistance = 0.55f; energyRestored = RestorePerHit; break; } } private void ApplyLunge(float distance) { //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_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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += normalized * distance; } } public override InterruptPriority GetMinimumInterruptPriority() { if (attacked) { return (InterruptPriority)0; } return (InterruptPriority)2; } } public sealed class SukunaKickState : BaseSkillState { internal const float Damage = 8.5f; private const float HitPhase = 0.48f; private float duration; private Vector3 aimDirection; private bool attacked; public override void OnEnter() { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_008f: 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) ((BaseState)this).OnEnter(); duration = 0.72f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; aimDirection = ((Vector3)(ref val)).normalized; ((EntityState)this).characterBody.SetAimTimer(duration + 0.3f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = normalized; } } GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.TriggerSpinKick(duration, 0.48f); } JujutsuSfxAssets.PlayMeleeHeavy(((EntityState)this).characterBody.corePosition); } public override void FixedUpdate() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00e0: 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); if (!attacked && ((EntityState)this).fixedAge >= duration * 0.48f) { attacked = true; if (((EntityState)this).isAuthority && GojoMeleeAttackUtility.FireRadial(((EntityState)this).gameObject, ((EntityState)this).characterBody, ((BaseState)this).GetTeam(), ((EntityState)this).characterBody.corePosition + Vector3.up * 0.15f, 6.1f, ((BaseState)this).damageStat * 8.5f, 2600f, 650f, ((BaseState)this).RollCrit(), DamageTypeCombo.GenericSecondary) > 0) { JujutsuSfxAssets.PlayMeleeHeavy(((EntityState)this).characterBody.corePosition); CursedEnergyController component = ((Component)((EntityState)this).characterBody).GetComponent(); if (component != null) { component.RestoreFromMelee(12f); } SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.16f, SukunaAssets.LaughSound, SukunaAssets.Laugh2Sound, SukunaAssets.Voice3Sound); } ApplyLunge(2.6f); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void ApplyLunge(float distance) { //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_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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += normalized * distance; } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public sealed class SukunaDismantleState : BaseSkillState, IPosedState { internal const float DamagePerSlash = 1f; private const float SlashRange = 400f; private const float SlashSpeed = 184f; private const float VerticalFan = 4.8f; private const float OriginShare = 0.1f; private const float MaxOriginDrop = 0.9f; private const float AimShare = 0.003f; private const float SideAimShare = 0.008f; private float duration; private int slashIndex; private bool fired; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)13; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => -7f; bool IPosedState.HoldsSlashPose => true; int IPosedState.PosePriority => 30; internal float AnimationPhase { get { if (!(duration > 0f)) { return 0f; } return Mathf.Clamp01(((EntityState)this).fixedAge / duration); } } public override void OnEnter() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = 0.001f; ((EntityState)this).characterBody.SetAimTimer(0.08f); SukunaBladeMagazine component = ((Component)((EntityState)this).characterBody).GetComponent(); slashIndex = (Object.op_Implicit((Object)(object)component) ? Mathf.Max(0, component.Sequence - 1) : Random.Range(0, 6)); GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.TriggerDismantle(0.5f); } if (((EntityState)this).isAuthority) { SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.015f, SukunaAssets.IdiotSound, SukunaAssets.KnowYourPlaceSound, SukunaAssets.Voice7Sound); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!fired && ((EntityState)this).fixedAge >= duration * 0.12f) { fired = true; FireSlash(slashIndex); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireSlash(int slashIndex) { //IL_0007: 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_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_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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_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_01fc: 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_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_0234: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) JujutsuSfxAssets.PlaySlashVariant(slashIndex, ((EntityState)this).characterBody.corePosition, (slashIndex % 2 == 0) ? 0.5f : 0.44f); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = ((EntityState)this).characterBody.transform.right; } ((Vector3)(ref val2)).Normalize(); val = Vector3.Cross(normalized, val2); Vector3 normalized2 = ((Vector3)(ref val)).normalized; float num = Mathf.Sin((float)slashIndex * 2.37f) * 0.72f; float num2 = (0f - (1f - Mathf.Cos((float)slashIndex * 1.71f))) * 0.5f * 4.8f; Vector3 val3 = val2 * num + normalized2 * Mathf.Max(num2 * 0.1f, -0.9f); val = normalized - val2 * num * 0.008f + normalized2 * num2 * 0.003f; Vector3 normalized3 = ((Vector3)(ref val)).normalized; Vector3 val4 = ((Ray)(ref aimRay)).origin + normalized * 0.4f + val3; Vector3 val5 = val4 + normalized3 * 400f; RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(val4, normalized3, ref val6, 400f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val5 = ((RaycastHit)(ref val6)).point; } float num3 = Random.Range(-90f, 90f); Vector3 val7 = ((EntityState)this).characterBody.corePosition + normalized * 1.15f + val2 * num * 0.22f + normalized2 * num2 * 0.18f; float num4 = Mathf.Clamp(Vector3.Distance(val7, val5) / 184f, 0.12f, 2.4f); TravellingBladeController.Sweep(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), val4, val5, 0.86f, 184f, ((BaseState)this).damageStat * 1f, normalized * 520f, ((BaseState)this).RollCrit(), 0.35f, DamageTypeCombo.GenericPrimary); SukunaVisuals.CreateFlyingSlash(val7, normalized3, 184f, num4, 8.5f + (float)(slashIndex % 3) * 1.25f, 0.055f + (float)(slashIndex % 2) * 0.022f, num3, (slashIndex % 2 == 0) ? SukunaVisuals.DarkSlash : SukunaVisuals.GreySlash); ((BaseState)this).AddRecoil(-0.18f, -0.32f, num * -0.08f, num * 0.08f); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaCleaveState : BaseSkillState, IPosedState { internal const float Damage = 7.5f; internal const float Radius = 7f; private const float Reach = 36f; private const float AimAssistAngle = 18f; private const float AimAssistRadius = 2f; private float duration; private Vector3 target; private Vector3 effectRight; private Vector3 effectUp; private bool fired; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)14; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0f; float IPosedState.PosePitch => -9f; bool IPosedState.HoldsSlashPose => true; int IPosedState.PosePriority => 10; internal float AnimationPhase { get { if (!(duration > 0f)) { return 0f; } return Mathf.Clamp01(((EntityState)this).fixedAge / duration); } } public override void OnEnter() { //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_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_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_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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = 0.78f / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat); Ray aimRay = ((BaseState)this).GetAimRay(); target = FindTargetPoint(aimRay); effectRight = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); if (((Vector3)(ref effectRight)).sqrMagnitude < 0.01f) { effectRight = ((EntityState)this).characterBody.transform.right; } ((Vector3)(ref effectRight)).Normalize(); Vector3 val = Vector3.Cross(((Ray)(ref aimRay)).direction, effectRight); effectUp = ((Vector3)(ref val)).normalized; ((EntityState)this).characterBody.SetAimTimer(duration + 0.35f); GojoModelAnimator obj = GojoModelAnimator.Find(((EntityState)this).characterBody); if (obj != null) { obj.TriggerDismantle(duration); } if (((EntityState)this).isAuthority) { SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.1f, SukunaAssets.KnowYourPlaceSound, SukunaAssets.IdiotSound, SukunaAssets.Voice8Sound); } } public override void FixedUpdate() { //IL_0035: 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_0061: 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_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_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_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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); if (!fired && ((EntityState)this).fixedAge >= duration * 0.48f) { fired = true; JujutsuSfxAssets.PlayHeavyWhoosh(((EntityState)this).characterBody.corePosition, 0.48f); JujutsuSfxAssets.PlaySlashVariant(0, ((EntityState)this).characterBody.corePosition, 0.34f); JujutsuSfxAssets.PlaySlashVariant(1, ((EntityState)this).characterBody.corePosition, 0.3f); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Vector3 val = ((Vector3)(ref direction)).normalized; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = ((EntityState)this).characterBody.transform.forward; } Vector3 val2 = ((EntityState)this).characterBody.corePosition + val * 1.2f; Vector3 val3 = target - val2; float num = Mathf.Max(1f, ((Vector3)(ref val3)).magnitude); Vector3 val4 = val3 / num; float num2 = Mathf.Clamp(num / 156f + 0.08f, 0.12f, 0.42f); TravellingBladeController.DelayedSphere(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), target, 7f, num / 156f, ((BaseState)this).damageStat * 7.5f, val4 * 1400f + Vector3.up * 450f, ((BaseState)this).RollCrit(), 1f, DamageTypeCombo.GenericSecondary); SukunaVisuals.CreateFlyingSlash(val2 + effectRight * 0.3f, val4, 156f, num2, 16.449999f, 0.065f, 38f, SukunaVisuals.DarkSlash); SukunaVisuals.CreateFlyingSlash(val2 - effectRight * 0.3f, val4, 156f, num2, 16.449999f, 0.08f, -38f, SukunaVisuals.GreySlash); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private Vector3 FindTargetPoint(Ray aimRay) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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) CharacterBody val = FindAimedBody(aimRay); if (Object.op_Implicit((Object)(object)val)) { return val.corePosition; } int num = LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask); RaycastHit val2 = default(RaycastHit); if (Physics.SphereCast(aimRay, 2f, ref val2, 36f, num, (QueryTriggerInteraction)2)) { HurtBox val3 = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider) ? ((Component)((RaycastHit)(ref val2)).collider).GetComponent() : null); if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.healthComponent) && Object.op_Implicit((Object)(object)val3.healthComponent.body)) { return val3.healthComponent.body.corePosition; } return ((RaycastHit)(ref val2)).point; } return ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 18f; } private CharacterBody FindAimedBody(Ray aimRay) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) TeamMask allButNeutral = TeamMask.allButNeutral; ((TeamMask)(ref allButNeutral)).RemoveTeam(((BaseState)this).GetTeam()); BullseyeSearch val = new BullseyeSearch { searchOrigin = ((Ray)(ref aimRay)).origin, searchDirection = ((Ray)(ref aimRay)).direction, maxDistanceFilter = 36f, maxAngleFilter = 18f, teamMaskFilter = allButNeutral, filterByLoS = false, sortMode = (SortMode)2 }; val.RefreshCandidates(); val.FilterOutGameObject(((EntityState)this).gameObject); foreach (HurtBox result in val.GetResults()) { if (Object.op_Implicit((Object)(object)result) && Object.op_Implicit((Object)(object)result.healthComponent) && result.healthComponent.alive && Object.op_Implicit((Object)(object)result.healthComponent.body)) { return result.healthComponent.body; } } return null; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaFugaState : BaseSkillState, IPosedState { internal const float WindupDuration = 1.86f; internal const float ExplosionDamage = 40f; private const float RecoveryDuration = 0.28f; private RuntimeOrbVisual arrowVisual; private RuntimeFugaProjectileVisual arrowFlames; private Vector3 projectilePosition; private Vector3 direction; private float launchedAt; private bool launched; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)15; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0.06f; float IPosedState.PosePitch => -12f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 30; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 1.86f); public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: 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) ((BaseState)this).OnEnter(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; direction = ((Vector3)(ref val)).normalized; projectilePosition = GetChargePosition(direction); arrowVisual = RuntimeVisuals.CreateOrb(projectilePosition, SukunaAssets.Fire, 0.42f, 0f, (GojoTechniqueStyle)0); if (Object.op_Implicit((Object)(object)arrowVisual)) { arrowFlames = SukunaFugaVisuals.AddFugaProjectileFlames(((Component)arrowVisual).gameObject, direction); } ((EntityState)this).characterBody.SetAimTimer(2.26f); Util.PlaySound("Play_mage_m2_charge", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { SukunaAssets.PlayFuga(((EntityState)this).characterBody.corePosition); } } public override void FixedUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!launched) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).direction; direction = ((Vector3)(ref val)).normalized; arrowFlames?.SetDirection(direction); projectilePosition = GetChargePosition(direction); if (Object.op_Implicit((Object)(object)arrowVisual)) { arrowVisual.SetPosition(projectilePosition); arrowVisual.SetRadius(Mathf.Lerp(0.42f, 1.05f, Mathf.Clamp01(((EntityState)this).fixedAge / 1.86f))); arrowVisual.TriggerPulse(0.08f); } if (((EntityState)this).fixedAge >= 1.86f) { Launch(); } } else if (((EntityState)this).fixedAge >= launchedAt + 0.28f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private Vector3 GetChargePosition(Vector3 aimDirection) { //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_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_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_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) return ((EntityState)this).characterBody.corePosition + ((EntityState)this).characterBody.transform.right * 0.48f + Vector3.up * 0.34f + aimDirection * 0.72f; } private void Launch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) launched = true; launchedAt = ((EntityState)this).fixedAge; projectilePosition = ((EntityState)this).characterBody.corePosition + direction * 1.4f; if (Object.op_Implicit((Object)(object)arrowVisual)) { arrowVisual.SetPosition(projectilePosition); arrowVisual.SetRadius(1.2f); arrowVisual.TriggerPulse(0.35f); } arrowFlames?.SetDirection(direction); FugaArrowController.Launch(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), projectilePosition, direction, ((BaseState)this).damageStat * 40f, ((BaseState)this).RollCrit(), ((EntityState)this).characterBody.transform.right, arrowVisual, arrowFlames); arrowVisual = null; arrowFlames = null; JujutsuSfxAssets.PlayHeavyWhoosh(projectilePosition, 0.9f); Util.PlaySound("Play_mage_m2_shoot", ((EntityState)this).gameObject); ((BaseState)this).AddRecoil(-3f, -5f, -0.8f, 0.8f); } public override void OnExit() { if (Object.op_Implicit((Object)(object)arrowVisual)) { EntityState.Destroy((Object)(object)((Component)arrowVisual).gameObject); } arrowFlames = null; ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaMalevolentShrineState : BaseSkillState, IPosedState { private const float ActivationTime = 3f; private const float CastDuration = 3f; private const float ShrineRiseTime = 0.65f; private bool activated; private bool raised; private bool gravitySuspended; private Vector3 lockedFacing; private GojoFaceCamera faceCamera; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)17; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0.08f; float IPosedState.PosePitch => -10f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 30; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 3f); public override void OnEnter() { //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_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_00a3: 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_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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(3.5f); RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Push(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.useGravity) { gravitySuspended = true; ((EntityState)this).characterMotor.useGravity = false; } 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; LockMovement(); Util.PlaySound("Play_brother_m2_lunarShard_fire", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { faceCamera = GojoFaceCamera.Push(((EntityState)this).characterBody); SukunaAssets.PlayDomain(((EntityState)this).characterBody.corePosition); } } public override void FixedUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); LockMovement(); if (!raised && ((EntityState)this).fixedAge >= 0.65f) { raised = true; ((Component)((EntityState)this).characterBody).GetComponent()?.Raise(((EntityState)this).characterBody.footPosition, lockedFacing); } if (!activated && ((EntityState)this).fixedAge >= 3f) { activated = true; ((Component)((EntityState)this).characterBody).GetComponent()?.Activate(((EntityState)this).characterBody.footPosition, lockedFacing, ((BaseState)this).damageStat); Util.PlaySound("Play_voidRaid_snipe_shoot_final", ((EntityState)this).gameObject); } if (((EntityState)this).fixedAge >= 3f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } 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 (faceCamera != null) { faceCamera.Release(); faceCamera = null; } if (raised && !activated) { ((Component)((EntityState)this).characterBody).GetComponent()?.CancelRaise(); } RootedArmorController obj = RootedArmorController.Find(((EntityState)this).characterBody); if (obj != null) { obj.Pop(); } if (gravitySuspended && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.useGravity = true; } gravitySuspended = false; ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaWaterBeamState : BaseSkillState, IPosedState { private const float WindupDuration = 0.34f; private const float RecoveryDuration = 0.24f; private const float JetRepeatInterval = 0.96000004f; internal const float TickInterval = 0.1f; internal const float TickDamage = 1.6f; internal const float BeamLength = 55f; private const float BeamRadius = 0.7f; private const float GatherStartRadius = 1.4f; private const float GatherEndRadius = 0.12f; private const float GatherForward = 1.35f; private Vector3 aimDirection; private RuntimeOrbVisual gatherVisual; private readonly JujutsuHeldBeam beam = new JujutsuHeldBeam(); private PlaybackHandle jetSound; private float nextTickAt; private float stoppedAt; private bool firing; private bool stopped; bool IPosedState.DrivesPose => true; GojoCpuPose IPosedState.Pose => (GojoCpuPose)18; float IPosedState.PosePhase => AnimationPhase; float IPosedState.PoseBob => 0.05f; float IPosedState.PosePitch => -8f; bool IPosedState.HoldsSlashPose => false; int IPosedState.PosePriority => 10; internal float AnimationPhase => Mathf.Clamp01(((EntityState)this).fixedAge / 0.34f); public override void OnEnter() { //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_004b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); UpdateAim(); ((EntityState)this).characterBody.SetAimTimer(4.34f); gatherVisual = RuntimeVisuals.CreateOrb(GatherPoint(), SukunaAssets.Water, 1.4f, 0f, (GojoTechniqueStyle)0); if (((EntityState)this).isAuthority) { SukunaAssets.TryPlayVoice(((EntityState)this).characterBody.corePosition, 0.1f, SukunaAssets.KnowYourPlaceSound, SukunaAssets.IdiotSound, SukunaAssets.Voice8Sound); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); GojoStateUtils.NoSprintDuring(((EntityState)this).characterBody, ((EntityState)this).isAuthority); if (!firing && !stopped) { UpdateGather(); if (((EntityState)this).fixedAge >= 0.34f) { StartFiring(); } } else if (firing) { UpdateFiring(); } else if (((EntityState)this).fixedAge >= stoppedAt + 0.24f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void UpdateAim() { //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_0038: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Vector3 normalized = ((Vector3)(ref direction)).normalized; aimDirection = ((((Vector3)(ref normalized)).sqrMagnitude > 0.01f) ? normalized : ((EntityState)this).characterBody.transform.forward); ((EntityState)this).characterBody.SetAimTimer(0.5f); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = Vector3.ProjectOnPlane(aimDirection, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; } } } private Vector3 GatherPoint() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return ((EntityState)this).characterBody.corePosition + aimDirection * 1.35f; } private void UpdateGather() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)gatherVisual)) { UpdateAim(); float num = Mathf.Clamp01(((EntityState)this).fixedAge / 0.34f); gatherVisual.SetPosition(GatherPoint()); gatherVisual.SetRadius(Mathf.Lerp(1.4f, 0.12f, Mathf.SmoothStep(0f, 1f, num))); } } private void StartFiring() { firing = true; nextTickAt = ((EntityState)this).fixedAge; if (Object.op_Implicit((Object)(object)gatherVisual)) { gatherVisual.TriggerPulse(0.4f); } PlayJet(); } private void UpdateFiring() { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) UpdateAim(); if (Object.op_Implicit((Object)(object)gatherVisual)) { gatherVisual.SetPosition(GatherPoint()); gatherVisual.SetRadius(0.12f); } Vector3 val = GatherPoint(); Vector3 val2 = val + aimDirection * 55f; AimBeam(val, val2); if (((EntityState)this).fixedAge >= nextTickAt) { nextTickAt = ((EntityState)this).fixedAge + 0.1f; JujutsuDamageUtility.FireCapsule(((EntityState)this).gameObject, ((BaseState)this).GetTeam(), val, val2, 0.7f, ((BaseState)this).damageStat * 1.6f, aimDirection * 140f, ((BaseState)this).RollCrit(), 0.4f, DamageTypeCombo.GenericSecondary, (HashSet)null); PlayJet(); } SukunaSideSkillController component = ((Component)((EntityState)this).characterBody).GetComponent(); if ((((EntityState)this).isAuthority && (!Object.op_Implicit((Object)(object)component) || !component.DismantleHeld)) || !SpendFromReservoir()) { StopFiring(); } } private bool SpendFromReservoir() { if (!((EntityState)this).isAuthority) { return true; } SukunaTorrentReservoir component = ((Component)((EntityState)this).characterBody).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { return component.Drain(Time.fixedDeltaTime); } return true; } private void StopFiring() { PlaybackHandle obj = jetSound; if (obj != null) { obj.RequestStop(); } jetSound = null; firing = false; stopped = true; stoppedAt = ((EntityState)this).fixedAge; beam.Close(); if (Object.op_Implicit((Object)(object)gatherVisual)) { gatherVisual.BurstAndDestroy(0.84000003f, 0.16f); gatherVisual = null; } } private void PlayJet() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) jetSound = GojoAssets.PlayAttackSound(SukunaAssets.WaterJetSound, GatherPoint(), 0.05f, 0.96000004f, "Sukuna", false); } private void AimBeam(Vector3 start, Vector3 end) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!beam.IsOpen) { beam.Open(start, end, 0.154f, Color.white, 0.35f, SukunaAssets.Water, 0.595f, SukunaAssets.WaterEdge); } beam.Aim(start, end, 1f + Mathf.Sin(Time.time * 48f) * 0.05f); } public override void OnExit() { beam.Close(); PlaybackHandle obj = jetSound; if (obj != null) { obj.RequestStop(); } jetSound = null; if (Object.op_Implicit((Object)(object)gatherVisual)) { EntityState.Destroy((Object)(object)((Component)gatherVisual).gameObject); gatherVisual = null; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public sealed class SukunaWorldCutState : BaseSkillState { private const float WindUp = 0.52f; private const float Duration = 1.05f; private const float Standoff = 6f; internal const float Reach = 90f; private const float NearHeight = 14f; private const float FarHeight = 2.5f; private const float CutRadius = 3.4f; internal const float Coefficient = 20f; private const float FallHeight = 62f; private const float FallSeconds = 0.34f; private const float BiteDepth = 2.2f; private const float RestSeconds = 0.34f; private const int FinEdges = 1; private Vector3 aimDirection; private bool cut; private float fallStartedAt = -1f; private float drawFallStartedAt = -1f; private RuntimeSlashVisual[] fin; internal const string CutHit = "sukuna-world-cut"; internal const float NearEndReach = 12f; public override void Update() { ((EntityState)this).Update(); if (!(drawFallStartedAt < 0f) && fin != null) { float num = Mathf.Clamp01((((EntityState)this).age - drawFallStartedAt) / 0.34f); float num2 = 1f - num; float lift = Mathf.Lerp(-2.2f, 62f, num2 * num2); float num3 = ((num >= 1f) ? 0f : (2f * num2 * 64.2f / 0.34f)); PlaceFin(lift, 1f + num3 * 0.011f); } } public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) ((BaseState)this).OnEnter(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; aimDirection = ((Vector3)(ref direction)).normalized; if (((Vector3)(ref aimDirection)).sqrMagnitude < 0.01f) { aimDirection = ((EntityState)this).characterBody.transform.forward; } ((EntityState)this).characterBody.SetAimTimer(1.3499999f); GojoModelAnimator val = GojoModelAnimator.Find(((EntityState)this).characterBody); if (Object.op_Implicit((Object)(object)val)) { val.TriggerDismantle(1.05f); } JujutsuSfxAssets.PlayMeleeLight(((EntityState)this).characterBody.corePosition); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); GojoStateUtils.SlowMovementDuringAttack(((EntityState)this).characterMotor, ((EntityState)this).isAuthority, 0.12f); if (!cut && ((EntityState)this).fixedAge >= 0.52f) { if (fallStartedAt < 0f) { fallStartedAt = ((EntityState)this).fixedAge; drawFallStartedAt = ((EntityState)this).age; BuildFin(); } if (((EntityState)this).fixedAge - fallStartedAt >= 0.34f) { cut = true; Cut(); } } if (((EntityState)this).fixedAge >= 1.05f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void GroundLine(out Vector3 near, out Vector3 far) { //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_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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) Vector3 forward = aimDirection; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { forward = ((EntityState)this).characterBody.transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { forward = Vector3.forward; } } ((Vector3)(ref forward)).Normalize(); Vector3 footPosition = ((EntityState)this).characterBody.footPosition; near = footPosition + forward * 6f; far = footPosition + forward * 96f; } private void BuildFin() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) GroundLine(out var near, out var far); fin = (RuntimeSlashVisual[])(object)new RuntimeSlashVisual[2]; fin[0] = SukunaVisuals.CreateSlash(near, far, 3f, 0.34f, SukunaAssets.Slash, true); fin[1] = SukunaVisuals.CreateSlash(near, far, 1.4f, 0.476f, new Color(0.02f, 0f, 0.03f, 1f), true); for (int i = 0; i < fin.Length; i++) { RuntimeSlashVisual obj = fin[i]; if (obj != null) { obj.HoldFor(0.34f); } } } private void PlaceFin(float lift, float widthScale) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (fin == null) { return; } GroundLine(out var near, out var far); Vector3 val = near + Vector3.up * lift; Vector3 val2 = far + Vector3.up * lift; for (int i = 0; i < fin.Length; i++) { if (Object.op_Implicit((Object)(object)fin[i])) { fin[i].SetEnds(val, val2); fin[i].SetWidthScale(widthScale); } } } internal static void LandCut(CharacterBody body, Vector3 near, Vector3 far, float unusedSize, bool blackFlash) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0083: 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_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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) HashSet hashSet = new HashSet(); float num = body.damage * 20f * (blackFlash ? BlackFlash.Multiplier : 1f); bool flag = Util.CheckRoll(body.crit, body.master) || blackFlash; Vector3 val = far - near; Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = body.transform.forward; } Vector3 val3 = val2 * 2200f + Vector3.up * 600f; TeamIndex val4 = (TeamIndex)((!Object.op_Implicit((Object)(object)body.teamComponent)) ? 1 : ((int)body.teamComponent.teamIndex)); for (int i = 0; i < 2; i++) { float num2 = ((i == 0) ? 3.4f : (Mathf.Max(14f, 2.5f) - 3.4f)); JujutsuDamageUtility.FireCapsule(((Component)body).gameObject, val4, near + Vector3.up * num2, far + Vector3.up * num2, 3.4f, num, val3, flag, 1f, DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)1024), hashSet); } } private void Cut() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) GroundLine(out var near, out var far); JujutsuSfxAssets.PlayMeleeHeavy((near + far) * 0.5f); JujutsuFxShake.Detonation(near, 14f); if (((EntityState)this).isAuthority) { float num = default(float); bool flag = BlackFlash.TryProc((near + far) * 0.5f, ref num); JujutsuHitSync.Request(((EntityState)this).characterBody, "sukuna-world-cut", near, far, 0f, flag); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace GojoSatoruMod.Content { internal static class SukunaAssets { private enum IconPattern { Eyes, Fist, Kick, Slash, Cross, Flame, Shrine } private static float nextVoiceAllowedTime = -1000f; internal static readonly Color Crimson = new Color(0.86f, 0.035f, 0.08f, 1f); internal static readonly Color Slash = new Color(1f, 0.12f, 0.18f, 1f); internal static readonly Color Fire = new Color(1f, 0.28f, 0.025f, 1f); internal static readonly Color Water = new Color(0.42f, 0.78f, 1f, 1f); internal static readonly Color WaterEdge = new Color(0.16f, 0.44f, 0.86f, 1f); internal static readonly Color Curse = new Color(0.18f, 0.005f, 0.025f, 1f); private const float FugaLaughChance = 0.3f; internal static Sprite PassiveIcon { get; private set; } internal static Sprite FistIcon { get; private set; } internal static Sprite KickIcon { get; private set; } internal static Sprite DismantleIcon { get; private set; } internal static Sprite CleaveIcon { get; private set; } internal static Sprite WorldCutIcon { get; private set; } internal static Sprite WaterBeamIcon { get; private set; } internal static Sprite ReverseCursedIcon { get; private set; } internal static Sprite BladeWallIcon { get; private set; } internal static Sprite FugaIcon { get; private set; } internal static Sprite ShrineIcon { get; private set; } internal static Texture2D Portrait { get; private set; } internal static DecodedAttackSound DomainTheme { get; private set; } internal static DecodedAttackSound DomainSound { get; private set; } internal static DecodedAttackSound FugaSound { get; private set; } internal static DecodedAttackSound WaterJetSound { get; private set; } internal static DecodedAttackSound LaughSound { get; private set; } internal static DecodedAttackSound Laugh2Sound { get; private set; } internal static DecodedAttackSound SpawnVoice { get; private set; } internal static DecodedAttackSound IdiotSound { get; private set; } internal static DecodedAttackSound HappySound { get; private set; } internal static DecodedAttackSound Voice3Sound { get; private set; } internal static DecodedAttackSound Voice7Sound { get; private set; } internal static DecodedAttackSound Voice8Sound { get; private set; } internal static DecodedAttackSound KnowYourPlaceSound { get; private set; } internal static Sprite StepIcon { get; private set; } internal static void Initialize() { PassiveIcon = GojoAssets.LoadIcon("sukuna-passive", (Func)(() => CreateIcon("texSukunaPassive", Curse, Crimson, IconPattern.Eyes))); FistIcon = GojoAssets.LoadIcon("sukuna-fist", (Func)(() => CreateIcon("texSukunaFist", Curse, new Color(1f, 0.54f, 0.58f), IconPattern.Fist))); KickIcon = GojoAssets.LoadIcon("sukuna-kick", (Func)(() => CreateIcon("texSukunaKick", new Color(0.06f, 0.002f, 0.01f), new Color(1f, 0.25f, 0.2f), IconPattern.Kick))); StepIcon = GojoAssets.LoadIcon("sukuna-step", (Func)(() => CreateIcon("texSukunaStep", Curse, Slash, IconPattern.Slash))); DismantleIcon = GojoAssets.LoadIcon("sukuna-dismantle", (Func)(() => CreateIcon("texSukunaDismantle", Curse, Slash, IconPattern.Slash))); WorldCutIcon = GojoAssets.LoadIcon("sukuna-worldcut", (Func)(() => CreateIcon("texSukunaWorldCut", Curse, Slash, IconPattern.Slash))); CleaveIcon = GojoAssets.LoadIcon("sukuna-cleave", (Func)(() => CreateIcon("texSukunaCleave", new Color(0.04f, 0.005f, 0.01f), new Color(1f, 0.34f, 0.22f), IconPattern.Cross))); WaterBeamIcon = GojoAssets.LoadIcon("sukuna-waterbeam", (Func)(() => CreateIcon("texSukunaWaterBeam", new Color(0.01f, 0.03f, 0.06f), Water, IconPattern.Slash))); BladeWallIcon = GojoAssets.LoadIcon("sukuna-bladewall", (Func)(() => CreateIcon("texSukunaBladeWall", new Color(0.05f, 0.005f, 0.01f), Slash, IconPattern.Cross))); ReverseCursedIcon = GojoAssets.LoadIcon("sukuna-reverse", (Func)(() => CreateIcon("texSukunaReverseCursed", new Color(0.05f, 0.01f, 0.01f), new Color(1f, 0.72f, 0.45f), IconPattern.Eyes))); FugaIcon = GojoAssets.LoadIcon("sukuna-fuga", (Func)(() => CreateIcon("texSukunaFuga", new Color(0.2f, 0.005f, 0f), Fire, IconPattern.Flame))); ShrineIcon = GojoAssets.LoadIcon("sukuna-shrine", (Func)(() => CreateIcon("texSukunaShrine", Color.black, Crimson, IconPattern.Shrine))); Portrait = GojoAssets.LoadPersistentTexture("ui/sukuna-portrait.png", "texSukunaPortrait") ?? CreatePortrait(); GojoAssets.PreparePersistentTexture(Portrait); } internal static IEnumerator LoadAttackSounds() { DomainSound = GojoAssets.LoadSound("sukuna-domain-open.mp3", 0.65f, "Sukuna", 0f); yield return null; DomainTheme = GojoAssets.LoadSound("sukuna-domain-theme.mp3", 1f, "Sukuna", 90f); yield return null; FugaSound = GojoAssets.LoadSound("sukuna-huga.mp3", 0.1f, "Sukuna", 0f); yield return null; WaterJetSound = GojoAssets.MakeLoopable(GojoAssets.LoadSound("sfx/water-jet.mp3", 1f, "Sukuna", 2f), 0.55f, 1.1f, 0.14f); yield return null; LaughSound = GojoAssets.LoadSound("sukuna-laugh.mp3", 0.25f, "Sukuna", 0f); yield return null; Laugh2Sound = GojoAssets.LoadSound("sukuna-laugh2.mp3", 0.25f, "Sukuna", 0f); yield return null; SpawnVoice = GojoAssets.LoadSound("ganbare-ganbare.mp3", 0.7f, "Sukuna", 0f); yield return null; IdiotSound = GojoAssets.LoadSound("idiot.mp3", 0.55f, "Sukuna", 0f); yield return null; HappySound = GojoAssets.LoadSound("you-look-happy.mp3", 0.55f, "Sukuna", 0f); yield return null; KnowYourPlaceSound = GojoAssets.LoadSound("know-your-place-fool.mp3", 0.55f, "Sukuna", 0f); yield return null; Voice3Sound = GojoAssets.LoadSound("sukuna-voice3.mp3", 0.55f, "Sukuna", 0f); yield return null; Voice7Sound = GojoAssets.LoadSound("sukuna-voice7.mp3", 0.55f, "Sukuna", 0f); yield return null; Voice8Sound = GojoAssets.LoadSound("sukuna-voice8.mp3", 0.55f, "Sukuna", 0f); } internal static void PlayFuga(Vector3 position) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) DecodedAttackSound val = FugaSound; if (Random.value < 0.3f) { DecodedAttackSound val2 = GojoAssets.PickVoice((DecodedAttackSound[])(object)new DecodedAttackSound[2] { LaughSound, Laugh2Sound }); if (val2 != null) { val = val2; } } GojoAssets.PlayAttackSound(val, position, 1f, 0f, "Sukuna", true); nextVoiceAllowedTime = Time.realtimeSinceStartup + ((val != null) ? (val.Duration + 1f) : 3f); } internal static void PlayLaugh(Vector3 position) { //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_0023: Unknown result type (might be due to invalid IL or missing references) DecodedAttackSound val = GojoAssets.PickVoice((DecodedAttackSound[])(object)new DecodedAttackSound[2] { LaughSound, Laugh2Sound }); if (val != null) { GojoAssets.PlayAttackSound(val, position, 1f, 0f, "Sukuna", true); nextVoiceAllowedTime = Time.realtimeSinceStartup + val.Duration + 0.5f; } } internal static void PlayDomain(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) GojoAssets.PlayAttackSound(DomainSound, position, 1f, 0f, "Sukuna", false); nextVoiceAllowedTime = Time.realtimeSinceStartup + ((DomainSound != null) ? (DomainSound.Duration + 1f) : 3f); } internal static void TryPlayVoice(Vector3 position, float chance, params DecodedAttackSound[] candidates) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (candidates != null && candidates.Length != 0 && !(Time.realtimeSinceStartup < nextVoiceAllowedTime) && !(Random.value > Mathf.Clamp01(chance))) { DecodedAttackSound val = GojoAssets.PickVoice(candidates); if (val != null) { GojoAssets.PlayAttackSound(val, position, 1f, 0f, "Sukuna", true); nextVoiceAllowedTime = Time.realtimeSinceStartup + 25f; } } } private static Sprite CreateIcon(string name, Color background, Color foreground, IconPattern pattern) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00c3: 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_01af: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: 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_030e: 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_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) 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]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(63.5f, 63.5f); Vector2 val5 = default(Vector2); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { Vector2 val3 = (new Vector2((float)j, (float)i) - val2) / 64f; float magnitude = ((Vector2)(ref val3)).magnitude; float num = Mathf.Atan2(val3.y, val3.x); float num2 = 0f; Vector2 val4; switch (pattern) { case IconPattern.Fist: { val4 = new Vector2(val3.x / 0.42f, (val3.y + 0.19f) / 0.36f); float num14 = 1f - ((Vector2)(ref val4)).magnitude; float num15 = 0f; for (int k = 0; k < 4; k++) { float num16 = -0.34f + (float)k * 0.22f; float num17 = num15; val4 = new Vector2((val3.x - num16) / 0.14f, (val3.y - 0.22f) / 0.24f); num15 = Mathf.Max(num17, 1f - ((Vector2)(ref val4)).magnitude); } val4 = new Vector2((val3.x + 0.42f) / 0.2f, (val3.y + 0.03f) / 0.25f); float num18 = 1f - ((Vector2)(ref val4)).magnitude; num2 = Mathf.Clamp01(Mathf.Max(num14, Mathf.Max(num15, num18)) * 7f); break; } case IconPattern.Kick: { ((Vector2)(ref val5))..ctor(val3.x * 0.72f + val3.y * 0.69f, (0f - val3.x) * 0.69f + val3.y * 0.72f); val4 = new Vector2((val5.x + 0.08f) / 0.2f, (val5.y - 0.05f) / 0.62f); float num12 = 1f - ((Vector2)(ref val4)).magnitude; val4 = new Vector2((val5.x - 0.22f) / 0.4f, (val5.y + 0.48f) / 0.18f); float num13 = 1f - ((Vector2)(ref val4)).magnitude; num2 = Mathf.Clamp01(Mathf.Max(num12, num13) * 7f); break; } case IconPattern.Slash: num2 = Stripe(val3, 0.78f, 0.13f); num2 = Mathf.Max(num2, Stripe(new Vector2(val3.x, val3.y + 0.28f), 0.78f, 0.045f) * 0.65f); break; case IconPattern.Cross: num2 = Mathf.Max(Stripe(val3, 0.72f, 0.1f), Stripe(new Vector2(0f - val3.x, val3.y), 0.72f, 0.1f)); break; case IconPattern.Flame: { val4 = new Vector2(val3.x / (0.42f + (val3.y + 0.6f) * 0.12f), (val3.y + 0.05f) / 0.72f); float num10 = 1f - ((Vector2)(ref val4)).magnitude; float num11 = Mathf.Sin(num * 5f - magnitude * 9f) * 0.1f; num2 = Mathf.Clamp01((num10 + num11) * 7f); break; } case IconPattern.Shrine: { float num7 = Mathf.Clamp01(1f - Mathf.Abs(magnitude - 0.61f) * 18f); float num8 = Mathf.Pow(Mathf.Abs(Mathf.Sin(num * 4f)), 16f) * Mathf.Clamp01(1f - magnitude); float num9 = Mathf.Clamp01(1f - Mathf.Abs(val3.y + 0.18f) * 18f) * Mathf.Clamp01(0.72f - Mathf.Abs(val3.x)); num2 = Mathf.Max(num7, Mathf.Max(num8, num9)); break; } default: { val4 = new Vector2((val3.x + 0.32f) / 0.25f, (val3.y - 0.08f) / 0.11f); float num3 = 1f - ((Vector2)(ref val4)).magnitude; val4 = new Vector2((val3.x - 0.32f) / 0.25f, (val3.y - 0.08f) / 0.11f); float num4 = 1f - ((Vector2)(ref val4)).magnitude; val4 = new Vector2((val3.x + 0.23f) / 0.18f, (val3.y + 0.27f) / 0.08f); float num5 = 1f - ((Vector2)(ref val4)).magnitude; val4 = new Vector2((val3.x - 0.23f) / 0.18f, (val3.y + 0.27f) / 0.08f); float num6 = Mathf.Max(num5, 1f - ((Vector2)(ref val4)).magnitude); num2 = Mathf.Clamp01(Mathf.Max(Mathf.Max(num3, num4), num6) * 8f); break; } } float num19 = Mathf.Clamp01((1.08f - magnitude) * 6f); Color val6 = Color.Lerp(background, foreground, num2); val6 *= Mathf.Lerp(0.45f, 1f, num19); val6.a = num19; array[i * 128 + j] = val6; } } val.SetPixels(array); val.Apply(false, true); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 100f); GojoAssets.PreparePersistentSprite(obj); return obj; } private static float Stripe(Vector2 point, float slope, float width) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(point.y - point.x * slope); float num2 = Mathf.Clamp01(1f - Mathf.Abs(point.x) * 0.9f); return Mathf.Clamp01(1f - num / width) * num2; } private static Texture2D CreatePortrait() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(256, 256, (TextureFormat)4, false); ((Object)val).name = "texSukunaPortrait"; Color[] array = (Color[])(object)new Color[65536]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(128f, 135.68f); for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { Vector2 val3 = (new Vector2((float)j, (float)i) - val2) / 256f; float num = Mathf.Clamp01(1.1f - ((Vector2)(ref val3)).magnitude * 2.05f); Vector2 val4 = new Vector2(val3.x / 0.19f, val3.y / 0.28f); float num2 = Mathf.Clamp01(1f - ((Vector2)(ref val4)).magnitude); float num3 = Mathf.Clamp01(num2 * (val3.y + 0.08f) * 10f); float num4 = num2 * Mathf.Clamp01(1f - Mathf.Min(Mathf.Abs(val3.y - val3.x * 0.5f - 0.01f), Mathf.Abs(val3.y + val3.x * 0.5f - 0.01f)) * 75f); float num5 = num2 * Mathf.Clamp01(1f - Mathf.Abs(val3.y - 0.015f) * 48f); Color val5 = Color.Lerp(new Color(0.025f, 0.001f, 0.006f), new Color(0.27f, 0.008f, 0.025f), num); val5 = Color.Lerp(val5, new Color(0.95f, 0.42f, 0.48f), num2 * 0.88f); val5 = Color.Lerp(val5, new Color(0.82f, 0.16f, 0.22f), num3); val5 = Color.Lerp(val5, Color.black, Mathf.Max(num4, num5 * 0.65f)); val5.a = 1f; array[i * 256 + j] = val5; } } val.SetPixels(array); val.Apply(false, true); GojoAssets.PreparePersistentTexture(val); return val; } } internal static class SukunaLanguage { internal const string Prefix = "CODEX_SUKUNA_"; internal static void Register() { AddText(); LogResolvedNumbers(); } private static void AddText() { LanguageAPI.Add("CODEX_SUKUNA_NAME", "Ryomen Sukuna"); LanguageAPI.Add("CODEX_SUKUNA_SKIN_DEFAULT_NAME", "Incarnated"); LanguageAPI.Add("CODEX_SUKUNA_SKIN_SHIRTLESS_NAME", "King Unbound"); LanguageAPI.Add("CODEX_SUKUNA_SKIN_KIMONO_NAME", "Heian Kimono"); LanguageAPI.Add("CODEX_SUKUNA_SKIN_SHINJUKU_NAME", "Shinjuku Showdown"); LanguageAPI.Add("CODEX_SUKUNA_SKIN_SENDAI_NAME", "Sendai Colony"); LanguageAPI.Add("CODEX_SUKUNA_SUBTITLE", "The King of Curses"); LanguageAPI.Add("CODEX_SUKUNA_DESCRIPTION", "Sukuna tears the battlefield apart with invisible slashes. Use Cleave on wounded groups, incinerate survivors with Fuga, then open Malevolent Shrine."); LanguageAPI.Add("CODEX_SUKUNA_OUTRO_FLAVOR", "..and so the King of Curses found another age to conquer."); LanguageAPI.Add("CODEX_SUKUNA_OUTRO_FAILURE", "..and so even the King was cut down."); LanguageAPI.Add("CODEX_SUKUNA_PASSIVE_NAME", "King of Curses"); LanguageAPI.Add("CODEX_SUKUNA_PASSIVE_DESCRIPTION", "Gain " + StatText.Healing(StatText.Number(30f) + " armor") + ". Killing an enemy " + StatText.Healing("restores " + StatText.Fraction(0.05f) + " maximum health") + " and " + StatText.Utility(StatText.Number(18f) + " Cursed Energy") + ". Cursed Energy slowly regenerates; a landed swing restores " + StatText.Utility(StatText.Number(SukunaJabState.RestorePerHit)) + " and the finisher " + StatText.Utility(StatText.Number(SukunaJabState.RestorePerFinisher)) + "."); LanguageAPI.Add("CODEX_SUKUNA_JAB_NAME", "Demonic Rush"); LanguageAPI.Add("CODEX_SUKUNA_JAB_DESCRIPTION", "Tear through a four-hit combo for " + StatText.Damage(StatText.Percent(2.5f) + ", " + StatText.Percent(2.8f) + ", " + StatText.Percent(3.3f) + " and " + StatText.Percent(5.8f) + " damage") + ". Heavy and slow rather than quick: the last swing hits wider, throws what it hits and " + StatText.Damage("causes bleeding") + ". A hit restores " + StatText.Utility(StatText.Number(SukunaJabState.RestorePerHit) + " Cursed Energy") + ", the finisher " + StatText.Utility(StatText.Number(SukunaJabState.RestorePerFinisher)) + "."); LanguageAPI.Add("CODEX_SUKUNA_KICK_NAME", "King's Roundhouse"); LanguageAPI.Add("CODEX_SUKUNA_KICK_DESCRIPTION", "Spin through nearby enemies for " + StatText.Damage(StatText.Percent(8.5f) + " damage") + ", knocking them away. The kick lunges a short distance forward. A successful kick restores " + StatText.Utility(StatText.Number(12f) + " Cursed Energy") + "."); LanguageAPI.Add("CODEX_SUKUNA_RCT_NAME", "Instant Step"); LanguageAPI.Add("CODEX_SUKUNA_RCT_DESCRIPTION", "Aim at an enemy within " + StatText.Metres(30f) + " and " + StatText.Utility("step behind them instantly") + ", then open " + StatText.Damage("their back") + " with a single cut for " + StatText.Damage(StatText.Percent(15f) + " damage") + ", carrying you on in the direction you were already going. Without a target it is a " + StatText.Utility(StatText.Metres(26.039999f) + " dash") + " that keeps its speed. Costs " + StatText.Number(8f) + " Cursed Energy. " + StatText.Seconds(5f) + " second cooldown."); LanguageAPI.Add("CODEX_SUKUNA_REVERSE_NAME", "Reverse Cursed Technique"); LanguageAPI.Add("CODEX_SUKUNA_REVERSE_DESCRIPTION", "Plant and close what has been opened on you, healing " + StatText.Healing(StatText.Fraction(0.4f) + " of your maximum health") + " over " + StatText.Number(1.05f) + " seconds. The healing arrives as it goes rather than at the end, so being cut short costs only what is left. " + StatText.Utility("Roots you") + " for the whole of it. Costs " + StatText.Number(22f) + " Cursed Energy. " + StatText.Seconds(5f) + " second cooldown."); LanguageAPI.Add("CODEX_SUKUNA_DISMANTLE_NAME", "Dismantle"); LanguageAPI.Add("CODEX_SUKUNA_DISMANTLE_DESCRIPTION", "Store " + StatText.Number(6f) + " blades at level 1, gaining one additional blade every " + StatText.Number(1f) + " level. Tap Mouse4 to release one piercing " + StatText.Damage(StatText.Percent(1f) + " damage") + " slash, or hold it to rapidly empty the magazine. Each blade uses a random cutting plane and recharges in " + StatText.Number(1.44f) + " seconds after firing. Costs " + StatText.Number(3f) + " Cursed Energy per blade."); LanguageAPI.Add("CODEX_SUKUNA_WATERBEAM_NAME", "Torrent"); LanguageAPI.Add("CODEX_SUKUNA_WATERBEAM_DESCRIPTION", "Compress water to a point and " + StatText.Utility("hold") + " it open as a line, " + StatText.Damage("piercing everything") + " within " + StatText.Utility(StatText.Metres(55f)) + " for " + StatText.Damage(StatText.Percent(1.6f) + " damage") + " every " + StatText.Number(0.1f) + " of a second, which is " + StatText.Damage(StatText.Percent(16f) + " a second") + ". Sweeps with your aim. Covers no ground and forgives no aim, and hits the whole file rather than the one at the front. " + StatText.Sub("Limited by its own " + StatText.Utility("pressure gauge") + ", shown under the icon: about " + StatText.Number(3.030303f) + " seconds of held beam, and " + StatText.Number(6.25f) + " to fill again. It fills on its own and cannot be earned back by killing, which is what stops the beam being held forever.")); LanguageAPI.Add("CODEX_SUKUNA_CLEAVE_NAME", "Cleave"); LanguageAPI.Add("CODEX_SUKUNA_CLEAVE_DESCRIPTION", "Cross-cut a targeted area of " + StatText.Utility(StatText.Metres(7f)) + " for " + StatText.Damage(StatText.Percent(7.5f) + " damage") + ". Damage increases against wounded enemies. Costs " + StatText.Number(22f) + " Cursed Energy. " + StatText.Seconds(5f) + " second cooldown. Bound to Mouse5."); LanguageAPI.Add("CODEX_SUKUNA_WORLDCUT_NAME", "Grand Dismantle"); LanguageAPI.Add("CODEX_SUKUNA_WORLDCUT_DESCRIPTION", "Drop one enormous blade along the ground ahead of you, tall at your feet and tapering away over " + StatText.Utility(StatText.Metres(90f)) + ", opening everything under its length for " + StatText.Damage(StatText.Percent(20f) + " damage") + " and " + StatText.Damage("leaving it bleeding") + ". The wind-up is long and it costs " + StatText.Health(StatText.Number(45f) + " cursed energy") + ", so it is a decision rather than a reflex. " + StatText.Seconds(11f) + " second cooldown. " + StatText.Sub("The other shape this key can take is Cleave, which is a sphere around one target instead of a blade through everything in front of you.")); LanguageAPI.Add("CODEX_SUKUNA_FUGA_NAME", "Fuga — Open"); LanguageAPI.Add("CODEX_SUKUNA_FUGA_DESCRIPTION", StatText.Utility("Press R.") + " Launch a fire arrow that explodes across " + StatText.Metres(26f) + " for " + StatText.Damage(StatText.Percent(40f) + " damage") + ", leaving survivors " + StatText.Damage("burning for " + StatText.Number(16f) + " seconds") + ". Costs " + StatText.Number(70f) + " Cursed Energy. " + StatText.Seconds(20f) + " second cooldown."); LanguageAPI.Add("CODEX_SUKUNA_BLADEWALL_NAME", "World Splitting Dismantle"); LanguageAPI.Add("CODEX_SUKUNA_BLADEWALL_DESCRIPTION", "Cut the world itself. A lattice of slashes stands across everything in front of you and keeps coming: a " + StatText.Utility(StatText.Metres(42f) + " wide, " + StatText.Metres(24f) + " tall") + " wall dealing " + StatText.Damage(StatText.Percent(62f) + " damage") + " and " + StatText.Damage("leaving them bleeding") + ". Nothing to aim and nothing to travel — it is simply there. Roots you through the wind-up. Costs " + StatText.Number(70f) + " Cursed Energy. " + StatText.Seconds(20f) + " second cooldown."); LanguageAPI.Add("CODEX_SUKUNA_SHRINE_NAME", "Domain Expansion: Malevolent Shrine"); LanguageAPI.Add("CODEX_SUKUNA_SHRINE_DESCRIPTION", StatText.Utility("Press T, on the ground or in the air.") + " Remain completely stationary during the cast, then open a barrierless domain for " + StatText.Number(12f) + " seconds. Enemies within " + StatText.Metres(35f) + " are struck by guaranteed slashes every " + StatText.Number(0.08f) + " seconds. " + StatText.Utility("Costs " + StatText.Fraction(JujutsuConfig.DomainEnergyFraction.Value) + " of maximum Cursed Energy.") + " " + StatText.Damage(StatText.Seconds(50f) + " second cooldown.")); } private static void LogResolvedNumbers() { Plugin.Log.LogInfo((object)"Sukuna skill text assembled from live values:"); Plugin.Log.LogInfo((object)(" passive : armour " + StatText.Number(30f) + ", kill heals " + StatText.Fraction(0.05f) + " and +" + StatText.Number(18f) + " energy, swing +" + StatText.Number(SukunaJabState.RestorePerHit) + ", finisher +" + StatText.Number(SukunaJabState.RestorePerFinisher))); Plugin.Log.LogInfo((object)(" jab : " + StatText.Percent(2.5f) + " / " + StatText.Percent(2.8f) + " / " + StatText.Percent(3.3f) + " / " + StatText.Percent(5.8f))); Plugin.Log.LogInfo((object)(" kick : " + StatText.Percent(8.5f) + ", restores " + StatText.Number(12f) + ", cooldown " + StatText.Seconds(2f) + "s")); Plugin.Log.LogInfo((object)(" step : one cut of " + StatText.Percent(15f) + ", range " + StatText.Metres(30f) + ", blind dash " + StatText.Metres(26.039999f) + ", cost " + StatText.Number(8f) + ", cooldown " + StatText.Seconds(5f) + "s")); Plugin.Log.LogInfo((object)(" heal : " + StatText.Fraction(0.4f) + " over " + StatText.Number(1.05f) + "s, cost " + StatText.Number(22f) + ", cooldown " + StatText.Seconds(5f) + "s")); Plugin.Log.LogInfo((object)(" slash : " + StatText.Percent(1f) + " per blade, " + StatText.Number(6f) + " stored, " + StatText.Number(1.44f) + "s each, cost " + StatText.Number(3f))); Plugin.Log.LogInfo((object)(" torrent : " + StatText.Percent(1.6f) + " every " + StatText.Number(0.1f) + "s = " + StatText.Percent(16f) + "/s, reach " + StatText.Metres(55f) + ", gauge " + StatText.Number(3.030303f) + "s drain / " + StatText.Number(6.25f) + "s refill")); Plugin.Log.LogInfo((object)(" cleave : " + StatText.Percent(7.5f) + " across " + StatText.Metres(7f) + ", cost " + StatText.Number(22f) + ", cooldown " + StatText.Seconds(5f) + "s")); Plugin.Log.LogInfo((object)(" worldcut: " + StatText.Percent(20f) + " over " + StatText.Metres(90f) + ", cost " + StatText.Number(45f) + ", cooldown " + StatText.Seconds(11f) + "s")); Plugin.Log.LogInfo((object)(" fuga : " + StatText.Percent(40f) + " across " + StatText.Metres(26f) + ", burn " + StatText.Number(16f) + "s, cost " + StatText.Number(70f) + ", cooldown " + StatText.Seconds(20f) + "s")); Plugin.Log.LogInfo((object)(" wall : " + StatText.Percent(62f) + ", " + StatText.Metres(42f) + " wide x " + StatText.Metres(24f) + " tall, cost " + StatText.Number(70f) + ", cooldown " + StatText.Seconds(20f) + "s")); Plugin.Log.LogInfo((object)(" shrine : " + StatText.Metres(35f) + " for " + StatText.Number(12f) + "s, slash every " + StatText.Number(0.08f) + "s, cost " + StatText.Fraction(JujutsuConfig.DomainEnergyFraction.Value) + " of pool, cooldown " + StatText.Seconds(50f) + "s")); } } internal static class SukunaSurvivor { internal static class Cooldowns { internal const float Jab = 0f; internal const float Kick = 2f; internal const float InstantStep = 5f; internal const float ReverseCursed = 5f; internal const float Fuga = 20f; internal const float BladeWall = 20f; internal const float Dismantle = 0f; internal const float Torrent = 5f; internal const float Cleave = 5f; internal const float WorldCut = 11f; internal const float Shrine = 50f; } internal const string BodyName = "RyomenSukunaBody"; internal const string MasterName = "RyomenSukunaMonsterMaster"; internal const float ReverseCursedEnergyCost = 22f; internal const float BaseArmor = 30f; internal static GameObject BodyPrefab { get; private set; } internal static GameObject MasterPrefab { get; private set; } internal static SurvivorDef SurvivorDef { get; private set; } internal static void Initialize() { CreateBody(); CreateSkills(); CreateMaster(); CreateSurvivorDef(); RegisterStates(); } private static void CreateBody() { //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) GameObject obj = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/MercBody"); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("Could not load MercBody; Sukuna cannot be initialized."); } BodyPrefab = PrefabAPI.InstantiateClone(obj, "RyomenSukunaBody"); CharacterBody component = BodyPrefab.GetComponent(); component.baseNameToken = "CODEX_SUKUNA_NAME"; component.subtitleNameToken = "CODEX_SUKUNA_SUBTITLE"; component.portraitIcon = (Texture)(object)SukunaAssets.Portrait; component.bodyColor = SukunaAssets.Crimson; component.baseMaxHealth = 155f; component.levelMaxHealth = 46f; component.baseRegen = 1.6f; component.levelRegen = 0.32f; component.baseDamage = 14f; component.levelDamage = 2.8f; component.baseArmor = 30f; component.baseCrit = 10f; component.baseMoveSpeed = 7.3f; component.baseAcceleration = 85f; component.baseJumpPower = 15f; component.baseJumpCount = 1; BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); BodyPrefab.AddComponent(); if (!SukunaImportedModel.Apply(BodyPrefab)) { RecolorModel(BodyPrefab, display: false); } NoItemDisplaysController.Apply(BodyPrefab); PodlessSpawn.Apply(BodyPrefab); JujutsuCrosshairAim.Apply(BodyPrefab); BodyPrefab.AddComponent().UseSukunaVoice(); JujutsuContentPack.BodyPrefabs.Add(BodyPrefab); } private static void CreateSkills() { //IL_0033: 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_0067: 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(); component.passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "CODEX_SUKUNA_PASSIVE_NAME", skillDescriptionToken = "CODEX_SUKUNA_PASSIVE_DESCRIPTION", icon = SukunaAssets.PassiveIcon }; component.primary = CreateSkillSlot("Primary"); component.secondary = CreateSkillSlot("Secondary"); component.utility = CreateSkillSlot("Utility"); component.special = CreateSkillSlot("Special"); SkillDef val = CreateSkillDef("SukunaJab", "CODEX_SUKUNA_JAB_NAME", "CODEX_SUKUNA_JAB_DESCRIPTION", SukunaAssets.FistIcon, typeof(SukunaJabState), "Weapon", 0f, (InterruptPriority)1, combatSkill: true, mustKeyPress: false); val.beginSkillCooldownOnSkillEnd = false; val.mustKeyPress = false; AddSkill(component.primary.skillFamily, val); AddSkill(component.secondary.skillFamily, CreateSkillDef("SukunaKick", "CODEX_SUKUNA_KICK_NAME", "CODEX_SUKUNA_KICK_DESCRIPTION", SukunaAssets.KickIcon, typeof(SukunaKickState), "Weapon", 2f, (InterruptPriority)1, combatSkill: true, mustKeyPress: true)); AddSkill(component.utility.skillFamily, CreateSkillDef("SukunaShortTeleport", "CODEX_SUKUNA_RCT_NAME", "CODEX_SUKUNA_RCT_DESCRIPTION", SukunaAssets.StepIcon, typeof(SukunaReverseCursedTechniqueState), "Body", 5f, (InterruptPriority)1, combatSkill: false, mustKeyPress: true, 8f)); AddSkill(component.utility.skillFamily, CreateSkillDef("SukunaReverseCursed", "CODEX_SUKUNA_REVERSE_NAME", "CODEX_SUKUNA_REVERSE_DESCRIPTION", SukunaAssets.ReverseCursedIcon, typeof(SukunaReverseCursedHealState), "Body", 5f, (InterruptPriority)2, combatSkill: false, mustKeyPress: true, 22f)); AddSkill(component.special.skillFamily, CreateSkillDef("SukunaFuga", "CODEX_SUKUNA_FUGA_NAME", "CODEX_SUKUNA_FUGA_DESCRIPTION", SukunaAssets.FugaIcon, typeof(SukunaFugaState), "Weapon", 20f, (InterruptPriority)2, combatSkill: true, mustKeyPress: true, 70f)); AddSkill(component.special.skillFamily, CreateSkillDef("SukunaBladeWall", "CODEX_SUKUNA_BLADEWALL_NAME", "CODEX_SUKUNA_BLADEWALL_DESCRIPTION", SukunaAssets.BladeWallIcon, typeof(SukunaBladeWallState), "Weapon", 20f, (InterruptPriority)2, combatSkill: true, mustKeyPress: true, 70f)); GenericSkill val2 = CreateSkillSlot("SideDismantle"); GenericSkill val3 = CreateSkillSlot("SideCleave"); GenericSkill val4 = CreateSkillSlot("Domain"); val2.hideInCharacterSelect = true; val3.hideInCharacterSelect = true; val2.hideInLoadoutSelect = false; val3.hideInLoadoutSelect = false; val4.hideInCharacterSelect = true; val4.hideInLoadoutSelect = true; AddSkill(val2.skillFamily, CreateSkillDef("SukunaDismantle", "CODEX_SUKUNA_DISMANTLE_NAME", "CODEX_SUKUNA_DISMANTLE_DESCRIPTION", SukunaAssets.DismantleIcon, typeof(SukunaDismantleState), "Weapon", 0f, (InterruptPriority)1, combatSkill: true, mustKeyPress: false, 3f, bladeMagazine: true)); AddSkill(val2.skillFamily, CreateSkillDef("SukunaWaterBeam", "CODEX_SUKUNA_WATERBEAM_NAME", "CODEX_SUKUNA_WATERBEAM_DESCRIPTION", SukunaAssets.WaterBeamIcon, typeof(SukunaWaterBeamState), "Weapon", 5f, (InterruptPriority)1, combatSkill: true, mustKeyPress: true, 22f)); AddSkill(val3.skillFamily, CreateSkillDef("SukunaCleave", "CODEX_SUKUNA_CLEAVE_NAME", "CODEX_SUKUNA_CLEAVE_DESCRIPTION", SukunaAssets.CleaveIcon, typeof(SukunaCleaveState), "Weapon", 5f, (InterruptPriority)1, combatSkill: true, mustKeyPress: true, 22f)); AddSkill(val3.skillFamily, CreateSkillDef("SukunaWorldCut", "CODEX_SUKUNA_WORLDCUT_NAME", "CODEX_SUKUNA_WORLDCUT_DESCRIPTION", SukunaAssets.WorldCutIcon, typeof(SukunaWorldCutState), "Weapon", 11f, (InterruptPriority)2, combatSkill: true, mustKeyPress: true, 45f)); AddSkill(val4.skillFamily, CreateSkillDef("SukunaMalevolentShrine", "CODEX_SUKUNA_SHRINE_NAME", "CODEX_SUKUNA_SHRINE_DESCRIPTION", SukunaAssets.ShrineIcon, typeof(SukunaMalevolentShrineState), "Weapon", 50f, (InterruptPriority)2, combatSkill: true, mustKeyPress: true, 0f, bladeMagazine: false, groundedOnly: false, JujutsuConfig.DomainEnergyFraction.Value)); BodyPrefab.GetComponent().Configure(val2, val3, val4); JujutsuSkillNetworkFix.RegisterExtraSkills(BodyPrefab); } private static GenericSkill CreateSkillSlot(string slotName) { GenericSkill obj = BodyPrefab.AddComponent(); obj.skillName = slotName; SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = "RyomenSukunaBody" + slotName + "Family"; val.variants = Array.Empty(); obj._skillFamily = val; JujutsuContentPack.SkillFamilies.Add(val); return obj; } private static SkillDef CreateSkillDef(string name, string nameToken, string descriptionToken, Sprite icon, Type activationState, string stateMachine, float cooldown, InterruptPriority interruptPriority, bool combatSkill, bool mustKeyPress, float energyCost = 0f, bool bladeMagazine = false, bool groundedOnly = false, float energyCostFraction = 0f) { //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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) SkillDef val = (SkillDef)(bladeMagazine ? ScriptableObject.CreateInstance() : (groundedOnly ? ScriptableObject.CreateInstance() : ((energyCost > 0f || energyCostFraction > 0f) ? ((object)ScriptableObject.CreateInstance()) : ((object)ScriptableObject.CreateInstance())))); CursedEnergySkillDef val2 = (CursedEnergySkillDef)(object)((val is CursedEnergySkillDef) ? val : null); if (val2 != null) { val2.energyCost = energyCost; val2.energyCostFraction = energyCostFraction; } ((Object)val).name = name; val.skillName = name; val.skillNameToken = nameToken; val.skillDescriptionToken = descriptionToken; val.icon = icon; val.activationState = new SerializableEntityStateType(activationState); val.activationStateMachineName = stateMachine; val.interruptPriority = interruptPriority; val.baseRechargeInterval = cooldown; val.baseMaxStock = 1; val.rechargeStock = 1; val.requiredStock = 1; val.stockToConsume = 1; val.fullRestockOnAssign = true; val.resetCooldownTimerOnUse = false; val.beginSkillCooldownOnSkillEnd = combatSkill; val.canceledFromSprinting = false; val.cancelSprintingOnActivation = combatSkill; val.forceSprintDuringState = false; val.mustKeyPress = mustKeyPress; val.isCombatSkill = combatSkill; val.keywordTokens = Array.Empty(); JujutsuContentPack.SkillDefs.Add(val); return val; } private static void AddSkill(SkillFamily family, SkillDef skillDef) { //IL_0027: 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_0049: Expected O, but got Unknown //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) Array.Resize(ref family.variants, family.variants.Length + 1); Variant[] variants = family.variants; int num = family.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } private static void CreateMaster() { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterMasters/MercMonsterMaster"); if (!Object.op_Implicit((Object)(object)val)) { Plugin.Log.LogWarning((object)"MercMonsterMaster was not found; Sukuna doppelganger AI will be unavailable."); return; } MasterPrefab = PrefabAPI.InstantiateClone(val, "RyomenSukunaMonsterMaster"); MasterPrefab.GetComponent().bodyPrefab = BodyPrefab; JujutsuContentPack.MasterPrefabs.Add(MasterPrefab); } private static void CreateSurvivorDef() { //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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterDisplays/MercDisplay"); GameObject val2 = (Object.op_Implicit((Object)(object)val) ? PrefabAPI.InstantiateClone(val, "RyomenSukunaDisplay", false) : null); if (Object.op_Implicit((Object)(object)val2)) { if (!SukunaImportedModel.Apply(val2)) { RecolorModel(val2, display: true); } NoItemDisplaysController.Apply(val2); DisplaySoundSilencer.Apply(val2, "Sukuna"); } else { Plugin.Log.LogWarning((object)"MercDisplay was not found; Sukuna's character-select preview will be empty."); } SurvivorDef = ScriptableObject.CreateInstance(); ((Object)SurvivorDef).name = "sdRyomenSukuna"; SurvivorDef.cachedName = "RyomenSukuna"; SurvivorDef.bodyPrefab = BodyPrefab; SurvivorDef.displayPrefab = val2; SurvivorDef.primaryColor = SukunaAssets.Crimson; SurvivorDef.displayNameToken = "CODEX_SUKUNA_NAME"; SurvivorDef.descriptionToken = "CODEX_SUKUNA_DESCRIPTION"; SurvivorDef.outroFlavorToken = "CODEX_SUKUNA_OUTRO_FLAVOR"; SurvivorDef.mainEndingEscapeFailureFlavorToken = "CODEX_SUKUNA_OUTRO_FAILURE"; SurvivorDef.desiredSortPosition = 91f; JujutsuContentPack.SurvivorDefs.Add(SurvivorDef); JujutsuCharacter val3 = new JujutsuCharacter(); val3.Key = "Sukuna"; val3.BodyPrefix = "RyomenSukuna"; val3.MenuOrder = 2; val3.Hints = new string[4] { "Shift steps behind whatever you are aiming at - aimed at nothing it is a dash", "Mouse4 is Dismantle and costs almost nothing - use it to keep the bar filling", "T opens Malevolent Shrine", "Melee refills Cursed Energy; the last swing of the combo pays most" }; val3.Survivor = SurvivorDef; val3.SpawnLine = () => SukunaAssets.SpawnVoice; JujutsuCharacters.Register(val3); } private static void RegisterStates() { JujutsuContentPack.EntityStates.Add(typeof(SukunaReverseCursedTechniqueState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaJabState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaKickState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaDismantleState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaCleaveState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaWaterBeamState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaWorldCutState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaReverseCursedHealState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaBladeWallState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaFugaState)); JujutsuContentPack.EntityStates.Add(typeof(SukunaMalevolentShrineState)); } private static void RecolorModel(GameObject prefab, bool display) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) CharacterModel componentInChildren = prefab.GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)componentInChildren)) { return; } RendererInfo[] baseRendererInfos = componentInChildren.baseRendererInfos; for (int i = 0; i < baseRendererInfos.Length; i++) { Renderer renderer = baseRendererInfos[i].renderer; Material defaultMaterial = baseRendererInfos[i].defaultMaterial; if (!Object.op_Implicit((Object)(object)renderer) || !Object.op_Implicit((Object)(object)defaultMaterial)) { continue; } if (((Object)((Component)renderer).gameObject).name.ToLowerInvariant().Contains("sword")) { ((Component)renderer).gameObject.SetActive(false); continue; } Material val = Object.Instantiate(defaultMaterial); ((Object)val).name = "matSukunaRuntime" + i; Color val2 = (Color)((i % 3) switch { 0 => new Color(0.055f, 0.004f, 0.01f), 1 => new Color(0.28f, 0.012f, 0.028f), _ => new Color(0.76f, 0.2f, 0.24f), }); if (val.HasProperty("_Color")) { val.SetColor("_Color", val2); } if (val.HasProperty("_MainColor")) { val.SetColor("_MainColor", val2); } if (val.HasProperty("_EmColor")) { val.SetColor("_EmColor", SukunaAssets.Crimson * (display ? 1.8f : 1.1f)); } if (val.HasProperty("_EmissionColor")) { val.SetColor("_EmissionColor", SukunaAssets.Crimson * (display ? 1.6f : 0.9f)); val.EnableKeyword("_EMISSION"); } if (val.HasProperty("_EmPower")) { val.SetFloat("_EmPower", display ? 2.5f : 1.4f); } baseRendererInfos[i].defaultMaterial = val; } componentInChildren.baseRendererInfos = baseRendererInfos; componentInChildren.materialsDirty = true; componentInChildren.forceUpdate = true; } } } namespace GojoSatoruMod.Components { internal sealed class FugaArrowController : MonoBehaviour { internal const float ProjectileSpeed = 62f; internal const float ArrowGravity = 4.5f; private const float MaximumFlightTime = 30f; private const float ProjectileHitRadius = 1.6f; internal const float ExplosionRadius = 26f; internal const float BurnDuration = 16f; private const float BurnDamageMultiplier = 7f; private const float ScorchDuration = 9f; private const float ScorchBurnDuration = 4f; private const float ScorchBurnMultiplier = 2.2f; private const float TrailInterval = 0.055f; private GameObject attacker; private TeamIndex ownerTeam; private float damage; private bool crit; private Vector3 crossRight; private RuntimeOrbVisual arrowVisual; private RuntimeFugaProjectileVisual arrowFlames; private Vector3 position; private Vector3 velocity; private Vector3 direction; private float age; private float trailStopwatch; private bool exploded; internal static void Launch(GameObject attacker, TeamIndex ownerTeam, Vector3 position, Vector3 direction, float damage, bool crit, Vector3 crossRight, RuntimeOrbVisual arrowVisual, RuntimeFugaProjectileVisual arrowFlames) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SukunaFugaArrow"); val.transform.position = position; FugaArrowController fugaArrowController = val.AddComponent(); fugaArrowController.attacker = attacker; fugaArrowController.ownerTeam = ownerTeam; fugaArrowController.damage = damage; fugaArrowController.crit = crit; fugaArrowController.crossRight = crossRight; fugaArrowController.arrowVisual = arrowVisual; fugaArrowController.arrowFlames = arrowFlames; fugaArrowController.position = position; fugaArrowController.direction = ((Vector3)(ref direction)).normalized; fugaArrowController.velocity = fugaArrowController.direction * 62f; } private void FixedUpdate() { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_00c7: 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_00e1: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_015b: Unknown result type (might be due to invalid IL or missing references) if (exploded) { return; } age += Time.fixedDeltaTime; if (age >= 30f) { Explode(); return; } velocity += Vector3.down * (4.5f * Time.fixedDeltaTime); float num = ((Vector3)(ref velocity)).magnitude * Time.fixedDeltaTime; if (((Vector3)(ref velocity)).sqrMagnitude > 0.0001f) { direction = ((Vector3)(ref velocity)).normalized; arrowFlames?.SetDirection(direction); } Vector3 val = position + direction * num; RaycastHit val2 = default(RaycastHit); bool flag = Physics.Linecast(position, val, ref val2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); position = (flag ? ((RaycastHit)(ref val2)).point : val); Vector3 val3 = position; bool flag2 = !flag && JujutsuDamageUtility.TryFindFirstEnemyAlong(ownerTeam, position - direction * num, position, 1.6f, ref val3); if (flag2) { position = val3; } ((Component)this).transform.position = position; if (Object.op_Implicit((Object)(object)arrowVisual)) { arrowVisual.SetPosition(position); arrowVisual.TriggerPulse(0.06f); } if (flag || flag2) { Explode(); } } private void Update() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (!exploded) { trailStopwatch += Time.deltaTime; if (!(trailStopwatch < 0.055f)) { trailStopwatch -= 0.055f; Vector3 val = position - direction * 0.35f; SukunaVisuals.CreateSlash(val - direction * 4.8f, val, 0.48f, 0.22f, new Color(1f, 0.18f, 0.01f, 0.86f), true); } } } private void Explode() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) if (!exploded) { exploded = true; JujutsuDamageUtility.FireSphere(attacker, ownerTeam, position, 26f, damage, 3600f, 1200f, crit, 1f, DamageTypeCombo.GenericSpecial); JujutsuDamageUtility.IgniteSphere(attacker, ownerTeam, position, 26f, 16f, 7f); FugaScorchFieldController.Create(attacker, ownerTeam, FindGroundPoint(position), 19.5f, 9f, 4f, 2.2f); SukunaVisuals.CreateCross(position, crossRight, Vector3.up, 18.720001f, SukunaAssets.Fire); SukunaFugaVisuals.CreateFugaExplosion(position, FindGroundPoint(position), 26f); arrowFlames?.Stop(); arrowFlames = null; if (Object.op_Implicit((Object)(object)arrowVisual)) { arrowVisual.BurstAndDestroy(37.7f, 0.42f); arrowVisual = null; } JujutsuSfxAssets.PlayHeavyWhoosh(position, 0.88f); Util.PlaySound("Play_mage_m2_impact", ((Component)this).gameObject); JujutsuFxShake.Detonation(position, 26f); Object.Destroy((Object)(object)((Component)this).gameObject, 1.5f); } } private static Vector3 FindGroundPoint(Vector3 impactPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(impactPosition + Vector3.up * 4f, Vector3.down, ref val, 90f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return impactPosition; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)arrowVisual)) { Object.Destroy((Object)(object)((Component)arrowVisual).gameObject); arrowVisual = null; } arrowFlames = null; } } internal sealed class FugaScorchFieldController : MonoBehaviour { private const float IgniteInterval = 0.5f; private const float FlareInterval = 0.62f; private const int GroundSpokes = 16; private const int GroundRings = 4; private const int PlacementAttempts = 4; private GameObject attacker; private TeamIndex ownerTeam; private float radius; private float lifetime; private float burnDuration; private float burnMultiplier; private float age; private float igniteStopwatch; private float flareStopwatch; private JujutsuGroundField ground; internal static void Create(GameObject attacker, TeamIndex ownerTeam, Vector3 position, float radius, float lifetime, float burnDuration, float burnMultiplier) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown GameObject val = new GameObject("SukunaFugaScorch"); val.transform.position = position; FugaScorchFieldController fugaScorchFieldController = val.AddComponent(); fugaScorchFieldController.attacker = attacker; fugaScorchFieldController.ownerTeam = ownerTeam; fugaScorchFieldController.radius = Mathf.Max(1f, radius); fugaScorchFieldController.lifetime = Mathf.Max(0.5f, lifetime); fugaScorchFieldController.burnDuration = burnDuration; fugaScorchFieldController.burnMultiplier = burnMultiplier; fugaScorchFieldController.ground = JujutsuGroundField.Sample(position, fugaScorchFieldController.radius, 16, 4); Object.Destroy((Object)val, fugaScorchFieldController.lifetime + 2.5f); } private void FixedUpdate() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) age += Time.fixedDeltaTime; if (!(age >= lifetime)) { igniteStopwatch += Time.fixedDeltaTime; if (igniteStopwatch >= 0.5f && NetworkServer.active) { igniteStopwatch = 0f; JujutsuDamageUtility.IgniteSphere(attacker, ownerTeam, ((Component)this).transform.position, radius, burnDuration, burnMultiplier); } } } private void Update() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //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) if (age >= lifetime) { return; } flareStopwatch += Time.deltaTime; if (!(flareStopwatch < 0.62f)) { flareStopwatch = 0f; if (TryFindFlareSpot(out var groundSpot)) { SukunaFugaVisuals.CreateFugaExplosion(groundSpot + Vector3.up * 0.4f, groundSpot, radius * 0.3f, 1.7f, FugaExplosionDetail.Flare); } } } private bool TryFindFlareSpot(out Vector3 groundSpot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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) groundSpot = ((Component)this).transform.position; if (ground == null) { return false; } for (int i = 0; i < 4; i++) { Vector2 val = Random.insideUnitCircle * 0.72f; float num = ((Vector2)(ref val)).magnitude * radius; float num2 = Mathf.Atan2(val.y, val.x); if (!(ground.CoverageAt(num2, num) < 0.75f)) { groundSpot = ground.PointAt(num2, num, 0f); return true; } } return false; } } internal sealed class SukunaBladeMagazine : MonoBehaviour { internal const int BaseCapacity = 6; internal const int LevelsPerExtraBlade = 1; internal const float BaseRechargeInterval = 1.44f; private const float MinimumRechargeInterval = 0.2f; private const float RechargeLevelsToFloor = 24f; private CharacterBody body; private int cachedMaximum; private float rechargeStopwatch; private float RechargeInterval { get { float num = (Object.op_Implicit((Object)(object)body) ? Mathf.Max(0f, body.level - 1f) : 0f); return Mathf.Lerp(1.44f, 0.2f, Mathf.Clamp01(num / 24f)); } } internal int Current { get; private set; } internal int Sequence { get; private set; } internal int Maximum => CalculateMaximum(); internal float RechargeProgress { get { if (Current < Maximum) { return Mathf.Clamp01(rechargeStopwatch / RechargeInterval); } return 1f; } } internal float SecondsUntilNext { get { if (Current < Maximum) { return Mathf.Max(0f, RechargeInterval - rechargeStopwatch); } return 0f; } } private void Awake() { body = ((Component)this).GetComponent(); cachedMaximum = CalculateMaximum(); Current = cachedMaximum; } private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive || !Util.HasEffectiveAuthority(((Component)this).gameObject)) { return; } int num = CalculateMaximum(); if (num > cachedMaximum) { Current += num - cachedMaximum; } cachedMaximum = num; Current = Mathf.Clamp(Current, 0, cachedMaximum); if (Current >= cachedMaximum) { rechargeStopwatch = 0f; return; } rechargeStopwatch += Time.fixedDeltaTime; while (Current < cachedMaximum && rechargeStopwatch >= RechargeInterval) { rechargeStopwatch -= RechargeInterval; Current++; } } internal bool CanConsume() { return Current > 0; } internal bool TryConsume() { if (Current <= 0) { return false; } Current--; Sequence++; rechargeStopwatch = 0f; return true; } private int CalculateMaximum() { float num = (Object.op_Implicit((Object)(object)body) ? Mathf.Max(0f, body.level - 1f) : 0f); return 6 + Mathf.FloorToInt(num / 1f); } } public sealed class SukunaBladeSkillDef : CursedEnergySkillDef { public override bool CanExecute(GenericSkill skillSlot) { if (((CursedEnergySkillDef)this).CanExecute(skillSlot)) { return HasBlade(skillSlot); } return false; } public override bool IsReady(GenericSkill skillSlot) { if (((CursedEnergySkillDef)this).IsReady(skillSlot)) { return HasBlade(skillSlot); } return false; } public override void OnExecute(GenericSkill skillSlot) { SukunaBladeMagazine sukunaBladeMagazine = FindMagazine(skillSlot); if (Object.op_Implicit((Object)(object)sukunaBladeMagazine) && sukunaBladeMagazine.TryConsume()) { ((CursedEnergySkillDef)this).OnExecute(skillSlot); } } private static bool HasBlade(GenericSkill skillSlot) { SukunaBladeMagazine sukunaBladeMagazine = FindMagazine(skillSlot); if (Object.op_Implicit((Object)(object)sukunaBladeMagazine)) { return sukunaBladeMagazine.CanConsume(); } return false; } private static SukunaBladeMagazine FindMagazine(GenericSkill skillSlot) { if (!Object.op_Implicit((Object)(object)skillSlot) || !Object.op_Implicit((Object)(object)skillSlot.characterBody)) { return null; } return ((Component)skillSlot.characterBody).GetComponent(); } } internal sealed class SukunaBladeWallRider : MonoBehaviour { private const float WallHalfWidth = 21f; private const float WallHalfHeight = 12f; private const int WallRows = 7; private const float RowRadius = 3.3f; private const int Verticals = 9; private const int TotalLines = 16; private const float LatticeTilt = 45f; private const float AdvanceSpeed = 14f; private const float AdvanceDuration = 5f; private const float RedrawInterval = 0.18f; private GameObject attacker; private TeamIndex team; private float damage; private Vector3 direction; private Vector3 right; private Vector3 up; private Vector3 wallCentre; private HashSet victims; private bool crit; private float age; private float nextRedrawAt; internal static void Launch(GameObject attacker, TeamIndex team, float damage, Vector3 centre, Vector3 direction, Vector3 right, Vector3 up, HashSet victims, bool crit) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0064: Unknown result type (might be due to invalid IL or missing references) SukunaBladeWallRider sukunaBladeWallRider = new GameObject("SukunaBladeWallRider").AddComponent(); sukunaBladeWallRider.attacker = attacker; sukunaBladeWallRider.team = team; sukunaBladeWallRider.damage = damage; sukunaBladeWallRider.wallCentre = centre; sukunaBladeWallRider.direction = direction; sukunaBladeWallRider.right = right; Vector3 normalized; if (!(((Vector3)(ref up)).sqrMagnitude > 0.001f)) { Vector3 val = Vector3.Cross(direction, right); normalized = ((Vector3)(ref val)).normalized; } else { normalized = ((Vector3)(ref up)).normalized; } sukunaBladeWallRider.up = normalized; sukunaBladeWallRider.victims = victims ?? new HashSet(); sukunaBladeWallRider.crit = crit; } private void FixedUpdate() { //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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) age += Time.fixedDeltaTime; if (age > 5f || !Object.op_Implicit((Object)(object)attacker)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 val = wallCentre; wallCentre += direction * (14f * Time.fixedDeltaTime); SweepSlab(val, wallCentre); if (age >= nextRedrawAt) { nextRedrawAt = age + 0.18f; for (int i = 0; i < 16; i++) { DrawLine(i, 0.24300002f); } } } private void SweepSlab(Vector3 from, Vector3 to) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00b1: 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) for (int i = 0; i < 7; i++) { float num = (float)i / 6f; float num2 = Mathf.Lerp(-12f, 12f, num); Vector3 val = up * num2; JujutsuDamageUtility.FireCapsule(attacker, team, from + val - right * 21f, to + val + right * 21f, 3.3f, damage, -direction * 900f + Vector3.up * 420f, crit, 1f, DamageTypeCombo.GenericSpecial | DamageTypeCombo.op_Implicit((DamageType)1024), victims); } } private void DrawLine(int index, float lifetime) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00f2: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.AngleAxis(45f, direction); Vector3 val2 = val * right; Vector3 val3 = val * up; float num = Mathf.Sqrt(585f); if (index < 9) { if (index != 0 && index != 8) { float num2 = Mathf.Lerp(0f - num, num, (float)index / 8f); Vector3 val4 = wallCentre + val2 * num2; SukunaVisuals.CreateSlash(val4 - val3 * num, val4 + val3 * num, 0.55f, lifetime, SukunaAssets.Slash, true); } return; } int num3 = index - 9; if (num3 != 0 && num3 != 6) { float num4 = Mathf.Lerp(0f - num, num, (float)num3 / 6f); Vector3 val5 = wallCentre + val3 * num4; SukunaVisuals.CreateSlash(val5 - val2 * num, val5 + val2 * num, 0.55f, lifetime, (num3 % 2 == 0) ? SukunaVisuals.DarkSlash : SukunaVisuals.GreySlash, true); } } } internal sealed class SukunaPassiveController : MonoBehaviour { internal const float KillHealFraction = 0.05f; private CharacterBody body; private void Awake() { body = ((Component)this).GetComponent(); } private void OnEnable() { GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeath; } private void OnDisable() { GlobalEventManager.onCharacterDeathGlobal -= OnCharacterDeath; } private void OnCharacterDeath(DamageReport report) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body) && report != null && !((Object)(object)report.attackerBody != (Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { if (body.hasEffectiveAuthority) { SukunaAssets.TryPlayVoice(body.corePosition, 0.12f, SukunaAssets.HappySound, SukunaAssets.Voice3Sound); } if (NetworkServer.active) { body.healthComponent.HealFraction(0.05f, default(ProcChainMask)); } } } } internal sealed class SukunaShrineController : MonoBehaviour { internal const float Radius = 35f; internal const float Duration = 12f; internal const float TickInterval = 0.08f; private const float TickDamageCoefficient = 0.3f; private readonly HashSet cosmeticVictims = new HashSet(); private CharacterBody body; private RuntimeMalevolentShrineVisual visual; private Vector3 center; private float damageStat; private float remaining; private float tickStopwatch; private float ambientStopwatch; private float themeDelay; private bool themePending; private int slashSequence; internal bool IsActive => remaining > 0f; private void Awake() { body = ((Component)this).GetComponent(); } internal void Raise(Vector3 worldCenter, Vector3 facing) { //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_0034: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); } visual = SukunaShrineVisuals.CreateShrine(worldCenter, facing, 35f, 12f); JujutsuFxShake.Domain(worldCenter, 35f); } internal void CancelRaise() { if (!(remaining > 0f) && Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); visual = null; } } internal void Activate(Vector3 worldCenter, Vector3 facing, 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_0083: 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) center = worldCenter; damageStat = ownerDamageStat; remaining = 12f; tickStopwatch = 0.08f; ambientStopwatch = 0f; slashSequence = 0; DomainMusic.Open((object)this); themeDelay = 0f; themePending = true; if (!Object.op_Implicit((Object)(object)visual)) { visual = SukunaShrineVisuals.CreateShrine(center, facing, 35f, 12f); } visual.Seal(); JujutsuFxShake.Domain(center, 35f); } private void FixedUpdate() { //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_0113: Unknown result type (might be due to invalid IL or missing references) if (remaining <= 0f) { return; } remaining -= Time.fixedDeltaTime; tickStopwatch += Time.fixedDeltaTime; ambientStopwatch += Time.fixedDeltaTime; if (themePending) { themeDelay -= Time.fixedDeltaTime; if (themeDelay <= 0f) { themePending = false; DomainMusic.PlayTheme(SukunaAssets.DomainTheme, DomainMusic.ThemeVolume); } } if (ambientStopwatch >= 0.14f) { ambientStopwatch -= 0.14f; ShowAmbientSlashes(); } if (tickStopwatch >= 0.08f) { tickStopwatch -= 0.08f; slashSequence++; ShowGuaranteedSlashes(); if (NetworkServer.active) { JujutsuDamageUtility.FireSphere(((Component)this).gameObject, GetTeam(), center, 35f, damageStat * 0.3f, 0f, 0f, false, 0.12f, DamageTypeCombo.GenericSpecial); } } if (remaining <= 0f) { themePending = false; DomainMusic.Stop((object)this); if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); visual = null; } } } private void OnDisable() { themePending = false; remaining = 0f; DomainMusic.Stop((object)this); } private void ShowGuaranteedSlashes() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) cosmeticVictims.Clear(); Collider[] array = default(Collider[]); int num = GojoDamageUtility.OverlapEnemiesNonAlloc(center, 35f, ref array); TeamIndex team = GetTeam(); int num2 = 0; for (int i = 0; i < num; i++) { if (num2 >= 8) { break; } HurtBox val = (Object.op_Implicit((Object)(object)array[i]) ? ((Component)array[i]).GetComponent() : null); HealthComponent val2 = (Object.op_Implicit((Object)(object)val) ? val.healthComponent : null); CharacterBody val3 = (Object.op_Implicit((Object)(object)val2) ? val2.body : null); if (Object.op_Implicit((Object)(object)val2) && val2.alive && Object.op_Implicit((Object)(object)val3) && !cosmeticVictims.Contains(val2) && (!Object.op_Implicit((Object)(object)val3.teamComponent) || val3.teamComponent.teamIndex != team)) { cosmeticVictims.Add(val2); num2++; float num3 = ((float)slashSequence * 47f + (float)num2 * 83f) * (MathF.PI / 180f); Vector3 val4 = new Vector3(Mathf.Cos(num3), Mathf.Sin(num3 * 1.73f) * 0.65f, Mathf.Sin(num3)); Vector3 val5 = ((Vector3)(ref val4)).normalized; if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = Vector3.right; } float num4 = Mathf.Clamp(val3.radius * 5.5f, 4.5f, 11f); Vector3 val6 = val3.corePosition + val5 * (float)(num2 % 3 - 1) * 0.12f; SukunaVisuals.CreateSlash(val6 - val5 * num4 * 0.5f, val6 + val5 * num4 * 0.5f, 0.06f + (float)(num2 % 2) * 0.018f, 0.18f, (num2 % 2 == 0) ? SukunaVisuals.DarkSlash : SukunaVisuals.GreySlash, true); } } } private void ShowAmbientSlashes() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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) int num = 4; for (int i = 0; i < num; i++) { Vector3 val = center + Random.insideUnitSphere * 33.6f; Vector3 onUnitSphere = Random.onUnitSphere; float num2 = Random.Range(5.5f, 13.5f); SukunaVisuals.CreateSlash(val - onUnitSphere * num2 * 0.5f, val + onUnitSphere * num2 * 0.5f, Random.Range(0.035f, 0.075f), Random.Range(0.16f, 0.32f), (Random.value > 0.7f) ? SukunaVisuals.GreySlash : SukunaVisuals.DarkSlash, true); } } private TeamIndex GetTeam() { //IL_002c: 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.teamComponent)) { return (TeamIndex)(-1); } return body.teamComponent.teamIndex; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)visual)) { Object.Destroy((Object)(object)((Component)visual).gameObject); } } } internal sealed class SukunaSideSkillController : MonoBehaviour { private const float DismantleHoldThreshold = 0.075f; [SerializeField] private GenericSkill dismantleSkill; [SerializeField] private GenericSkill cleaveSkill; [SerializeField] private GenericSkill domainSkill; private bool previousDismantleHeld; private bool previousCleaveHeld; private bool previousDomainHeld; private int nextPunchStep; private float lastPunchStepAt = -100f; private float dismantlePressedAt; private bool dismantleBursting; internal bool CleaveHeld { get; private set; } internal bool DismantleHeld { get; private set; } internal GenericSkill DismantleSkill => dismantleSkill; internal GenericSkill CleaveSkill => cleaveSkill; internal GenericSkill DomainSkill => domainSkill; private void Start() { GenericSkill[] components = ((Component)this).GetComponents(); for (int i = 0; i < components.Length; i++) { switch (components[i].skillName) { case "SideDismantle": dismantleSkill = components[i]; break; case "SideCleave": cleaveSkill = components[i]; break; case "Domain": domainSkill = components[i]; break; } } } internal void Configure(GenericSkill dismantle, GenericSkill cleave, GenericSkill domain) { dismantleSkill = dismantle; cleaveSkill = cleave; domainSkill = domain; } internal int ConsumeNextPunchStep() { if (Time.time - lastPunchStepAt > 2.9f) { nextPunchStep = 0; } int result = nextPunchStep; nextPunchStep = (nextPunchStep + 1) % 4; lastPunchStepAt = Time.time; return result; } private void Update() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (JujutsuInput.IsBlocked || !Util.HasEffectiveAuthority(((Component)this).gameObject)) { previousDismantleHeld = false; previousCleaveHeld = false; previousDomainHeld = false; dismantleBursting = false; return; } bool key = JujutsuInput.GetKey(JujutsuConfig.SideSkill1Key.Value); bool flag = (CleaveHeld = JujutsuInput.GetKey(JujutsuConfig.SideSkill2Key.Value)); bool key3 = JujutsuInput.GetKey(JujutsuConfig.DomainKey.Value); if (key && !previousDismantleHeld) { dismantlePressedAt = Time.unscaledTime; dismantleBursting = false; } if (key) { if (!dismantleBursting && Time.unscaledTime - dismantlePressedAt >= 0.075f) { dismantleBursting = true; } if (dismantleBursting) { GenericSkill obj = dismantleSkill; if (obj != null) { obj.ExecuteIfReady(); } } } else if (previousDismantleHeld) { if (!dismantleBursting) { GenericSkill obj2 = dismantleSkill; if (obj2 != null) { obj2.ExecuteIfReady(); } } dismantleBursting = false; } if (flag && !previousCleaveHeld) { GenericSkill obj3 = cleaveSkill; if (obj3 != null) { obj3.ExecuteIfReady(); } } if (key3 && !previousDomainHeld) { GenericSkill obj4 = domainSkill; if (obj4 != null) { obj4.ExecuteIfReady(); } } DismantleHeld = key; previousDismantleHeld = key; previousCleaveHeld = flag; previousDomainHeld = key3; } } internal sealed class SukunaExtraSkillHud : MonoBehaviour, IJujutsuSkillStrip { private CharacterBody body; private SukunaSideSkillController skills; private SukunaBladeMagazine bladeMagazine; private SukunaTorrentReservoir torrentReservoir; public int StripSlotCount { get { if (!Object.op_Implicit((Object)(object)skills)) { return 0; } return 3; } } private static Sprite SelectedIcon(GenericSkill skill, Sprite fallback) { Sprite val = ((Object.op_Implicit((Object)(object)skill) && Object.op_Implicit((Object)(object)skill.skillDef)) ? skill.skillDef.icon : null); if (!Object.op_Implicit((Object)(object)val)) { return fallback; } return val; } private static Color SelectedAccent(GenericSkill skill, Color fallback) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)skill) || !Object.op_Implicit((Object)(object)skill.skillDef) || !(skill.skillDef.skillName == "SukunaWaterBeam")) { return fallback; } return SukunaAssets.Water; } private static string SelectedName(GenericSkill skill, string fallback) { if (!Object.op_Implicit((Object)(object)skill) || !Object.op_Implicit((Object)(object)skill.skillDef)) { return fallback; } string skillNameToken = skill.skillDef.skillNameToken; if (string.IsNullOrEmpty(skillNameToken)) { return fallback; } string text = Language.GetString(skillNameToken); if (!string.IsNullOrEmpty(text) && !(text == skillNameToken)) { return text.ToUpperInvariant(); } return fallback; } private void Awake() { body = ((Component)this).GetComponent(); skills = ((Component)this).GetComponent(); bladeMagazine = ((Component)this).GetComponent(); torrentReservoir = ((Component)this).GetComponent(); } public JujutsuStripSlot GetStripSlot(int index) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) switch (index) { case 0: { bool flag = Object.op_Implicit((Object)(object)skills.DismantleSkill) && Object.op_Implicit((Object)(object)skills.DismantleSkill.skillDef) && skills.DismantleSkill.skillDef.skillName == "SukunaDismantle"; return Describe(skills.DismantleSkill, SelectedIcon(skills.DismantleSkill, SukunaAssets.DismantleIcon), JujutsuInput.Describe(JujutsuConfig.SideSkill1Key.Value), SelectedName(skills.DismantleSkill, "SLASH"), SelectedAccent(skills.DismantleSkill, SukunaVisuals.GreySlash), flag ? bladeMagazine : null, flag ? null : torrentReservoir); } case 1: return Describe(skills.CleaveSkill, SelectedIcon(skills.CleaveSkill, SukunaAssets.CleaveIcon), JujutsuInput.Describe(JujutsuConfig.SideSkill2Key.Value), SelectedName(skills.CleaveSkill, "CLEAVE"), SelectedAccent(skills.CleaveSkill, SukunaAssets.Fire)); default: return Describe(skills.DomainSkill, SukunaAssets.ShrineIcon, JujutsuInput.Describe(JujutsuConfig.DomainKey.Value), "DOMAIN", new Color(0.65f, 0.02f, 0.16f, 1f)); } } private static JujutsuStripSlot Describe(GenericSkill skill, Sprite icon, string bind, string shortName, Color accent, SukunaBladeMagazine magazine = null, SukunaTorrentReservoir reservoir = null) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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) bool flag = (Object.op_Implicit((Object)(object)magazine) ? (magazine.Current > 0) : (Object.op_Implicit((Object)(object)skill) && skill.stock > 0)); float num = (Object.op_Implicit((Object)(object)skill) ? Mathf.Max(0f, skill.cooldownRemaining) : 0f); return new JujutsuStripSlot { Icon = icon, Bind = bind, ShortName = shortName, Accent = accent, Available = flag, OverlayText = (flag ? null : (Object.op_Implicit((Object)(object)magazine) ? magazine.SecondsUntilNext.ToString("0.0") : ((num >= 10f) ? Mathf.CeilToInt(num).ToString() : num.ToString("0.0")))), ChargeFraction = (Object.op_Implicit((Object)(object)magazine) ? magazine.RechargeProgress : (-1f)), StockText = (Object.op_Implicit((Object)(object)magazine) ? (magazine.Current + "/" + magazine.Maximum) : null), GaugeFraction = (Object.op_Implicit((Object)(object)reservoir) ? Mathf.Clamp01(reservoir.Fraction) : (-1f)), GaugeColour = (Color)((Object.op_Implicit((Object)(object)reservoir) && reservoir.CanOpen) ? SukunaAssets.Water : new Color(0.3f, 0.42f, 0.55f, 0.9f)) }; } } internal sealed class SukunaTorrentReservoir : MonoBehaviour { internal const float Capacity = 100f; internal const float DrainPerSecond = 33f; internal const float RefillPerSecond = 16f; private const float RefillDelay = 0.55f; private const float MinimumToOpen = 25f; private float amount = 100f; private float lastDrainedAt = -1000f; internal float Fraction => Mathf.Clamp01(amount / 100f); internal bool CanOpen => amount >= 25f; internal bool IsEmpty => amount <= 0f; internal bool Drain(float deltaTime) { lastDrainedAt = Time.time; amount -= 33f * deltaTime; if (amount <= 0f) { amount = 0f; return false; } return true; } private void Update() { if (!(amount >= 100f) && !(Time.time - lastDrainedAt < 0.55f)) { amount = Mathf.Min(100f, amount + 16f * Time.deltaTime); } } } internal sealed class TravellingBladeController : MonoBehaviour { private GameObject attacker; private TeamIndex ownerTeam; private float damage; private Vector3 force; private bool crit; private float procCoefficient; private DamageTypeCombo damageType; private bool isSweep; private Vector3 start; private Vector3 direction; private float totalDistance; private float speed; private float travelled; private float radius; private HashSet victims; private Vector3 centre; private float delay; private float age; internal static void Sweep(GameObject attacker, TeamIndex ownerTeam, Vector3 start, Vector3 end, float radius, float speed, float damage, Vector3 force, bool crit, float procCoefficient, DamageTypeCombo damageType) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { Vector3 val = end - start; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.01f) { JujutsuDamageUtility.FireCapsule(attacker, ownerTeam, start, end, radius, damage, force, crit, procCoefficient, damageType, (HashSet)null); return; } TravellingBladeController travellingBladeController = CreateHost(start); travellingBladeController.isSweep = true; travellingBladeController.attacker = attacker; travellingBladeController.ownerTeam = ownerTeam; travellingBladeController.damage = damage; travellingBladeController.force = force; travellingBladeController.crit = crit; travellingBladeController.procCoefficient = procCoefficient; travellingBladeController.damageType = damageType; travellingBladeController.start = start; travellingBladeController.direction = val / magnitude; travellingBladeController.totalDistance = magnitude; travellingBladeController.speed = Mathf.Max(1f, speed); travellingBladeController.radius = Mathf.Max(0.1f, radius); travellingBladeController.victims = new HashSet(); } } internal static void DelayedSphere(GameObject attacker, TeamIndex ownerTeam, Vector3 centre, float radius, float delay, float damage, Vector3 force, bool crit, float procCoefficient, DamageTypeCombo damageType) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { if (delay <= 0f) { JujutsuDamageUtility.FireAdaptiveSphere(attacker, ownerTeam, centre, radius, damage, force, crit, procCoefficient, damageType); return; } TravellingBladeController travellingBladeController = CreateHost(centre); travellingBladeController.isSweep = false; travellingBladeController.attacker = attacker; travellingBladeController.ownerTeam = ownerTeam; travellingBladeController.damage = damage; travellingBladeController.force = force; travellingBladeController.crit = crit; travellingBladeController.procCoefficient = procCoefficient; travellingBladeController.damageType = damageType; travellingBladeController.centre = centre; travellingBladeController.radius = Mathf.Max(0.1f, radius); travellingBladeController.delay = delay; } } private static TravellingBladeController CreateHost(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SukunaTravellingBlade"); val.transform.position = position; return val.AddComponent(); } private void FixedUpdate() { //IL_0050: 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_0068: 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) if (!Object.op_Implicit((Object)(object)attacker)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (isSweep) { AdvanceSweep(); return; } age += Time.fixedDeltaTime; if (!(age < delay)) { JujutsuDamageUtility.FireAdaptiveSphere(attacker, ownerTeam, centre, radius, damage, force, crit, procCoefficient, damageType); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void AdvanceSweep() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(travelled + speed * Time.fixedDeltaTime, totalDistance); Vector3 val = start + direction * travelled; Vector3 val2 = start + direction * num; ((Component)this).transform.position = val2; JujutsuDamageUtility.FireCapsuleSegment(attacker, ownerTeam, val, val2, radius, damage, force, crit, procCoefficient, damageType, victims); travelled = num; if (travelled >= totalDistance) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } }