Decompiled source of Huntsman v1.1.1
Mods/Huntsman.dll
Decompiled 17 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using System.Text; using BoneLib; using BoneLib.BoneMenu; using Huntsman; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using LabFusion.Entities; using LabFusion.Network; using LabFusion.Network.Serialization; using LabFusion.Player; using LabFusion.SDK.Modules; using LabFusion.Utilities; using MelonLoader; using MelonLoader.Preferences; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(/*Could not decode attribute arguments.*/)] [assembly: MelonInfo(typeof(Main), "Huntsman", "1.1.1", "Huntsman", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: MelonOptionalDependencies(new string[] { "LabFusion" })] [assembly: SecurityPermission((SecurityAction)8, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : System.Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(/*Could not decode attribute arguments.*/)] internal sealed class RefSafetyRulesAttribute : System.Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Huntsman { public class Spider { private class LegAnim { public Vector3[] J = (Vector3[])(object)new Vector3[6]; public bool HasFoot; public bool Stepping; public bool Planted; public Vector3 Foot; public Vector3 From; public Vector3 To; public Vector3 Normal; public float T0; public float Dur; } private class AnimState { public float H = 1f; public float Spread = 1f; public float Lift; public float Abdomen; public float Palps = 0.25f; public float Tremble; public float Curl; public float Lean; public float Reach; public float Tap; public float Gait = 1f; public float Stride = 1f; public LegAnim[] Legs = new LegAnim[8]; public Vector3 Vel; public Vector3 LastPos; public bool HasLast; public float Phase; public Vector3 BodyPos; public Vector3 Fb; public Vector3 Lb; public Vector3 Ub; public Vector3 AbO; public Vector3 AbX; public Vector3 AbY; public float Breath = 1f; public Vector3[] PalpL = (Vector3[])(object)new Vector3[3]; public Vector3[] PalpR = (Vector3[])(object)new Vector3[3]; public AnimState() { for (int i = 0; i < 8; i++) { Legs[i] = new LegAnim(); } } } private struct Snap { public float T; public Vector3 P; public Quaternion R; public float H; } private readonly AnimState anim = new AnimState(); private Vector3 bodyPos; private Vector3 bFb; private Vector3 bLb; private Vector3 bUb; private static readonly Vector2[] P2 = (Vector2[])(object)new Vector2[4]; private const float S = 1.22f; public float PreferClimbUntil; private const float Gravity = 15f; private const float HullR = 0.2286f; private const float BodyTop = 0.3048f; public StateDef St; public string StateName; public SD Sd; private float stateT0; private float stateDur; private int stateSerial; private string resumeState; private SD resumeSd; public float Speed; public Vector3 Vel; public float CurH; private Vector3 moveDir; private bool hasMoveDir; public Vector3N MoveGoal; public Vector3N LastGoal; public Vector3N FacePos; public float WantSpeed; public bool Sideways; public bool Backward; public bool Air; public bool PreferClimb; public bool Cramped; private float squeezeUntil; public float StuckTime; private float solidTime; private float airTime; private float nextGood; private float swinT; private float detourUntil; private bool swin; private Vector3 swinPos; private Vector3 detour; private Vector3 goodPos; private bool hasGood; private int stuckLvl; private float spawnY; private float navNext; private float navPathT; private Vector3N navPoint; private Vector3N navGoal; private List<Vector3> navPath; public float Aggression; public int MemSpotted; public int MemShot; public int MemStuck; public int MemKills; public byte Target = 255; public byte LastTarget = 255; public bool TargetVisible; public bool Watched; public Vector3N LastSeenPos; public Vector3N TargetHeard; public float LastSeenTime; public Trails.Noise HeardNoise; public bool HasHeardNoise; private float noiseSince; private float nextPerceive; public float LastHurt = -100f; public byte LastAttacker = 255; private float nextPainSound; private float nextReact; public float NextPounce; public string SqueezeReturn; public Vector3N SqueezeGoal; private static NavMeshPath navMeshPath; public float FleeUntil; public static readonly List<Spider> All = new List<Spider>(); private static byte nextId; public const float Scale = 1.22f; public const float SpeedMult = 1.18f; public const float BaseAggression = 0.9f; private const float U = 0.0254f; public const float SPD = 0.0127f; public const float BaseRunSpeed = 10.414f; public byte Id; public bool Authority; public GameObject Root; private Transform[] pieceT; private AudioSource audio; public Vector3 Pos; public Vector3 Up = Vector3.up; public Vector3 Fwd = Vector3.forward; public int StateId; public bool Dead; public bool Airborne; public float BodyHeight; public float Health; public float MaxHealth; private readonly Snap[] snaps = new Snap[3]; private int snapCount; private const float InterpDelay = 0.1f; private float CrawlR => Mathf.Min(0.2286f, CurH * 0.9f); public float TimeIn => M.Now - stateT0; public float StateDur => stateDur; private bool Expired => TimeIn >= stateDur; public float RunSpeed => 12.288519f * Prefs.Speed; public string Surface { get { if (!(Up.y > 0.6f)) { if (!(Up.y < -0.6f)) { return "wall"; } return "ceiling"; } return "floor"; } } public Vector3 EyePosW => Pos + Up * 0.247904f + Fwd * 0.681736f; public float TargetDist { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!Targets.TryGet(Target, out var t)) { return 3.4028235E+38f; } return Vector3.Distance(Pos, t.Center); } } public bool Fleeing => M.Now < FleeUntil; public Quaternion Rot => Quaternion.LookRotation(Fwd, Up); public float RestHeight => Skeleton.Body.z * 1.22f; public StateDef PostureState => States.ById(StateId); private Vector3 BodyW(Vector3 v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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) Vector3 body = Skeleton.Body; return bodyPos + bFb * ((v.x - body.x) * 1.22f) + bLb * ((v.y - body.y) * 1.22f) + bUb * ((v.z - body.z) * 1.22f); } private Vector3 DirW(Vector3 v) { //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_000c: 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_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_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_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) return bFb * v.x + bLb * v.y + bUb * v.z; } private static bool FootTarget(Vector3 hipW, Vector3 ideal, Vector3 up, out Vector3 pos) { //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_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_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_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_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) TraceResult traceResult = Trace.Line(hipW, ideal + up * 0.092964f); if (traceResult.Hit && traceResult.Fraction < 0.9f) { pos = traceResult.HitPos; return true; } TraceResult traceResult2 = Trace.Line(ideal + up * 0.867664f, ideal - up * 1.4254481f); if (traceResult2.Hit) { pos = traceResult2.HitPos; return true; } TraceResult traceResult3 = Trace.Line(ideal - up * 1.4254481f, hipW - up * 0.805688f); if (traceResult3.Hit) { pos = traceResult3.HitPos; return true; } pos = ideal - up * 0.371856f; return false; } private void SolveLeg(Rest.Leg R, Vector3[] outJ, Vector3 hipW, Vector3 tgt, Vector3 Ub) { //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_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c5: 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_0066: 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_007b: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: 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_019f: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = tgt - hipW; float num = Vector3.Dot(val, Ub); Vector3 df = val - Ub * num; float num2 = ((Vector3)(ref df)).magnitude; if (num2 < 0.00025399998f) { df = DirW(R.Tip - R.Hip); df -= Ub * Vector3.Dot(df, Ub); ((Vector3)(ref df)).Normalize(); num2 = 0f; } else { df /= num2; } Vector3 pp = M.SCross(Ub, df); Vector2[] p = P2; for (int i = 0; i < 4; i++) { p[i] = R.IkP[i] * 1.22f; } Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(num2, num); for (int j = 0; j < 12; j++) { p[3] = val2; for (int num3 = 2; num3 >= 0; num3--) { Vector2 val3 = p[num3] - p[num3 + 1]; float num4 = ((Vector2)(ref val3)).magnitude; if (num4 < 1E-06f) { num4 = 1f; ((Vector2)(ref val3))..ctor(0f, 1f); } p[num3] = p[num3 + 1] + val3 / num4 * (R.IkLen[num3] * 1.22f); } p[0] = Vector2.zero; for (int k = 0; k < 3; k++) { Vector2 val4 = p[k + 1] - p[k]; float num5 = ((Vector2)(ref val4)).magnitude; if (num5 < 1E-06f) { num5 = 1f; ((Vector2)(ref val4))..ctor(1f, 0f); } p[k + 1] = p[k] + val4 / num5 * (R.IkLen[k] * 1.22f); } Vector2 val5 = p[3] - val2; if (((Vector2)(ref val5)).sqrMagnitude < 6.4515993E-06f) { break; } } Vector2 val6 = p[3]; float magnitude = ((Vector2)(ref val6)).magnitude; if (magnitude > 2.54E-06f) { Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor((0f - val6.y) / magnitude, val6.x / magnitude); if (val7.y < 0f) { val7 = -val7; } if (Vector2.Dot(p[1], val7) < 0f) { for (int l = 1; l < 4; l++) { ref Vector2 reference = ref p[l]; reference -= 2f * Vector2.Dot(p[l], val7) * val7; } } } float num6 = Mathf.Atan2(p[3].y - p[2].y, p[3].x - p[2].x) - R.LowAng; float num7 = Mathf.Cos(num6); float num8 = Mathf.Sin(num6); Vector3[] sh = R.Shape; Put(0, 0f, 0f); Put(1, p[1].x, p[1].y); Put(2, p[2].x, p[2].y); for (int m = 3; m < 6; m++) { float num9 = R.Low[m].x * 1.22f; float num10 = R.Low[m].y * 1.22f; Put(m, p[2].x + num9 * num7 - num10 * num8, p[2].y + num9 * num8 + num10 * num7); } [CompilerGenerated] void Put(int num11, float x, float y) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0030: 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) outJ[num11] = hipW + df * x + Ub * y + pp * (sh[num11].y * 1.22f); } } private void OnStepLand() { if (M.Chance(0.16f)) { PlaySound("step", 0.07f, 1.5f, 1.85f); } } private void Animate(float dt) { //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_016a: 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_01d0: 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_0181: 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_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_0212: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036c: 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_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: 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_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_08e5: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_0de8: Unknown result type (might be due to invalid IL or missing references) //IL_0dea: Unknown result type (might be due to invalid IL or missing references) //IL_0dee: Unknown result type (might be due to invalid IL or missing references) //IL_0df3: Unknown result type (might be due to invalid IL or missing references) //IL_0df9: Unknown result type (might be due to invalid IL or missing references) //IL_0dfb: Unknown result type (might be due to invalid IL or missing references) //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e0c: Unknown result type (might be due to invalid IL or missing references) //IL_0e11: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_0b47: Unknown result type (might be due to invalid IL or missing references) //IL_0b4c: Unknown result type (might be due to invalid IL or missing references) //IL_0cba: Unknown result type (might be due to invalid IL or missing references) //IL_0cbf: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cca: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Unknown result type (might be due to invalid IL or missing references) //IL_0cd7: Unknown result type (might be due to invalid IL or missing references) //IL_0cdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0ce5: Unknown result type (might be due to invalid IL or missing references) //IL_0cea: Unknown result type (might be due to invalid IL or missing references) //IL_0cec: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0d0f: Unknown result type (might be due to invalid IL or missing references) //IL_0d14: Unknown result type (might be due to invalid IL or missing references) //IL_0d16: Unknown result type (might be due to invalid IL or missing references) //IL_0d18: Unknown result type (might be due to invalid IL or missing references) //IL_0d1f: Unknown result type (might be due to invalid IL or missing references) //IL_0d24: Unknown result type (might be due to invalid IL or missing references) //IL_0d29: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0d41: Unknown result type (might be due to invalid IL or missing references) //IL_0d46: Unknown result type (might be due to invalid IL or missing references) //IL_0d6d: Unknown result type (might be due to invalid IL or missing references) //IL_0d72: Unknown result type (might be due to invalid IL or missing references) //IL_0d77: Unknown result type (might be due to invalid IL or missing references) //IL_0d79: Unknown result type (might be due to invalid IL or missing references) //IL_0d81: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Unknown result type (might be due to invalid IL or missing references) //IL_0d8b: Unknown result type (might be due to invalid IL or missing references) //IL_0d8d: Unknown result type (might be due to invalid IL or missing references) //IL_0d94: Unknown result type (might be due to invalid IL or missing references) //IL_0d99: Unknown result type (might be due to invalid IL or missing references) //IL_0d9e: Unknown result type (might be due to invalid IL or missing references) //IL_097f: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_0bc0: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0bd3: Unknown result type (might be due to invalid IL or missing references) //IL_0be0: Unknown result type (might be due to invalid IL or missing references) //IL_0be5: Unknown result type (might be due to invalid IL or missing references) //IL_0bea: Unknown result type (might be due to invalid IL or missing references) //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0bf1: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_09fb: Unknown result type (might be due to invalid IL or missing references) //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_0c03: Unknown result type (might be due to invalid IL or missing references) //IL_0c0d: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Unknown result type (might be due to invalid IL or missing references) //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_0861: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) //IL_0a60: Unknown result type (might be due to invalid IL or missing references) //IL_0a67: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a73: Unknown result type (might be due to invalid IL or missing references) //IL_0aa7: Unknown result type (might be due to invalid IL or missing references) //IL_0aac: Unknown result type (might be due to invalid IL or missing references) //IL_0ab1: Unknown result type (might be due to invalid IL or missing references) //IL_0a28: Unknown result type (might be due to invalid IL or missing references) //IL_0a2d: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b79: Unknown result type (might be due to invalid IL or missing references) //IL_0baa: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Unknown result type (might be due to invalid IL or missing references) //IL_0bb4: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b0c: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) float now = M.Now; AnimState animState = anim; StateDef postureState = PostureState; float num = Mathf.Min(1f, dt * 6f); animState.H = Mathf.Lerp(animState.H, postureState.H, num); animState.Spread = Mathf.Lerp(animState.Spread, postureState.Spread, num); animState.Lift = Mathf.Lerp(animState.Lift, postureState.Lift, num); animState.Abdomen = Mathf.Lerp(animState.Abdomen, postureState.Abdomen, num); animState.Palps = Mathf.Lerp(animState.Palps, postureState.Palps, num); animState.Tremble = Mathf.Lerp(animState.Tremble, postureState.Tremble, num); animState.Curl = Mathf.Lerp(animState.Curl, postureState.Curl, num); animState.Lean = Mathf.Lerp(animState.Lean, postureState.Lean, num); animState.Reach = Mathf.Lerp(animState.Reach, postureState.Reach, num); animState.Tap = Mathf.Lerp(animState.Tap, postureState.Tap, num); animState.Gait = Mathf.Lerp(animState.Gait, postureState.Gait, num); animState.Stride = Mathf.Lerp(animState.Stride, postureState.Stride, num); float tremble = animState.Tremble; Vector3 pos = Pos; Vector3 fwd = Fwd; Vector3 up = Up; Vector3 val = M.SCross(up, fwd); if (dt > 0f && animState.HasLast) { Vector3 val2 = (pos - animState.LastPos) / dt; if (((Vector3)(ref val2)).sqrMagnitude > 10000f) { val2 = Vector3.zero; } animState.Vel = Vector3.Lerp(animState.Vel, val2, Mathf.Min(1f, dt * 8f)); } animState.LastPos = pos; animState.HasLast = true; float magnitude = ((Vector3)(ref animState.Vel)).magnitude; float num2 = magnitude / 0.0127f; float num3 = ((BodyHeight > 0f) ? BodyHeight : RestHeight); Vector3 val3 = pos - up * num3; animState.Phase = (animState.Phase + dt * magnitude / 1.177544f) % 1f; float num4 = 0f; float num5 = 0f; float num6 = 0f; float num7 = 0f; for (int i = 0; i < 8; i++) { LegAnim legAnim = animState.Legs[i]; if (legAnim.HasFoot) { float num8 = Vector3.Dot(legAnim.Foot - val3, up); Rest.Leg obj = Rest.Legs[i]; if (obj.Index <= 1) { num4 += num8; } else { num5 += num8; } if (obj.Side == 1) { num6 += num8; } else { num7 += num8; } } } float num9 = animState.Lean * 0.35f + Mathf.Clamp((0f - (num4 - num5)) / 11.15568f, -0.4f, 0.4f); float num10 = Mathf.Clamp((num6 - num7) / 13.63472f, -0.35f, 0.35f); if (tremble > 0.01f) { num9 += (Random.value - 0.5f) * 0.05f * tremble; num10 += (Random.value - 0.5f) * 0.05f * tremble; } Vector3 val4 = M.RotS(fwd, val, num9); Vector3 v = M.RotS(up, val, num9); Vector3 v2 = val; v2 = M.RotS(v2, val4, num10); v = M.RotS(v, val4, num10); float num11 = Mathf.Sin(animState.Phase * (float)Math.PI * 4f) * 0.7f * 1.22f * 0.0254f * Mathf.Min(num2 / 250f, 1f) + Mathf.Sin(now * 2.1f) * 0.3f * 1.22f * 0.0254f; bodyPos = pos + v * num11 + M.VectorRand() * (tremble * 0.5f * 1.22f * 0.0254f); bFb = val4; bLb = v2; bUb = v; animState.BodyPos = bodyPos; animState.Fb = val4; animState.Lb = v2; animState.Ub = v; float num12 = Mathf.Clamp(0.24f - num2 * 0.00016f, 0.05f, 0.24f) / Mathf.Max(animState.Gait, 0.25f); bool flag = false; bool flag2 = false; for (int j = 0; j < 8; j++) { if (animState.Legs[j].Stepping) { if (Rest.Legs[j].Group == 0) { flag = true; } else { flag2 = true; } } } Transform head = Player.Head; Vector3 val5; int num13; if ((Object)(object)head != (Object)null) { val5 = pos - head.position; num13 = ((((Vector3)(ref val5)).sqrMagnitude > 5806.4395f) ? 1 : 0); } else { num13 = 0; } bool flag3 = (byte)num13 != 0; Vector3 body = Skeleton.Body; int num14 = 0; while (num14 < 8) { Rest.Leg leg = Rest.Legs[num14]; LegAnim legAnim2 = animState.Legs[num14]; Vector3 val6 = BodyW(leg.Hip); float num15 = leg.Hip.x + (leg.Tip.x - leg.Hip.x) * animState.Spread; float num16 = leg.Hip.y + (leg.Tip.y - leg.Hip.y) * animState.Spread; Vector3 val7 = val3 + fwd * ((num15 - body.x) * 1.22f) + val * ((num16 - body.y) * 1.22f) + animState.Vel * (num12 * 0.6f); float num17 = leg.Reach * 1.22f; Vector3 val8 = val7; bool flag4 = false; if (Dead || animState.Curl > 0.45f) { val8 = Vector3.Lerp(val7, val6 + (bodyPos - val6) * 0.5f - v * (num3 * 0.2f), Mathf.Min(animState.Curl, 1f)); flag4 = true; } else if (Airborne) { Vector3 val9 = val7 - val3; val9 -= up * Vector3.Dot(val9, up); val8 = val6 + ((Vector3)(ref val9)).normalized * (num17 * 0.7f) - v * (num17 * 0.12f) + v * (Mathf.Sin(now * 13f + (float)num14) * 4f * 1.22f * 0.0254f); flag4 = true; } else if ((leg.Index == 0 && animState.Lift > 0.05f) || (leg.Index == 1 && animState.Lift > 0.6f)) { float num18 = ((leg.Index == 0) ? animState.Lift : ((animState.Lift - 0.6f) * 2.5f)); float num19 = leg.Full * 1.22f; Vector3 val10 = val6 + val4 * (num19 * 0.72f) + v2 * ((float)leg.Side * num19 * 0.2f) + v * (num19 * 0.5f) + v * (Mathf.Sin(now * 5f + (float)num14) * 3f * 1.22f * 0.0254f) + val4 * (Mathf.Sin(now * 3.7f + (float)(num14 * 2)) * 2f * 1.22f * 0.0254f); val8 = Vector3.Lerp(val7, val10, Mathf.Min(num18, 1f)); flag4 = num18 > 0.15f; } else if (leg.Index == 0 && leg.Side == 1 && animState.Reach > 0.05f) { val8 = Vector3.Lerp(val7, val6 + val4 * (num17 * 0.92f) - v * (num3 * 0.25f) + v2 * (Mathf.Sin(now * 1.3f) * 3f * 1.22f * 0.0254f), animState.Reach); flag4 = animState.Reach > 0.2f; } if (flag4) { legAnim2.Stepping = false; legAnim2.Planted = false; legAnim2.Foot = (legAnim2.HasFoot ? Vector3.Lerp(legAnim2.Foot, val8, Mathf.Min(1f, dt * 12f)) : val8); legAnim2.HasFoot = true; goto IL_0b45; } bool planted = true; Vector3 pos2; if (flag3) { pos2 = val7; } else { planted = FootTarget(val6, val7, up, out pos2); } if (legAnim2.HasFoot) { val5 = legAnim2.Foot - val6; if (!(((Vector3)(ref val5)).sqrMagnitude > num17 * 3f * (num17 * 3f))) { goto IL_097d; } } legAnim2.Foot = pos2; legAnim2.Planted = planted; legAnim2.HasFoot = true; goto IL_097d; IL_0b45: Vector3 val11 = legAnim2.Foot; if (leg.Index == 0 && leg.Side == -1 && animState.Tap > 0.05f && !legAnim2.Stepping) { val11 += v * (Mathf.Max(0f, Mathf.Sin(now * 9f)) * 5f * 1.22f * 0.0254f * animState.Tap); } SolveLeg(leg, legAnim2.J, val6, val11, v); Vector3 val12 = M.SCross(legAnim2.J[5] - legAnim2.J[0], v); legAnim2.Normal = ((((Vector3)(ref val12)).sqrMagnitude > 1E-08f) ? ((Vector3)(ref val12)).normalized : (val4 * (float)leg.Side)); num14++; continue; IL_097d: float num20 = Vector3.Distance(legAnim2.Foot, pos2); float num21 = 0.030988f * (10f + Mathf.Min(num2, 1400f) * 0.028f) * animState.Stride; bool flag5 = Vector3.Distance(legAnim2.Foot, val6) > num17 * 1.02f; if (legAnim2.Stepping) { legAnim2.To = Vector3.Lerp(legAnim2.To, pos2, Mathf.Min(1f, dt * 12f)); float num22 = (now - legAnim2.T0) / legAnim2.Dur; if (num22 >= 1f) { legAnim2.Stepping = false; legAnim2.Foot = legAnim2.To; legAnim2.Planted = planted; OnStepLand(); } else { float num23 = num22 * num22 * (3f - 2f * num22); legAnim2.Foot = Vector3.Lerp(legAnim2.From, legAnim2.To, num23) + v * (Mathf.Sin(num22 * (float)Math.PI) * 1.22f * 0.0254f * (5f + Mathf.Min(num2, 900f) * 0.012f)); } } else if ((num20 > num21 || flag5 || !legAnim2.Planted) && (!((leg.Group == 0) ? flag2 : flag) || num20 > num21 * 2.2f || flag5)) { legAnim2.Stepping = true; legAnim2.From = legAnim2.Foot; legAnim2.To = pos2; legAnim2.T0 = now; legAnim2.Dur = num12 * M.Rand(0.85f, 1.15f); if (leg.Group == 0) { flag = true; } else { flag2 = true; } } goto IL_0b45; } for (int k = 0; k < 2; k++) { Rest.Palp obj2 = ((k == 0) ? Rest.PalpL : Rest.PalpR); Vector3[] array = ((k == 0) ? animState.PalpL : animState.PalpR); Vector3[] joints = obj2.Joints; float num24 = obj2.Side; float num25 = (Mathf.Sin(now * 7f + num24 * 1.3f) * 0.25f + Mathf.Sin(now * 17f + num24) * 0.08f) * animState.Palps; float num26 = 0f - animState.Lift * 0.45f - num25; Vector3 val13 = BodyW(joints[0]); Vector3 v3 = M.RotS(DirW(joints[1] - joints[0]), v2, num26); v3 = M.RotS(v3, v, num24 * 0.12f * Mathf.Sin(now * 3.1f + num24) * animState.Palps); Vector3 val14 = val13 + v3 * 1.22f; Vector3 val15 = M.RotS(DirW(joints[2] - joints[1]), v2, num26 * 1.4f + 0.2f * Mathf.Sin(now * 5f + num24) * animState.Palps); array[0] = val13; array[1] = val14; array[2] = val14 + val15 * 1.22f; } float ang = animState.Abdomen * 0.45f + Mathf.Sin(now * 1.7f) * 0.03f + (Dead ? 0.15f : 0f); animState.AbX = M.RotS(val4, v2, ang); animState.AbY = v2; animState.AbO = BodyW(Rest.Abdomen.O); animState.Breath = 1f + Mathf.Sin(now * 2.1f) * 0.015f; } public Vector3 RandomSpot(float radius) { //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_002a: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b8: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 6; i++) { float num = M.Rand(0f, (float)Math.PI * 2f); Vector3 val = M.SCross(Fwd, Up); Vector3 val2 = Fwd * Mathf.Cos(num) + val * Mathf.Sin(num); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num2 = M.Rand(radius * 0.4f, radius); Vector3 val3 = Trace.Line(Pos, Pos + normalized * num2).HitPos - normalized * 0.508f; val2 = val3 - Pos; if (((Vector3)(ref val2)).magnitude > radius * 0.25f) { return val3; } } return Pos + Fwd * (radius * 0.5f); } public Vector3N FindCeilingAbove(Vector3 pos, float maxH) { //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_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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) TraceResult traceResult = Trace.Line(pos, pos + Vector3.up * maxH); if (traceResult.Hit && traceResult.Normal.y < -0.6f) { return traceResult.HitPos; } return Vector3N.None; } public Vector3N FindWallNear(float maxDist, Vector3 from, out Vector3 normal) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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_0042: 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_007b: 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) Vector3N result = Vector3N.None; normal = Vector3.zero; float num = 3.4028235E+38f; for (int i = 0; i < 8; i++) { Vector3 val = M.YawDir((float)(i * 45) + M.Rand(-10f, 10f)); TraceResult traceResult = Trace.Line(from, from + val * maxDist); if (traceResult.Hit && Mathf.Abs(traceResult.Normal.y) < 0.4f && traceResult.Fraction < num) { result = traceResult.HitPos; normal = traceResult.Normal; num = traceResult.Fraction; } } return result; } public Vector3N FindWallNear(float maxDist) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Vector3 normal; return FindWallNear(maxDist, Pos, out normal); } public Vector3N FindCover(Vector3N eye, float radius) { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Vector3N result = Vector3N.None; float num = 3.4028235E+38f; if (!eye.Has) { return result; } for (int i = 0; i < 12; i++) { Vector3 val = M.VectorRand(); val.y *= 0.4f; ((Vector3)(ref val)).Normalize(); Vector3 val2 = Trace.Line(Pos, Pos + val * M.Rand(3.0479999f, radius)).HitPos - val * 0.4064f; if (Trace.Line(eye.V, val2).Hit) { Vector3 val3 = val2 - Pos; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { result = val2; num = sqrMagnitude; } } } return result; } public Vector3N FindLowGap(Vector3 from, float radius) { //IL_0007: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_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) for (int i = 0; i < 14; i++) { Vector3 val = from + M.YawDir(M.Rand(0f, 360f)) * M.Rand(2.032f, radius); TraceResult traceResult = Trace.Line(val + Vector3.up * 0.508f, val - Vector3.up * 5.08f); if (traceResult.Hit) { Vector3 val2 = traceResult.HitPos + Vector3.up * 0.0508f; TraceResult traceResult2 = Trace.Line(val2, val2 + Vector3.up * 3.0479999f); float num = traceResult2.Fraction * 120f * 0.0254f; if (traceResult2.Hit && num < 1.1176f && num > 0.254f) { return val2 + Vector3.up * (num * 0.5f); } } } return Vector3N.None; } public void IdleNext() { if (M.Chance(0.4f)) { WanderNext(); return; } SetState(M.Pick<string>("idle_rest", "idle_rest", "idle_groom_palps", "idle_groom_front", "idle_groom_rear", "idle_tap", "idle_shift", "idle_flatten", "idle_sense_air", "idle_turn", "idle_twitch", "idle_listen", "idle_doze")); } public void WanderNext() { float value = Random.value; if (value < 0.3f) { SetState("wander_walk"); } else if (value < 0.4f) { SetState("wander_pause"); } else if (value < 0.52f) { SetState("wander_sniff_trail"); } else if (value < 0.62f) { SetState("wander_wall_hug"); } else if (value < 0.72f) { SetState("wander_climb_wall"); } else if (value < 0.8f) { SetState("wander_ceiling_crawl"); } else if (value < 0.88f) { SetState("wander_corner_peek"); } else if (value < 0.94f) { SetState("wander_explore_vent"); } else { IdleNext(); } } public void Hunt() { //IL_0145: Unknown result type (might be due to invalid IL or missing references) if (Fleeing) { SetState(M.Chance(0.7f) ? "flee_sprint" : "flee_wall"); return; } if (!Targets.TryGet(Target, out var t) || Targets.Immune(Target)) { if (LastSeenPos.Has && M.Now - LastSeenTime < 20f) { SetState("track_search_last"); } else { WanderNext(); } return; } float targetDist = TargetDist; if (!TargetVisible) { if (M.Now - LastSeenTime < 4f) { SetState("chase_lost_sight"); } else if (targetDist < 63.5f && Trails.Get(Target) != null) { SetState("track_follow_footsteps"); } else { SetState("stalk_approach"); } return; } if (targetDist < 8.05688f) { SetState(M.Chance(0.8f) ? "chase_sprint" : "strike_lunge"); return; } if (Watched && M.Chance(0.2f)) { SetState("stalk_freeze"); return; } if (MemShot > 6 && M.Chance(0.4f)) { MemShot -= 3; SetState(FindCeilingAbove(t.Feet, 8.89f).Has ? "chase_ceiling_run" : "chase_zigzag"); return; } if (MemSpotted > 5 && M.Chance(0.25f)) { MemSpotted -= 3; SetState("ambush_select"); return; } float value = Random.value; if (value < 0.72f) { SetState("chase_sprint"); } else if (value < 0.82f) { SetState("chase_burst"); } else if (value < 0.9f) { SetState(M.Pick<string>("stalk_flank_left", "stalk_flank_right", "stalk_behind")); } else { SetState(M.Pick<string>("stalk_close", "chase_wall_run", "chase_cut_corner")); } } public bool StrikeCheck(bool allowPounce) { if (!ValidTarget(Target)) { return false; } float targetDist = TargetDist; if (targetDist < 2.5410159f) { return TryKill(Target); } if (allowPounce && TargetVisible && targetDist > 4.6482f && targetDist < 14.25448f && M.Now > NextPounce) { NextPounce = M.Now + 1.4f; if (M.Chance(0.55f)) { SetState("pounce_windup"); return true; } } return false; } public bool CheckSqueeze() { if (Cramped && St.Group != "squeeze" && !Air) { SqueezeReturn = StateName; SqueezeGoal = LastGoal; SetState(M.Chance(0.5f) ? "squeeze_flatten" : "squeeze_fold_legs"); return true; } return false; } public bool CheckStuck(Action onStuck = null) { if (StuckTime <= 0.8f) { return false; } StuckTime = 0f; MemStuck++; if (onStuck != null) { onStuck.Invoke(); } else { SetState(M.Chance(0.5f) ? "squeeze_sideways" : "squeeze_stuck"); } return true; } public Vector3 ThreatPos() { //IL_0010: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_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) if (Targets.TryGet(LastAttacker, out var t)) { return t.Center; } if (Targets.TryGet(Target, out var t2)) { return t2.Center; } Vector3N vector3N = Vector3N.None; float num = 3.4028235E+38f; Enumerator<Target> enumerator = Targets.All.GetEnumerator(); try { while (enumerator.MoveNext()) { Target current = enumerator.Current; Vector3 val = current.Feet - Pos; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { vector3N = current.Center; num = sqrMagnitude; } } } finally { ((System.IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } if (!vector3N.Has) { return Pos + Fwd * 2.54f; } return vector3N.V; } public Vector3 AwayFrom(Vector3 pos, float dist) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0030: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) Vector3 val = M.Flatten(Pos - pos, Up); Vector3 val2 = ((((Vector3)(ref val)).sqrMagnitude < 1E-08f) ? Fwd : ((Vector3)(ref val)).normalized); return Pos + val2 * dist; } private void InitSim() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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) MaxHealth = (Health = Prefs.Health); Aggression = 0.9f; CurH = RestHeight; noiseSince = M.Now; spawnY = Pos.y; TraceResult traceResult = Trace.Line(Pos + Vector3.up * 0.8128f, Pos - Vector3.up * 6.5024f); if (traceResult.Hit) { Up = traceResult.Normal; Pos = traceResult.HitPos + traceResult.Normal * CurH; } ApplyOrientation(); SetState("idle_rest"); } public void SetState(string name, SD data = null) { StateDef stateDef = default(StateDef); if (!States.ByName.TryGetValue(name, ref stateDef)) { Main.Error("unknown state " + name); stateDef = States.Get("idle_rest"); name = stateDef.Name; } StateDef st = St; st?.Exit?.Invoke(this, Sd); St = stateDef; StateName = name; Sd = data ?? new SD(); stateT0 = M.Now; stateDur = M.Rand(stateDef.DurMin, stateDef.DurMax); stateSerial++; StateId = stateDef.Id; Main.Debug($"spider {Id}: {st?.Name} -> {name}"); stateDef.Enter?.Invoke(this, Sd); } public void Transient(string name, SD data = null) { if (St == null || St.Group != "move") { resumeState = StateName; resumeSd = Sd; } SetState(name, data); } public void Resume() { string text = resumeState; SD data = resumeSd; resumeState = null; resumeSd = null; StateDef stateDef = default(StateDef); if (text != null && States.ByName.TryGetValue(text, ref stateDef) && stateDef.Group != "move") { SetState(text, data); } else { Hunt(); } } private void Think(float dt) { //IL_015e: 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_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) dt = Mathf.Clamp(dt, 0f, 0.1f); float now = M.Now; if (!Dead) { Perceive(now); } if (PreferClimbUntil > 0f && now > PreferClimbUntil) { PreferClimb = false; PreferClimbUntil = 0f; } MoveGoal = Vector3N.None; WantSpeed = 0f; FacePos = Vector3N.None; Sideways = false; Backward = false; if (Air && !Brain.AirOK.Contains(StateName) && St.Group != "death") { Transient("fall_airborne"); } if (States.CalmGroups.Contains(St.Group) && Target != 255) { SetState("stalk_assess"); } int num = stateSerial; St.Behave?.Invoke(this, Sd, dt); if (num == stateSerial && Expired) { if (St.Timeout != null) { St.Timeout.Invoke(this, Sd); } else { DefaultNext(); } } if (now < detourUntil && !Dead) { MoveGoal = Pos + detour * 5.588f; WantSpeed = Mathf.Max(WantSpeed, RunSpeed * 0.6f); } if (Air) { AirStep(dt); } else { MoveStep(dt); } if (!Dead) { AntiStuck(dt, now); } BodyHeight = CurH; Airborne = Air; } private void DefaultNext() { string text = St.Group; if (!(text == "idle")) { if (!(text == "wander")) { if (!(text == "move")) { if (!(text == "death")) { if (text == "flee") { SetState("flee_recover"); } else { Hunt(); } } } else { Resume(); } } else { WanderNext(); } } else { IdleNext(); } } public float Goal(Vector3N pos, float frac = -1f) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!pos.Has) { return 3.4028235E+38f; } MoveGoal = pos; LastGoal = pos; WantSpeed = ((frac < 0f) ? St.Speed : frac) * RunSpeed; return Vector3.Distance(Pos, pos.V); } public void Face(Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) FacePos = pos; } public void Stop() { MoveGoal = Vector3N.None; WantSpeed = 0f; } public bool ClearPath(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return !Trace.Hull(a, b, 0.2286f).Hit; } private Vector3 Navigate(Vector3 goal, byte ent) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_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_004f: 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_0158: 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_012b: 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_0141: Unknown result type (might be due to invalid IL or missing references) float now = M.Now; Vector3 val; if (now < navNext && navPoint.Has && navGoal.Has) { val = navGoal.V - goal; if (((Vector3)(ref val)).sqrMagnitude < 2.6425753f) { return navPoint.V; } } navNext = now + 0.25f; navGoal = goal; if (ClearPath(Pos, goal)) { navPoint = goal; navPath = null; return goal; } if (ent != 255 && Trails.Waypoint(ent, Pos, ClearPath, 10, out var wp, out var _)) { navPoint = wp; return wp; } if (navPath == null || now > navPathT) { navPath = NavPath(Pos, goal); navPathT = now + 1.2f; } if (navPath != null && navPath.Count > 0) { while (navPath.Count > 1) { val = Pos - navPath[0]; if (!(((Vector3)(ref val)).sqrMagnitude < 3.161284f)) { break; } navPath.RemoveAt(0); } navPoint = navPath[0]; return navPath[0]; } navPoint = goal; return goal; } private static List<Vector3> NavPath(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_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: Expected O, but got Unknown //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_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_00bf: Unknown result type (might be due to invalid IL or missing references) try { NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(from, ref val, 6f, -1)) { return null; } NavMeshHit val2 = default(NavMeshHit); if (!NavMesh.SamplePosition(to, ref val2, 6f, -1)) { return null; } object obj = navMeshPath; if (obj == null) { NavMeshPath val3 = new NavMeshPath(); navMeshPath = val3; obj = (object)val3; } NavMeshPath val4 = (NavMeshPath)obj; if (!NavMesh.CalculatePath(((NavMeshHit)(ref val)).position, ((NavMeshHit)(ref val2)).position, -1, val4)) { return null; } Il2CppStructArray<Vector3> corners = val4.corners; if (corners == null || ((Il2CppArrayBase<Vector3>)(object)corners).Length == 0) { return null; } List<Vector3> val5 = new List<Vector3>(((Il2CppArrayBase<Vector3>)(object)corners).Length); for (int i = 1; i < ((Il2CppArrayBase<Vector3>)(object)corners).Length; i++) { val5.Add(((Il2CppArrayBase<Vector3>)(object)corners)[i] + Vector3.up * 0.3f); } val5.Add(to); return val5; } catch { return null; } } public float GoTo(Vector3N pos, float frac = -1f, byte ent = 255) { //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_001b: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!pos.Has) { return 3.4028235E+38f; } Vector3 val = Navigate(pos.V, ent); Goal(val, frac); LastGoal = pos; return Vector3.Distance(Pos, pos.V); } public float Pursue(byte id, float frac = -1f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (!Targets.TryGet(id, out var t)) { return 3.4028235E+38f; } float result = GoTo(t.Center, frac, id); MaybeDropOnto(t.Center); return result; } public bool MaybeDropOnto(Vector3 tp) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (Air || Up.y > -0.3f) { return false; } float num = Pos.y - tp.y; Vector3 val = M.Flat(tp - Pos); float magnitude = ((Vector3)(ref val)).magnitude; if (num > 1.016f && magnitude < Mathf.Max(1.778f, num * 0.45f) && !Trace.Line(Pos, tp).Static) { val = tp - Pos; Detach(((Vector3)(ref val)).normalized * 3.175f); return true; } return false; } public void Detach(Vector3 vel) { //IL_0008: 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_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) Air = true; Vel = vel + Up * 0.508f; } public void Leap(Vector3 target, float speed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0062: 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_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) Vector3 val = Pos + Up * 0.1524f; Vector3 val2 = target - val; Vector3 val3 = M.Flat(val2); float num = Mathf.Clamp(((Vector3)(ref val3)).magnitude / speed, 0.18f, 1.1f); float num2 = val2.y / num + 7.5f * num; Pos = val; Air = true; Vel = val3 / num + Vector3.up * Mathf.Min(num2, 17.78f); } private void ApplyOrientation() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = M.Flatten(Fwd, Up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = M.Flatten(Vector3.forward, Up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = M.Flatten(Vector3.right, Up); } } Fwd = ((Vector3)(ref val)).normalized; } private float DesiredHeight() { //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_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_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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) float restHeight = RestHeight; float num = restHeight * St.H; if (M.Now < squeezeUntil) { num = Mathf.Min(num, restHeight * 0.3f); } Vector3 val = Pos - Up * CurH; float num2 = restHeight * 1.4f + 0.3048f; float num3 = Trace.Line(val + Up * 0.0508f, val + Up * num2).Fraction * num2 + 0.0508f - 0.22311361f; Cramped = num3 < restHeight * 0.75f; return Mathf.Clamp(Mathf.Min(num, num3), restHeight * 0.22f, restHeight * 1.4f); } private void MoveStep(float dt) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0017: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_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_0139: 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_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_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_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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: 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_0099: 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_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_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_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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_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_0115: 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_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0355: 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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_044f: 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_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result typ