Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of FalseFriend v0.1.9
BepInEx/plugins/FalseFriend/FalseFriend.dll
Decompiled 13 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; using BepInEx; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using Photon.Voice; using Photon.Voice.Unity; using REPOLib.Modules; using UnityEngine; using UnityEngine.AI; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("FalseFriend")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.9.0")] [assembly: AssemblyInformationalVersion("0.1.9")] [assembly: AssemblyProduct("FalseFriend")] [assembly: AssemblyTitle("FalseFriend")] [assembly: AssemblyVersion("0.1.9.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace FalseFriend { internal static class AttackVoiceEffects { internal static void Configure(AudioSource source) { if (Object.op_Implicit((Object)(object)source)) { source.pitch = 1f; source.volume = Mathf.Clamp(source.volume, 0f, 0.68f); source.dopplerLevel = 0f; AudioReverbFilter val = ((Component)source).GetComponent<AudioReverbFilter>(); if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)source).gameObject.AddComponent<AudioReverbFilter>(); } val.reverbPreset = (AudioReverbPreset)27; val.dryLevel = 0f; val.room = -650f; val.roomHF = -1100f; val.roomLF = -350f; val.decayTime = 2.2f; val.decayHFRatio = 0.72f; val.reflectionsLevel = -1300f; val.reflectionsDelay = 0.025f; val.reverbLevel = -350f; val.reverbDelay = 0.04f; val.hfReference = 5000f; val.lfReference = 250f; val.diffusion = 95f; val.density = 100f; ((Behaviour)val).enabled = true; } } } public sealed class BiteAttackCycle { public const float Duration = 1.8f; public const float GrabAt = 0.5f; public const float BiteAt = 1f; public const float ReleaseAt = 1.3f; public const float Cooldown = 2.4f; private const float CancelRecovery = 0.6f; private bool damageSent; public bool Active { get; private set; } public int TargetActor { get; private set; } = -1; public float StartedAt { get; private set; } public float ReadyAt { get; private set; } public bool TryStart(float now, int targetActor) { if (!Finite(now) || Active || targetActor < 0 || now < ReadyAt) { return false; } float num = now + 2.4f; if (!Finite(num)) { return false; } Active = true; TargetActor = targetActor; StartedAt = now; ReadyAt = num; damageSent = false; return true; } public BiteAttackResult Tick(float now, bool targetValid) { if (!Active || !Finite(now) || now < StartedAt) { return default(BiteAttackResult); } if (!targetValid) { Cancel(now); return new BiteAttackResult(damageDue: false, finished: true, cancelled: true); } float num = now - StartedAt; int num2; if (!damageSent) { num2 = ((num >= 1f) ? 1 : 0); if (num2 != 0) { damageSent = true; } } else { num2 = 0; } bool flag = num >= 1.8f; if (flag) { Active = false; } return new BiteAttackResult((byte)num2 != 0, flag, cancelled: false); } public void Cancel(float now) { if (Active && Finite(now) && !(now < StartedAt)) { Active = false; float num = now + 0.6f; if (Finite(num)) { ReadyAt = Math.Max(ReadyAt, num); } } } public float Progress(float now) { if (!Active || !Finite(now)) { return -1f; } return Math.Max(0f, Math.Min(1f, (now - StartedAt) / 1.8f)); } public bool IsHolding(float now) { if (!Active || !Finite(now) || now < StartedAt) { return false; } float num = now - StartedAt; if (num >= 0.5f) { return num < 1.3f; } return false; } private static bool Finite(float value) { if (!float.IsNaN(value)) { return !float.IsInfinity(value); } return false; } } public readonly struct BiteAttackResult { public bool DamageDue { get; } public bool Finished { get; } public bool Cancelled { get; } public BiteAttackResult(bool damageDue, bool finished, bool cancelled) { DamageDue = damageDue; Finished = finished; Cancelled = cancelled; } } public sealed class BiteTeeth : MonoBehaviour { private struct RowGeometry { internal float Width; internal float Front; internal float BaseY; } private GameObject upperRow; private GameObject lowerRow; private Mesh upperMesh; private Mesh lowerMesh; private Material toothMaterial; private bool visible; private Transform upperAttachment; private Transform lowerAttachment; private MeshFilter upperFaceFilter; private MeshFilter lowerFaceFilter; private Bounds upperFallbackBounds; private Bounds lowerFallbackBounds; private RowGeometry upperGeometry; private RowGeometry lowerGeometry; private float nextFitCheck; public bool Bind(Transform upperAnchor, Transform lowerAnchor, MeshFilter upperFace, MeshFilter lowerFace) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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) ReleaseOwned(); if (!Object.op_Implicit((Object)(object)upperAnchor) || !Object.op_Implicit((Object)(object)lowerAnchor)) { return false; } upperAttachment = upperAnchor; lowerAttachment = lowerAnchor; upperFaceFilter = upperFace; lowerFaceFilter = lowerFace; Material val = null; if (Object.op_Implicit((Object)(object)upperFace)) { Renderer component = ((Component)upperFace).GetComponent<Renderer>(); if (Object.op_Implicit((Object)(object)component)) { val = component.sharedMaterial; } } if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)lowerFace)) { Renderer component2 = ((Component)lowerFace).GetComponent<Renderer>(); if (Object.op_Implicit((Object)(object)component2)) { val = component2.sharedMaterial; } } toothMaterial = MakeMaterial(val); if (!Object.op_Implicit((Object)(object)toothMaterial)) { return false; } Bounds fallback = default(Bounds); ((Bounds)(ref fallback))..ctor(new Vector3(0f, 0.1777161f, -0.0056864f), new Vector3(0.5065639f, 0.3928213f, 0.5260162f)); Bounds fallback2 = default(Bounds); ((Bounds)(ref fallback2))..ctor(new Vector3(0f, -0.173047f, 0f), new Vector3(0.5080513f, 0.3596793f, 0.5080513f)); upperFallbackBounds = fallback; lowerFallbackBounds = fallback2; Bounds bounds = BoundsInAnchor(upperFace, upperAnchor, fallback); Bounds bounds2 = BoundsInAnchor(lowerFace, lowerAnchor, fallback2); RowGeometry row = FitRow(bounds, upper: true); RowGeometry row2 = FitRow(bounds2, upper: false); upperGeometry = row; lowerGeometry = row2; upperMesh = BuildRow(row, 8, -1f); lowerMesh = BuildRow(row2, 9, 1f); upperRow = MakeRow("False Friend — Upper Teeth", upperAnchor, upperMesh, row.BaseY); lowerRow = MakeRow("False Friend — Lower Teeth", lowerAnchor, lowerMesh, row2.BaseY); upperRow.SetActive(false); lowerRow.SetActive(false); visible = false; nextFitCheck = Time.time + 0.5f; return true; } private void Update() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)upperRow) || !Object.op_Implicit((Object)(object)lowerRow) || !Object.op_Implicit((Object)(object)upperAttachment) || !Object.op_Implicit((Object)(object)lowerAttachment) || Time.time < nextFitCheck) { return; } nextFitCheck = Time.time + 0.5f; RowGeometry rowGeometry = FitRow(BoundsInAnchor(upperFaceFilter, upperAttachment, upperFallbackBounds), upper: true); RowGeometry rowGeometry2 = FitRow(BoundsInAnchor(lowerFaceFilter, lowerAttachment, lowerFallbackBounds), upper: false); if (Different(rowGeometry, upperGeometry)) { Mesh sharedMesh = BuildRow(rowGeometry, 8, -1f); upperRow.GetComponent<MeshFilter>().sharedMesh = sharedMesh; if (Object.op_Implicit((Object)(object)upperMesh)) { Object.Destroy((Object)(object)upperMesh); } upperMesh = sharedMesh; upperRow.transform.localPosition = new Vector3(0f, rowGeometry.BaseY, 0f); upperGeometry = rowGeometry; } if (Different(rowGeometry2, lowerGeometry)) { Mesh sharedMesh2 = BuildRow(rowGeometry2, 9, 1f); lowerRow.GetComponent<MeshFilter>().sharedMesh = sharedMesh2; if (Object.op_Implicit((Object)(object)lowerMesh)) { Object.Destroy((Object)(object)lowerMesh); } lowerMesh = sharedMesh2; lowerRow.transform.localPosition = new Vector3(0f, rowGeometry2.BaseY, 0f); lowerGeometry = rowGeometry2; } } private static bool Different(RowGeometry a, RowGeometry b) { if (!(Mathf.Abs(a.Width - b.Width) > 0.002f) && !(Mathf.Abs(a.Front - b.Front) > 0.002f)) { return Mathf.Abs(a.BaseY - b.BaseY) > 0.002f; } return true; } public void SetAttackProgress(float progress) { //IL_00a0: 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) if (Object.op_Implicit((Object)(object)upperRow) && Object.op_Implicit((Object)(object)lowerRow)) { bool flag = !float.IsNaN(progress) && progress >= 0.045f && progress < 13f / 18f; if (flag != visible) { upperRow.SetActive(flag); lowerRow.SetActive(flag); visible = flag; } if (flag) { float num = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.045f, 0.2f, progress)); Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(1f, num, 1f); upperRow.transform.localScale = localScale; lowerRow.transform.localScale = localScale; } } } private GameObject MakeRow(string name, Transform parent, Mesh mesh, float baseY) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown GameObject val = new GameObject(name) { layer = 0 }; val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, baseY, 0f); val.transform.localRotation = Quaternion.identity; val.AddComponent<MeshFilter>().sharedMesh = mesh; MeshRenderer obj = val.AddComponent<MeshRenderer>(); ((Renderer)obj).sharedMaterial = toothMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)obj).receiveShadows = true; ((Renderer)obj).lightProbeUsage = (LightProbeUsage)1; ((Renderer)obj).reflectionProbeUsage = (ReflectionProbeUsage)1; return val; } private static RowGeometry FitRow(Bounds bounds, bool upper) { //IL_0002: 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_007e: 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) float width = Mathf.Clamp(((Bounds)(ref bounds)).size.x, 0.34f, 0.68f); return new RowGeometry { Width = width, Front = Mathf.Clamp(((Bounds)(ref bounds)).max.z - 0.022f, 0.12f, 0.34f), BaseY = (upper ? Mathf.Clamp(((Bounds)(ref bounds)).min.y + 0.007f, -0.07f, 0.07f) : Mathf.Clamp(((Bounds)(ref bounds)).max.y - 0.007f, -0.07f, 0.07f)) }; } private static Bounds BoundsInAnchor(MeshFilter filter, Transform anchor, Bounds fallback) { //IL_0015: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)filter) || !Object.op_Implicit((Object)(object)filter.sharedMesh)) { return fallback; } Bounds bounds = filter.sharedMesh.bounds; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity); for (int i = 0; i < 8; i++) { Vector3 val3 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3(((i & 1) == 0) ? (-1f) : 1f, ((i & 2) == 0) ? (-1f) : 1f, ((i & 4) == 0) ? (-1f) : 1f)); Vector3 val4 = anchor.InverseTransformPoint(((Component)filter).transform.TransformPoint(val3)); val = Vector3.Min(val, val4); val2 = Vector3.Max(val2, val4); } Bounds result = default(Bounds); ((Bounds)(ref result)).SetMinMax(val, val2); if (!(((Bounds)(ref result)).size.x > 0.1f) || !(((Bounds)(ref result)).size.x < 2f)) { return fallback; } return result; } private static Mesh BuildRow(RowGeometry row, int count, float direction) { //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_011b: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0237: 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_023b: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: 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_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) List<Vector3> vertices = new List<Vector3>(count * 18); List<int> list = new List<int>(count * 18); float num = row.Width * 0.435f; float num2 = Mathf.Clamp(row.Width / 0.507f, 0.8f, 1.3f); Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); Vector3 val3; int num5; float num6; float num7; float num8; float num9; Vector3 val4; Vector3 val5; Vector3 val6; Vector3 val7; Vector3 val8; Vector3 val9; for (int i = 0; i < count; num7 = num6 * num2, num8 = ((num5 != 0) ? 0.023f : 0.019f) * num2, num9 = 0.018f * num2, val4 = val3 - val2 * num8 - val * num9, val5 = val3 + val2 * num8 - val * num9, val6 = val3 + val2 * num8 + val * num9, val7 = val3 - val2 * num8 + val * num9, val8 = val3 + Vector3.up * (direction * num7) + val * 0.004f, val9 = val3 + Vector3.up * (direction * num7 * 0.25f), AddFace(vertices, list, val4, val5, val8, (val4 + val5 + val8) / 3f - val9), AddFace(vertices, list, val5, val6, val8, (val5 + val6 + val8) / 3f - val9), AddFace(vertices, list, val6, val7, val8, (val6 + val7 + val8) / 3f - val9), AddFace(vertices, list, val7, val4, val8, (val7 + val4 + val8) / 3f - val9), AddFace(vertices, list, val4, val6, val5, Vector3.up * (0f - direction)), AddFace(vertices, list, val4, val7, val6, Vector3.up * (0f - direction)), i++) { float num3 = ((count > 1) ? ((float)i / (float)(count - 1)) : 0.5f); float num4 = Mathf.Lerp(-64f, 64f, num3) * (MathF.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num4), 0f, Mathf.Cos(num4)); ((Vector3)(ref val2))..ctor(Mathf.Cos(num4), 0f, 0f - Mathf.Sin(num4)); val3 = new Vector3(Mathf.Sin(num4) * num, 0f, row.Front - num * (1f - Mathf.Cos(num4))); if (i != 1) { num5 = ((i == count - 2) ? 1 : 0); if (num5 == 0) { num6 = ((i % 2 == 0) ? 0.077f : 0.067f); continue; } } else { num5 = 1; } num6 = 0.102f; } Mesh val10 = new Mesh { name = ((direction < 0f) ? "FalseFriend Upper Sharp Teeth" : "FalseFriend Lower Sharp Teeth") }; val10.SetVertices(vertices); val10.SetTriangles(list, 0, true); val10.RecalculateNormals(); val10.RecalculateBounds(); val10.UploadMeshData(true); return val10; } private static void AddFace(List<Vector3> vertices, List<int> indices, Vector3 a, Vector3 b, Vector3 c, Vector3 outward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(Vector3.Cross(b - a, c - a), outward) < 0f) { Vector3 val = b; b = c; c = val; } int count = vertices.Count; vertices.Add(a); vertices.Add(b); vertices.Add(c); indices.Add(count); indices.Add(count + 1); indices.Add(count + 2); } private static Material MakeMaterial(Material template) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown Material val; if (Object.op_Implicit((Object)(object)template)) { val = new Material(template); } else { Shader val2 = Shader.Find("Standard") ?? Shader.Find("Legacy Shaders/Diffuse") ?? Shader.Find("Unlit/Color"); if (!Object.op_Implicit((Object)(object)val2)) { return null; } val = new Material(val2); } ((Object)val).name = "FalseFriend Ivory Metal Teeth (owned)"; ((Object)val).hideFlags = (HideFlags)52; Color value = default(Color); ((Color)(ref value))..ctor(0.88f, 0.85f, 0.74f, 1f); SetColor(val, "_AlbedoColor", value); SetColor(val, "_BaseColor", value); SetColor(val, "_Color", value); SetColor(val, "_EmissionColor", Color.black); SetColor(val, "_FresnelColor", new Color(0.16f, 0.16f, 0.13f, 1f)); SetFloat(val, "_Metallic", 0.16f); SetFloat(val, "_Smoothness", 0.25f); SetFloat(val, "_Glossiness", 0.25f); val.enableInstancing = true; return val; } private static void SetColor(Material material, string property, Color value) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (material.HasProperty(property)) { material.SetColor(property, value); } } private static void SetFloat(Material material, string property, float value) { if (material.HasProperty(property)) { material.SetFloat(property, value); } } private void ReleaseOwned() { if (Object.op_Implicit((Object)(object)upperRow)) { Object.Destroy((Object)(object)upperRow); } if (Object.op_Implicit((Object)(object)lowerRow)) { Object.Destroy((Object)(object)lowerRow); } if (Object.op_Implicit((Object)(object)upperMesh)) { Object.Destroy((Object)(object)upperMesh); } if (Object.op_Implicit((Object)(object)lowerMesh)) { Object.Destroy((Object)(object)lowerMesh); } if (Object.op_Implicit((Object)(object)toothMaterial)) { Object.Destroy((Object)(object)toothMaterial); } upperRow = (lowerRow = null); upperMesh = (lowerMesh = null); toothMaterial = null; visible = false; } private void OnDestroy() { ReleaseOwned(); } } [HarmonyPatch(typeof(HurtCollider), "Update")] internal static class CombatBridge { private static readonly MethodInfo CanHit = AccessTools.Method(typeof(HurtCollider), "CanHit", (Type[])null, (Type[])null); [HarmonyPostfix] private static void AfterUpdate(HurtCollider __instance) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) MimicActor mimicActor = (Object.op_Implicit((Object)(object)Plugin.Director) ? Plugin.Director.Active : null); if (!Object.op_Implicit((Object)(object)mimicActor) || !mimicActor.Authority || !GameBridge.InExpedition || !Object.op_Implicit((Object)(object)__instance) || !((Behaviour)__instance).isActiveAndEnabled || !__instance.enemyLogic || Object.op_Implicit((Object)(object)__instance.enemyHost) || __instance.enemyDamageCooldown <= 0f || CanHit == null) { return; } Collider component = ((Component)__instance).GetComponent<Collider>(); CapsuleCollider component2 = ((Component)mimicActor).GetComponent<CapsuleCollider>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2)) { return; } Bounds bounds = component.bounds; Vector3 val = default(Vector3); float num = default(float); if (!((Bounds)(ref bounds)).Intersects(((Collider)component2).bounds) || !Physics.ComputePenetration(component, ((Component)component).transform.position, ((Component)component).transform.rotation, (Collider)(object)component2, ((Component)component2).transform.position, ((Component)component2).transform.rotation, ref val, ref num)) { return; } Vector3 val2 = ((Component)mimicActor).transform.position + Vector3.up * 0.8f; if (__instance.enemyRayCast) { bounds = component.bounds; if (!GameBridge.Visible(((Bounds)(ref bounds)).center, val2)) { return; } } if (!(bool)CanHit.Invoke(__instance, new object[5] { ((Component)mimicActor).gameObject, Mathf.Max(0.25f, __instance.enemyDamageCooldown), false, val2, (object)(HitType)2 })) { return; } if (__instance.enemyKill) { mimicActor.TakeDamage(1000); } else { if (__instance.enemyDamage > 0) { mimicActor.TakeDamage(__instance.enemyDamage); } if (Object.op_Implicit((Object)(object)mimicActor) && __instance.enemyStun) { mimicActor.Stun(__instance.enemyStunTime); } } UnityEvent onImpactAny = __instance.onImpactAny; if (onImpactAny != null) { onImpactAny.Invoke(); } } } internal sealed class DisguiseIdentityPolicy { private bool bound; private bool observedAlive; internal bool ReplacementAllowed { get; private set; } internal void Bind(bool sourceDead) { bound = true; observedAlive = !sourceDead; ReplacementAllowed = false; } internal void Observe(bool sourceDead) { if (bound) { if (!sourceDead) { observedAlive = true; } else if (observedAlive) { ReplacementAllowed = true; } } } } public sealed class DisguiseVisual : MonoBehaviour { private sealed class RendererPair { internal Renderer Source; internal Renderer Copy; } private sealed class RigPose { internal Transform Target; internal Vector3 Position; internal Quaternion Rotation; internal Vector3 Scale; internal Vector3 RestPosition; internal Quaternion RestRotation; } private readonly Dictionary<Transform, Transform> transforms = new Dictionary<Transform, Transform>(); private readonly List<RendererPair> renderers = new List<RendererPair>(); private readonly HashSet<int> boolParameters = new HashSet<int>(); private readonly HashSet<int> triggerParameters = new HashSet<int>(); private readonly MaterialPropertyBlock properties = new MaterialPropertyBlock(); private GameObject visualRoot; private PlayerAvatarVisuals sourceVisuals; private Animator animator; private BiteTeeth biteTeeth; private GameObject animationTarget; private AnimationClip standClip; private AnimationClip walkClip; private AnimationClip sprintClip; private AnimationClip jumpClip; private AnimationClip fallClip; private AnimationClip landClip; private AnimationClip flatHeadClip; private AnimationClip flatBodyClip; private readonly List<RigPose> rigPoses = new List<RigPose>(); private RigPose leftLegBottom; private RigPose rightLegBottom; private RigPose leftLegTop; private RigPose rightLegTop; private float gaitPhase; private float gaitBlend; private float planarSpeed; private bool sprintingGait; private float attackProgress = -1f; private float jumpProgress = -1f; private Vector3 victimPosition; private Random glanceRandom; private float nextGlance; private float glanceYaw; private float glancePitch; private float glanceEyeYaw; private float gazeYaw; private float gazePitch; private float gazeSpeed = 210f; private Vector3 lookPoint; private float lookPointUntil; private Transform jaw; private Transform lean; private Transform headSide; private Transform headUp; private Transform bodyTopUp; private Transform bodyTopSide; private Transform headLook; private Transform tilt; private Transform legTwist; private Transform rightArm; private Transform leftArm; private Transform sourceRightArm; private Transform sourceLeftArm; private Transform rightArmParent; private Transform eyeLeft; private Transform eyeRight; private Quaternion armBase; private Quaternion leftArmBase; private Vector3 leftArmScale; private Vector3 rightArmScale; private readonly HashSet<Transform> hiddenToolTransforms = new HashSet<Transform>(); private Transform pupilLeft; private Transform pupilRight; private Quaternion jawRest; private Quaternion leanRest; private Quaternion headRest; private Vector3 leftPupilRest; private Vector3 rightPupilRest; private Vector3 velocity; private bool aggressive; private bool wasSprinting; private float speechTarget; private float speech; private float nextRefresh; private float previousYaw; private int structureHash; private int animatorControllerId; private bool flatHead; private bool flatBody; public PlayerAvatar Source { get; private set; } public bool HasVisibleModel { get { if ((Object)(object)visualRoot != (Object)null) { return renderers.Count > 0; } return false; } } public bool UsesNativeGait { get { if (Object.op_Implicit((Object)(object)standClip)) { return Object.op_Implicit((Object)(object)walkClip); } return false; } } public bool Bind(PlayerAvatar source) { if (!Object.op_Implicit((Object)(object)source) || !Object.op_Implicit((Object)(object)source.playerAvatarVisuals)) { return false; } Source = source; sourceVisuals = source.playerAvatarVisuals; if (glanceRandom == null) { glanceRandom = new Random((((Object)this).GetInstanceID() * 397) ^ ((Object)source).GetInstanceID()); } nextRefresh = Time.unscaledTime + 0.5f; return Rebuild(); } public void SetMotion(Vector3 worldVelocity, bool isAggressive) { //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) velocity = worldVelocity; aggressive = isAggressive; } public void SetSpeechAmplitude(float amplitude) { speechTarget = Mathf.Clamp01(amplitude); } public void SetAttackPose(float progress, Vector3 worldVictimPosition) { //IL_0023: 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_003d: 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_0057: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) attackProgress = ((float.IsNaN(progress) || progress < 0f) ? (-1f) : Mathf.Clamp01(progress)); if (!float.IsNaN(worldVictimPosition.x) && !float.IsInfinity(worldVictimPosition.x) && !float.IsNaN(worldVictimPosition.y) && !float.IsInfinity(worldVictimPosition.y) && !float.IsNaN(worldVictimPosition.z) && !float.IsInfinity(worldVictimPosition.z)) { victimPosition = worldVictimPosition; } } public void SetJumpPose(float normalizedProgress) { jumpProgress = ((float.IsNaN(normalizedProgress) || float.IsInfinity(normalizedProgress) || normalizedProgress < 0f) ? (-1f) : Mathf.Clamp01(normalizedProgress)); } public void SetLookDirection(Vector3 worldPoint) { //IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references) if (Finite(worldPoint)) { lookPoint = worldPoint; lookPointUntil = Time.time + 0.3f; } } private void Update() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)sourceVisuals) && Time.unscaledTime >= nextRefresh) { nextRefresh = Time.unscaledTime + 0.5f; int num = StructuralFingerprint(((Component)sourceVisuals).transform); Animator val = FindSourceAnimator(); int num2 = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.runtimeAnimatorController)) ? ((Object)val.runtimeAnimatorController).GetInstanceID() : 0); if (num != structureHash || num2 != animatorControllerId) { Rebuild(); } else { SynchronizeAppearance(); } } Vector2 val2 = new Vector2(velocity.x, velocity.z); float magnitude = ((Vector2)(ref val2)).magnitude; planarSpeed = Mathf.Lerp(planarSpeed, magnitude, 1f - Mathf.Exp(-16f * Time.deltaTime)); bool flag = attackProgress < 0f && planarSpeed > 0.08f; bool flag2 = (sprintingGait = flag && aggressive && magnitude > 2.4f); gaitBlend = Mathf.MoveTowards(gaitBlend, flag ? 1f : 0f, Time.deltaTime * 8f); AnimationClip val3 = ((flag2 && Object.op_Implicit((Object)(object)sprintClip)) ? sprintClip : walkClip); float num3 = (Object.op_Implicit((Object)(object)val3) ? ((flag2 ? 4.3f : 2.6f) * Mathf.Max(0.1f, val3.length)) : (flag2 ? 1.8f : 2.17f)); if (flag) { gaitPhase = Mathf.Repeat(gaitPhase + planarSpeed * Time.deltaTime / num3, 1f); } if (!Object.op_Implicit((Object)(object)animator) || UsesNativeGait) { return; } float y = ((Component)this).transform.eulerAngles.y; bool value = !flag && Mathf.Abs(Mathf.DeltaAngle(previousYaw, y)) > 0.3f; previousYaw = y; SetBool("Moving", flag); SetBool("Sprinting", flag2); SetBool("Turning", value); SetBool("Crouching", value: false); SetBool("Crawling", value: false); SetBool("Tumbling", value: false); SetBool("TumblingMove", value: false); SetBool("Grabbing", value: false); SetBool("Sliding", value: false); SetBool("Jumping", value: false); SetBool("Falling", value: false); if (flag2 && !wasSprinting) { int num4 = Animator.StringToHash("SprintingImpulse"); if (triggerParameters.Contains(num4)) { animator.SetTrigger(num4); } } wasSprinting = flag2; animator.speed = (flag ? Mathf.Clamp(magnitude / (flag2 ? 4f : 2f), 0.65f, 1.6f) : 1f); } private void LateUpdate() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) EvaluateLocomotion(); ApplyJumpPose(); float num = 1f - Mathf.Exp(-24f * Time.deltaTime); speech = Mathf.Lerp(speech, speechTarget, num); if (Object.op_Implicit((Object)(object)jaw)) { jaw.localRotation = jawRest * Quaternion.Euler(-38f * speech, 0f, 0f); } if (Object.op_Implicit((Object)(object)lean)) { Vector3 val = ((Component)this).transform.InverseTransformDirection(velocity); Quaternion val2 = leanRest * Quaternion.Euler(Mathf.Clamp(val.z * 1.2f, -6f, 8f), 0f, Mathf.Clamp((0f - val.x) * 1.2f, -5f, 5f)); lean.localRotation = Quaternion.Slerp(lean.localRotation, val2, num); } ApplyGlancePose(); if (Object.op_Implicit((Object)(object)bodyTopUp)) { bodyTopUp.localRotation = Quaternion.identity; } if (Object.op_Implicit((Object)(object)bodyTopSide)) { bodyTopSide.localRotation = (Object.op_Implicit((Object)(object)headSide) ? Quaternion.Slerp(Quaternion.identity, headSide.localRotation, 0.5f) : Quaternion.identity); } if (Object.op_Implicit((Object)(object)headLook)) { headLook.localRotation = Quaternion.identity; } if (Object.op_Implicit((Object)(object)tilt)) { tilt.localRotation = Quaternion.identity; } if (Object.op_Implicit((Object)(object)legTwist)) { legTwist.localRotation = Quaternion.identity; } if (Object.op_Implicit((Object)(object)rightArm)) { rightArm.localRotation = armBase; } if (Object.op_Implicit((Object)(object)leftArm)) { leftArm.localRotation = leftArmBase; } if (Object.op_Implicit((Object)(object)rightArm)) { rightArm.localScale = rightArmScale; } if (Object.op_Implicit((Object)(object)leftArm)) { leftArm.localScale = leftArmScale; } if (Object.op_Implicit((Object)(object)rightArmParent)) { rightArmParent.localRotation = Quaternion.identity; } float num2 = (aggressive ? 0.8f : 1f); if (Object.op_Implicit((Object)(object)pupilLeft)) { pupilLeft.localScale = leftPupilRest * num2; } if (Object.op_Implicit((Object)(object)pupilRight)) { pupilRight.localScale = rightPupilRest * num2; } ApplyAttackPose(); if (Object.op_Implicit((Object)(object)biteTeeth)) { biteTeeth.SetAttackProgress(attackProgress); } } private void SetBool(string parameter, bool value) { int num = Animator.StringToHash(parameter); if (boolParameters.Contains(num)) { animator.SetBool(num, value); } } private bool Rebuild() { //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: 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_0370: Invalid comparison between Unknown and I4 //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Invalid comparison between Unknown and I4 //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_069e: 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_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_0776: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0788: 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_0795: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)sourceVisuals)) { return false; } GameObject val = visualRoot; if (Object.op_Implicit((Object)(object)val)) { val.SetActive(false); } transforms.Clear(); rigPoses.Clear(); renderers.Clear(); boolParameters.Clear(); triggerParameters.Clear(); hiddenToolTransforms.Clear(); animator = null; biteTeeth = null; animationTarget = null; standClip = (walkClip = (sprintClip = (jumpClip = (fallClip = (landClip = (flatHeadClip = (flatBodyClip = null))))))); jaw = (lean = (headSide = (pupilLeft = (pupilRight = null)))); headUp = (bodyTopUp = (bodyTopSide = (headLook = (tilt = (legTwist = (leftArm = (rightArm = (rightArmParent = (eyeLeft = (eyeRight = null)))))))))); sourceLeftArm = (sourceRightArm = null); visualRoot = new GameObject(((Object)((Component)sourceVisuals).gameObject).name); visualRoot.SetActive(false); visualRoot.transform.SetParent(((Component)this).transform, false); visualRoot.transform.localPosition = Vector3.zero; visualRoot.transform.localRotation = Quaternion.identity; visualRoot.transform.localScale = ((Component)sourceVisuals).transform.lossyScale; transforms.Add(((Component)sourceVisuals).transform, visualRoot.transform); CloneTransforms(((Component)sourceVisuals).transform, visualRoot.transform); CopyRenderers(); CopyLodGroups(); Animator val2 = FindSourceAnimator(); animatorControllerId = ((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.runtimeAnimatorController)) ? ((Object)val2.runtimeAnimatorController).GetInstanceID() : 0); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.runtimeAnimatorController)) { Transform val3 = Mapped(((Component)val2).transform); if (!Object.op_Implicit((Object)(object)val3)) { val3 = visualRoot.transform; } animator = ((Component)val3).gameObject.AddComponent<Animator>(); animationTarget = ((Component)val3).gameObject; animator.runtimeAnimatorController = val2.runtimeAnimatorController; animator.avatar = val2.avatar; animator.applyRootMotion = false; animator.cullingMode = (AnimatorCullingMode)0; animator.fireEvents = false; CacheNativeClips(val2.runtimeAnimatorController); ((Behaviour)animator).enabled = !UsesNativeGait; AnimatorControllerParameter[] parameters = animator.parameters; foreach (AnimatorControllerParameter val4 in parameters) { if ((int)val4.type == 4) { boolParameters.Add(val4.nameHash); } else if ((int)val4.type == 9) { triggerParameters.Add(val4.nameHash); } } } lean = Mapped(sourceVisuals.leanTransform); headSide = Mapped(sourceVisuals.headSideTransform); headUp = Mapped(sourceVisuals.headUpTransform); bodyTopUp = Mapped(sourceVisuals.bodyTopUpTransform); bodyTopSide = Mapped(sourceVisuals.bodyTopSideTransform); headLook = Mapped(sourceVisuals.headLookAtTransform); tilt = Mapped(sourceVisuals.tiltTransform); legTwist = Mapped(sourceVisuals.legTwistTransform); PlayerAvatarRightArm component = ((Component)sourceVisuals).GetComponent<PlayerAvatarRightArm>(); if (Object.op_Implicit((Object)(object)component)) { rightArm = Mapped(component.rightArmTransform); sourceRightArm = component.rightArmTransform; rightArmParent = Mapped(component.rightArmParentTransform); armBase = Quaternion.Euler(component.basePose); if (Object.op_Implicit((Object)(object)component.grabberClawParent)) { hiddenToolTransforms.Add(component.grabberClawParent); } if (Object.op_Implicit((Object)(object)component.grabberOrb)) { hiddenToolTransforms.Add(component.grabberOrb); } if (Object.op_Implicit((Object)(object)component.mapToolController) && Object.op_Implicit((Object)(object)component.mapToolController.VisualTransform)) { hiddenToolTransforms.Add(component.mapToolController.VisualTransform); } } PlayerAvatarLeftArm component2 = ((Component)sourceVisuals).GetComponent<PlayerAvatarLeftArm>(); if (Object.op_Implicit((Object)(object)component2)) { leftArm = Mapped(component2.leftArmTransform); sourceLeftArm = component2.leftArmTransform; leftArmBase = Quaternion.Euler(component2.basePose); } PlayerAvatarTalkAnimation component3 = ((Component)sourceVisuals).GetComponent<PlayerAvatarTalkAnimation>(); if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component3.objectToRotate)) { jaw = Mapped(component3.objectToRotate.transform); } if (Object.op_Implicit((Object)(object)sourceVisuals.playerEyes)) { pupilLeft = Mapped(sourceVisuals.playerEyes.pupilLeft); pupilRight = Mapped(sourceVisuals.playerEyes.pupilRight); eyeLeft = Mapped(sourceVisuals.playerEyes.eyeLeft); eyeRight = Mapped(sourceVisuals.playerEyes.eyeRight); } jawRest = Quaternion.identity; leanRest = Quaternion.identity; headRest = Quaternion.identity; leftPupilRest = (Object.op_Implicit((Object)(object)pupilLeft) ? pupilLeft.localScale : Vector3.one); rightPupilRest = (Object.op_Implicit((Object)(object)pupilRight) ? pupilRight.localScale : Vector3.one); structureHash = StructuralFingerprint(((Component)sourceVisuals).transform); SynchronizeAppearance(); visualRoot.SetActive(true); if (Object.op_Implicit((Object)(object)animator)) { animator.Rebind(); if (!UsesNativeGait) { animator.Update(0f); } else { standClip.SampleAnimation(animationTarget, 0f); } SynchronizeAppearance(); } foreach (Transform value in transforms.Values) { if (Object.op_Implicit((Object)(object)value) && !((Object)(object)value == (Object)(object)visualRoot.transform)) { rigPoses.Add(new RigPose { Target = value, Position = value.localPosition, Rotation = value.localRotation, Scale = value.localScale, RestPosition = value.localPosition, RestRotation = value.localRotation }); } } leftLegBottom = PoseNamed("ANIM LEG L BOT"); rightLegBottom = PoseNamed("ANIM LEG R BOT"); leftLegTop = PoseNamed("ANIM LEG L TOP"); rightLegTop = PoseNamed("ANIM LEG R TOP"); BindBiteTeeth(); previousYaw = ((Component)this).transform.eulerAngles.y; if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } return renderers.Count > 0; } private void BindBiteTeeth() { Transform val = Mapped(sourceVisuals.attachPointJawTop); Transform val2 = Mapped(sourceVisuals.attachPointJawBottom); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2)) { MeshFilter upperFace = MouthMesh("mesh_head_top"); MeshFilter lowerFace = MouthMesh(flatHead ? "mesh_head_bot_flat" : "mesh_head_bot_sphere"); biteTeeth = visualRoot.AddComponent<BiteTeeth>(); if (!biteTeeth.Bind(val, val2, upperFace, lowerFace)) { Object.Destroy((Object)(object)biteTeeth); biteTeeth = null; } } } private MeshFilter MouthMesh(string sourceName) { foreach (RendererPair renderer in renderers) { if (Object.op_Implicit((Object)(object)renderer.Source) && Object.op_Implicit((Object)(object)renderer.Copy) && ((Object)renderer.Source).name == sourceName) { return ((Component)renderer.Copy).GetComponent<MeshFilter>(); } } return null; } private Animator FindSourceAnimator() { if (!Object.op_Implicit((Object)(object)sourceVisuals)) { return null; } Animator component = ((Component)sourceVisuals).GetComponent<Animator>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.runtimeAnimatorController)) { return component; } Animator[] componentsInChildren = ((Component)sourceVisuals).GetComponentsInChildren<Animator>(true); foreach (Animator val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.runtimeAnimatorController)) { return val; } } return null; } private void CacheNativeClips(RuntimeAnimatorController controller) { if (!Object.op_Implicit((Object)(object)controller)) { return; } AnimationClip[] animationClips = controller.animationClips; foreach (AnimationClip val in animationClips) { if (Object.op_Implicit((Object)(object)val)) { switch (((Object)val).name) { case "PlayerAvatar - Stand": standClip = val; break; case "PlayerAvatar - Stand Move": walkClip = val; break; case "PlayerAvatar - Sprint": sprintClip = val; break; case "PlayerAvatar - Jump": jumpClip = val; break; case "PlayerAvatar - Fall": fallClip = val; break; case "PlayerAvatar - Land": landClip = val; break; case "PlayerAvatar - Override Head Bottom Flat": flatHeadClip = val; break; case "PlayerAvatar - Override Body Top Flat": flatBodyClip = val; break; } } } } private RigPose PoseNamed(string name) { foreach (RigPose rigPose in rigPoses) { if (Object.op_Implicit((Object)(object)rigPose.Target) && ((Object)rigPose.Target).name == name) { return rigPose; } } return null; } private void EvaluateLocomotion() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0229: 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_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)visualRoot)) { return; } visualRoot.transform.localPosition = Vector3.zero; visualRoot.transform.localRotation = Quaternion.identity; if (!UsesNativeGait || !Object.op_Implicit((Object)(object)animationTarget)) { ApplyFallbackLeg(leftLegBottom, leftLegTop, gaitPhase); ApplyFallbackLeg(rightLegBottom, rightLegTop, Mathf.Repeat(gaitPhase + 0.5f, 1f)); return; } Transform transform = animationTarget.transform; Vector3 localPosition = transform.localPosition; Quaternion localRotation = transform.localRotation; Vector3 localScale = transform.localScale; standClip.SampleAnimation(animationTarget, Mathf.Repeat(Time.time, Mathf.Max(0.01f, standClip.length))); if (gaitBlend > 0.001f) { bool flag = gaitBlend < 0.999f; if (flag) { foreach (RigPose rigPose in rigPoses) { if (Object.op_Implicit((Object)(object)rigPose.Target)) { rigPose.Position = rigPose.Target.localPosition; rigPose.Rotation = rigPose.Target.localRotation; rigPose.Scale = rigPose.Target.localScale; } } } AnimationClip val = ((sprintingGait && Object.op_Implicit((Object)(object)sprintClip)) ? sprintClip : walkClip); val.SampleAnimation(animationTarget, gaitPhase * val.length); if (flag) { foreach (RigPose rigPose2 in rigPoses) { if (Object.op_Implicit((Object)(object)rigPose2.Target)) { rigPose2.Target.localPosition = Vector3.Lerp(rigPose2.Position, rigPose2.Target.localPosition, gaitBlend); rigPose2.Target.localRotation = Quaternion.Slerp(rigPose2.Rotation, rigPose2.Target.localRotation, gaitBlend); rigPose2.Target.localScale = Vector3.Lerp(rigPose2.Scale, rigPose2.Target.localScale, gaitBlend); } } } } if (flatHead && Object.op_Implicit((Object)(object)flatHeadClip)) { flatHeadClip.SampleAnimation(animationTarget, 0f); } if (flatBody && Object.op_Implicit((Object)(object)flatBodyClip)) { flatBodyClip.SampleAnimation(animationTarget, 0f); } transform.localPosition = localPosition; transform.localRotation = localRotation; transform.localScale = localScale; } private void ApplyFallbackLeg(RigPose bottom, RigPose top, float phase) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if (bottom != null && Object.op_Implicit((Object)(object)bottom.Target)) { float num = Mathf.Sin(phase * MathF.PI * 2f) * gaitBlend; float num2 = Mathf.Max(0f, num) * (sprintingGait ? 0.16f : 0.11f); bottom.Target.localPosition = bottom.RestPosition + new Vector3(0f, num2, num * 0.13f); bottom.Target.localRotation = bottom.RestRotation * Quaternion.Euler(num * 12f, 0f, 0f); if (top != null && Object.op_Implicit((Object)(object)top.Target)) { top.Target.localRotation = top.RestRotation * Quaternion.Euler((0f - num) * 22f, 0f, 0f); } } } private void ApplyJumpPose() { //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) if (jumpProgress < 0f || attackProgress >= 0f || !Object.op_Implicit((Object)(object)visualRoot)) { return; } float num = jumpProgress; float num2 = Mathf.Min(Mathf.SmoothStep(0f, 1f, num / 0.1f), Mathf.SmoothStep(0f, 1f, (1f - num) / 0.16f)); AnimationClip val = ((num < 0.28f) ? jumpClip : ((num < 0.78f) ? fallClip : landClip)); float num3 = ((num < 0.28f) ? (num / 0.28f) : ((num < 0.78f) ? ((num - 0.28f) / 0.5f) : ((num - 0.78f) / 0.22f))); if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)jumpClip)) { val = jumpClip; num3 = ((num < 0.28f) ? (num / 0.28f) : 1f); } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)animationTarget) && num2 > 0.001f) { foreach (RigPose rigPose in rigPoses) { if (Object.op_Implicit((Object)(object)rigPose.Target)) { rigPose.Position = rigPose.Target.localPosition; rigPose.Rotation = rigPose.Target.localRotation; rigPose.Scale = rigPose.Target.localScale; } } Transform transform = animationTarget.transform; Vector3 localPosition = transform.localPosition; Quaternion localRotation = transform.localRotation; Vector3 localScale = transform.localScale; val.SampleAnimation(animationTarget, Mathf.Clamp01(num3) * Mathf.Max(0f, val.length - 0.0001f)); foreach (RigPose rigPose2 in rigPoses) { if (Object.op_Implicit((Object)(object)rigPose2.Target)) { rigPose2.Target.localPosition = Vector3.Lerp(rigPose2.Position, rigPose2.Target.localPosition, num2); rigPose2.Target.localRotation = Quaternion.Slerp(rigPose2.Rotation, rigPose2.Target.localRotation, num2); rigPose2.Target.localScale = Vector3.Lerp(rigPose2.Scale, rigPose2.Target.localScale, num2); } } if (flatHead && Object.op_Implicit((Object)(object)flatHeadClip)) { flatHeadClip.SampleAnimation(animationTarget, 0f); } if (flatBody && Object.op_Implicit((Object)(object)flatBodyClip)) { flatBodyClip.SampleAnimation(animationTarget, 0f); } transform.localPosition = localPosition; transform.localRotation = localRotation; transform.localScale = localScale; } else if (!Object.op_Implicit((Object)(object)val)) { float amount = Mathf.Sin(MathF.PI * num); TuckLeg(leftLegBottom, leftLegTop, amount); TuckLeg(rightLegBottom, rightLegTop, amount); } float num4 = Mathf.InverseLerp(0.1f, 0.84f, num); float num5 = ((num <= 0.1f || num >= 0.84f) ? 0f : (1.68f * num4 * (1f - num4))); visualRoot.transform.localPosition = Vector3.up * Mathf.Clamp(num5, 0f, 0.42f); } private static void TuckLeg(RigPose bottom, RigPose top, float amount) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (bottom != null && Object.op_Implicit((Object)(object)bottom.Target)) { Transform target = bottom.Target; target.localPosition += Vector3.up * (0.13f * amount); Transform target2 = bottom.Target; target2.localRotation *= Quaternion.Euler(12f * amount, 0f, 0f); } if (top != null && Object.op_Implicit((Object)(object)top.Target)) { Transform target3 = top.Target; target3.localRotation *= Quaternion.Euler(-25f * amount, 0f, 0f); } } private void ApplyGlancePose() { //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) if (glanceRandom == null) { glanceRandom = new Random(((Object)this).GetInstanceID()); } bool num = Time.time < lookPointUntil; if (!num && Time.time >= nextGlance) { int num2 = glanceRandom.Next(7); glanceYaw = ((num2 < 3) ? 0f : (((float)num2 - 4.5f) * (aggressive ? 3f : 9f))); glancePitch = ((glanceRandom.Next(4) == 0) ? ((float)(glanceRandom.NextDouble() * 7.0 - 3.5)) : 0f); glanceEyeYaw = (float)(glanceRandom.NextDouble() * 12.0 - 6.0); gazeSpeed = (float)(130.0 + glanceRandom.NextDouble() * 150.0); nextGlance = Time.time + (float)(0.800000011920929 + glanceRandom.NextDouble() * 2.200000047683716); } float num3 = glanceYaw; float num4 = glancePitch; if (num) { Vector3 val = (Object.op_Implicit((Object)(object)headUp) ? headUp.position : (((Component)this).transform.position + Vector3.up * 1.2f)); Vector3 val2 = ((Component)this).transform.InverseTransformDirection(lookPoint - val); num3 = Mathf.Clamp(Mathf.Atan2(val2.x, val2.z) * 57.29578f, -32f, 32f); float y = val2.y; Vector2 val3 = new Vector2(val2.x, val2.z); num4 = Mathf.Clamp((0f - Mathf.Atan2(y, ((Vector2)(ref val3)).magnitude)) * 57.29578f, -12f, 12f); } gazeYaw = Mathf.MoveTowardsAngle(gazeYaw, num3, gazeSpeed * Time.deltaTime); gazePitch = Mathf.MoveTowardsAngle(gazePitch, num4, gazeSpeed * 0.7f * Time.deltaTime); if (Object.op_Implicit((Object)(object)headSide)) { headSide.localRotation = headRest * Quaternion.Euler(0f, gazeYaw, 0f); } if (Object.op_Implicit((Object)(object)headUp)) { headUp.localRotation = Quaternion.Euler(gazePitch, 0f, 0f); } if (num) { GlanceEyeAt(eyeLeft, lookPoint); GlanceEyeAt(eyeRight, lookPoint); return; } Quaternion val4 = Quaternion.Euler(0f, glanceEyeYaw, 0f); if (Object.op_Implicit((Object)(object)eyeLeft)) { eyeLeft.localRotation = Quaternion.RotateTowards(eyeLeft.localRotation, val4, 480f * Time.deltaTime); } if (Object.op_Implicit((Object)(object)eyeRight)) { eyeRight.localRotation = Quaternion.RotateTowards(eyeRight.localRotation, val4, 480f * Time.deltaTime); } } private static void GlanceEyeAt(Transform eye, Vector3 worldPoint) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: 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_00bd: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)eye) && Object.op_Implicit((Object)(object)eye.parent)) { Vector3 val = eye.parent.InverseTransformDirection(worldPoint - eye.position); if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f)) { float num = Mathf.Clamp(Mathf.Atan2(val.x, val.z) * 57.29578f, -25f, 25f); float y = val.y; Vector2 val2 = new Vector2(val.x, val.z); float num2 = Mathf.Clamp((0f - Mathf.Atan2(y, ((Vector2)(ref val2)).magnitude)) * 57.29578f, -18f, 18f); eye.localRotation = Quaternion.RotateTowards(eye.localRotation, Quaternion.Euler(num2, num, 0f), 540f * Time.deltaTime); } } } private static bool Finite(Vector3 point) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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) if (!float.IsNaN(point.x) && !float.IsInfinity(point.x) && !float.IsNaN(point.y) && !float.IsInfinity(point.y) && !float.IsNaN(point.z)) { return !float.IsInfinity(point.z); } return false; } private void ApplyAttackPose() { //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0329: 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_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_043a: 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_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) if (!(attackProgress < 0f) && Object.op_Implicit((Object)(object)visualRoot)) { float num = attackProgress; float num2 = ((num < 5f / 18f) ? Mathf.SmoothStep(0f, 1f, num / (5f / 18f)) : ((num < 13f / 18f) ? 1f : Mathf.SmoothStep(1f, 0f, (num - 13f / 18f) / (5f / 18f)))); float num3 = ((num < 5f / 18f) ? (num2 * 0.55f) : ((!(num < 5f / 9f)) ? Mathf.Lerp(1f, 0f, (num - 5f / 9f) / 0.045f) : Mathf.Lerp(0.55f, 1f, (num - 5f / 18f) / (5f / 18f)))); float num4 = ((num >= 5f / 9f && num < 13f / 18f) ? (0.12f * (1f - Mathf.InverseLerp(5f / 9f, 13f / 18f, num))) : 0f); visualRoot.transform.localPosition = new Vector3(0f, 0f, num2 * 0.15f + num4); if (Object.op_Implicit((Object)(object)lean)) { lean.localRotation = leanRest * Quaternion.Euler(num2 * 10f, 0f, 0f); } if (Object.op_Implicit((Object)(object)bodyTopUp)) { bodyTopUp.localRotation = Quaternion.Euler(num2 * 5f, 0f, 0f); } Vector3 val = victimPosition + Vector3.up * 1.2f; Vector3 val2 = victimPosition + Vector3.up * 0.95f; float num5 = Mathf.Lerp(0.38f, 0.19f, Mathf.Clamp01((num - 0.1f) / 0.25f)); AimArm(leftArm, Vector3.left, val2 - ((Component)this).transform.right * num5, num2); AimArm(rightArm, Vector3.right, val2 + ((Component)this).transform.right * num5, num2); if (Object.op_Implicit((Object)(object)leftArm)) { leftArm.localScale = Vector3.Scale(leftArmScale, new Vector3(1f + 0.12f * num2, 1f, 1f)); } if (Object.op_Implicit((Object)(object)rightArm)) { rightArm.localScale = Vector3.Scale(rightArmScale, new Vector3(1f + 0.12f * num2, 1f, 1f)); } Transform val3 = (Object.op_Implicit((Object)(object)headUp) ? headUp : visualRoot.transform); Vector3 val4 = ((Component)this).transform.InverseTransformDirection(val - val3.position); float num6 = Mathf.Clamp(Mathf.Atan2(val4.x, val4.z) * 57.29578f, -35f, 35f); float y = val4.y; Vector2 val5 = new Vector2(val4.x, val4.z); float num7 = Mathf.Clamp((0f - Mathf.Atan2(y, ((Vector2)(ref val5)).magnitude)) * 57.29578f, -20f, 20f); if (Object.op_Implicit((Object)(object)headSide)) { headSide.localRotation = headRest * Quaternion.Euler(0f, num6 * num2, 0f); } if (Object.op_Implicit((Object)(object)headUp)) { headUp.localRotation = Quaternion.Euler(num7 * num2, 0f, 0f); } if (Object.op_Implicit((Object)(object)jaw)) { jaw.localRotation = jawRest * Quaternion.Euler(-82f * num3 - 38f * speech * (1f - num2), 0f, 0f); } LookEyeAt(eyeLeft, val, num2); LookEyeAt(eyeRight, val, num2); if (Object.op_Implicit((Object)(object)pupilLeft)) { pupilLeft.localScale = leftPupilRest * Mathf.Lerp(1f, 0.7f, num2); } if (Object.op_Implicit((Object)(object)pupilRight)) { pupilRight.localScale = rightPupilRest * Mathf.Lerp(1f, 0.7f, num2); } } } private static void AimArm(Transform arm, Vector3 meshAxis, Vector3 target, float weight) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)arm)) { Vector3 val = target - arm.position; if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f)) { Quaternion val2 = Quaternion.FromToRotation(arm.TransformDirection(meshAxis), ((Vector3)(ref val)).normalized) * arm.rotation; arm.rotation = Quaternion.Slerp(arm.rotation, val2, weight); } } } private static void LookEyeAt(Transform eye, Vector3 point, float weight) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //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_002c: 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) if (Object.op_Implicit((Object)(object)eye)) { Vector3 val = point - eye.position; if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { eye.rotation = Quaternion.Slerp(eye.rotation, Quaternion.LookRotation(val), weight); } } } private void CloneTransforms(Transform sourceParent, Transform copiedParent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0036: 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_0058: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < sourceParent.childCount; i++) { Transform child = sourceParent.GetChild(i); GameObject val = new GameObject(((Object)child).name); val.layer = 0; val.transform.SetParent(copiedParent, false); val.transform.localPosition = child.localPosition; val.transform.localRotation = child.localRotation; val.transform.localScale = child.localScale; transforms.Add(child, val.transform); CloneTransforms(child, val.transform); val.SetActive(((Component)child).gameObject.activeSelf); } } private void CopyRenderers() { //IL_00b7: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)sourceVisuals).GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { Transform val2 = Mapped(((Component)val).transform); if (!Object.op_Implicit((Object)(object)val2)) { continue; } SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); Renderer val5; if (Object.op_Implicit((Object)(object)val3)) { SkinnedMeshRenderer val4 = ((Component)val2).gameObject.AddComponent<SkinnedMeshRenderer>(); val4.sharedMesh = val3.sharedMesh; Transform[] bones = val3.bones; Transform[] array = (Transform[])(object)new Transform[bones.Length]; for (int j = 0; j < bones.Length; j++) { array[j] = Mapped(bones[j]); } val4.bones = array; val4.rootBone = Mapped(val3.rootBone); ((Renderer)val4).localBounds = ((Renderer)val3).localBounds; val4.updateWhenOffscreen = true; val4.quality = val3.quality; val5 = (Renderer)(object)val4; } else { if (!(val is MeshRenderer)) { continue; } MeshFilter component = ((Component)val).GetComponent<MeshFilter>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.sharedMesh)) { continue; } MeshFilter val6 = ((Component)val2).GetComponent<MeshFilter>(); if (!Object.op_Implicit((Object)(object)val6)) { val6 = ((Component)val2).gameObject.AddComponent<MeshFilter>(); } val6.sharedMesh = component.sharedMesh; val5 = (Renderer)(object)((Component)val2).gameObject.AddComponent<MeshRenderer>(); } val5.receiveShadows = val.receiveShadows; val5.lightProbeUsage = val.lightProbeUsage; val5.reflectionProbeUsage = val.reflectionProbeUsage; val5.allowOcclusionWhenDynamic = val.allowOcclusionWhenDynamic; val5.sortingLayerID = val.sortingLayerID; val5.sortingOrder = val.sortingOrder; renderers.Add(new RendererPair { Source = val, Copy = val5 }); } } private void CopyLodGroups() { //IL_008f: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) Dictionary<Renderer, Renderer> dictionary = new Dictionary<Renderer, Renderer>(); foreach (RendererPair renderer in renderers) { dictionary[renderer.Source] = renderer.Copy; } LODGroup[] componentsInChildren = ((Component)sourceVisuals).GetComponentsInChildren<LODGroup>(true); foreach (LODGroup val in componentsInChildren) { Transform val2 = Mapped(((Component)val).transform); if (!Object.op_Implicit((Object)(object)val2)) { continue; } LODGroup val3 = ((Component)val2).gameObject.AddComponent<LODGroup>(); val3.localReferencePoint = val.localReferencePoint; val3.size = val.size; val3.fadeMode = val.fadeMode; val3.animateCrossFading = val.animateCrossFading; LOD[] lODs = val.GetLODs(); LOD[] array = (LOD[])(object)new LOD[lODs.Length]; for (int j = 0; j < lODs.Length; j++) { List<Renderer> list = new List<Renderer>(); Renderer[] array2 = lODs[j].renderers; foreach (Renderer val4 in array2) { if (Object.op_Implicit((Object)(object)val4) && dictionary.TryGetValue(val4, out var value)) { list.Add(value); } } array[j] = new LOD(lODs[j].screenRelativeTransitionHeight, list.ToArray()); array[j].fadeTransitionWidth = lODs[j].fadeTransitionWidth; } val3.SetLODs(array); val3.enabled = val.enabled; } } private void SynchronizeAppearance() { //IL_0016: 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_002e: 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_0060: 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_0065: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) visualRoot.transform.localScale = ((Component)sourceVisuals).transform.lossyScale; rightArmScale = (Object.op_Implicit((Object)(object)sourceRightArm) ? sourceRightArm.localScale : Vector3.one); leftArmScale = (Object.op_Implicit((Object)(object)sourceLeftArm) ? sourceLeftArm.localS