using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Empress_ShopLoaderAPI; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Omniscye")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("EmpressClub")] [assembly: AssemblyTitle("EmpressClub")] [assembly: AssemblyVersion("1.0.0.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 Empress.REPO.EmpressClub { public sealed class EmpressClubAmbience : MonoBehaviour { private static readonly Color BaseAmbient = new Color(0.23f, 0.24f, 0.28f, 1f); private readonly List _reactiveMaterials = new List(); private readonly List _originalEmission = new List(); private readonly List _clubLights = new List(); private readonly List _originalLightIntensity = new List(); private readonly float[] _spectrum = new float[1024]; private AudioSource _music; private AudioSource _ambience; private Color _trackColor = new Color(0.2f, 0.75f, 1f, 1f); private Color _originalAmbient; private float _bassFloor; private float _bassPeak; private float _pulse; private int _trackIndex = -1; internal static string CurrentTrackName { get; private set; } = "the club mix"; private IEnumerator Start() { _originalAmbient = RenderSettings.ambientLight; CollectReactiveObjects(); CollectClubLights(); ApplyBrightness(); while (!EmpressClubAssets.AudioReady) { yield return null; } if ((Object)(object)EmpressClubAssets.Ambience != (Object)null) { _ambience = ((Component)this).gameObject.AddComponent(); _ambience.clip = EmpressClubAssets.Ambience; _ambience.loop = true; _ambience.spatialBlend = 0f; _ambience.volume = 0.22f; _ambience.Play(); } if (EmpressClubAssets.MusicTracks.Count > 0) { _music = ((Component)this).gameObject.AddComponent(); _music.loop = false; _music.spatialBlend = 0f; _music.volume = Mathf.Clamp01(EmpressClubPlugin.MusicVolume.Value); PlayTrack(0); } } private void Update() { //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_00f8: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_music != (Object)null && EmpressClubAssets.MusicTracks.Count > 0) { _music.volume = Mathf.Clamp01(EmpressClubPlugin.MusicVolume.Value); if (!_music.isPlaying) { PlayTrack((_trackIndex + 1) % EmpressClubAssets.MusicTracks.Count); } UpdateBass(); } else { _pulse = Mathf.Lerp(_pulse, 0f, 1f - Mathf.Exp(-4f * Time.deltaTime)); } ApplyBrightness(); float num = Mathf.Clamp(EmpressClubPlugin.ClubBrightness.Value, 0.1f, 1.5f); float num2 = Mathf.InverseLerp(0.1f, 1.5f, num); for (int i = 0; i < _reactiveMaterials.Count; i++) { Material obj = _reactiveMaterials[i]; Color val = _originalEmission[i]; float num3 = Mathf.Clamp(((Color)(ref val)).maxColorComponent, 0.7f, 1.35f); Color val2 = Color.white * num3 * Mathf.Lerp(0.12f, 0.42f, num2); Color val3 = _trackColor * num3 * Mathf.Lerp(0.95f, 2.35f, _pulse) * Mathf.Lerp(0.75f, 1.15f, num2); obj.SetColor("_EmissionColor", Color.Lerp(val2, val3, _pulse)); } } private void PlayTrack(int index) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_music == (Object)null) && EmpressClubAssets.MusicTracks.Count != 0) { _trackIndex = Mathf.Clamp(index, 0, EmpressClubAssets.MusicTracks.Count - 1); AudioClip val = EmpressClubAssets.MusicTracks[_trackIndex]; _music.clip = val; _trackColor = TrackColor(((Object)val).name); _bassFloor = 0f; _bassPeak = 0f; CurrentTrackName = ((Object)val).name; _music.Play(); EmpressClubPlugin.Log.LogInfo((object)("Empress Club now playing " + ((Object)val).name + ".")); } } private void UpdateBass() { _music.GetSpectrumData(_spectrum, 0, (FFTWindow)5); float num = (float)AudioSettings.outputSampleRate * 0.5f / (float)_spectrum.Length; int num2 = Mathf.Max(1, Mathf.CeilToInt(38f / num)); int num3 = Mathf.Min(_spectrum.Length - 1, Mathf.FloorToInt(165f / num)); float num4 = 0f; int num5 = 0; for (int i = num2; i <= num3; i++) { float num6 = _spectrum[i]; num4 += num6 * num6; num5++; } float num7 = ((num5 > 0) ? Mathf.Sqrt(num4 / (float)num5) : 0f); if (_bassFloor <= 0f) { _bassFloor = num7 * 0.55f; } else { _bassFloor = Mathf.Lerp(_bassFloor, num7, 1f - Mathf.Exp(-0.22f * Time.deltaTime)); } _bassPeak = Mathf.Max(num7, _bassPeak * Mathf.Exp(-1.15f * Time.deltaTime)); float num8 = Mathf.Max(2E-06f, _bassPeak - _bassFloor); float num9 = _bassFloor + num8 * 0.38f; float num10 = Mathf.Pow(Mathf.Clamp01((num7 - num9) / Mathf.Max(2E-06f, _bassPeak - num9)), 2.25f); float num11 = ((num10 > _pulse) ? 13f : 4.5f); _pulse = Mathf.Lerp(_pulse, num10, 1f - Mathf.Exp((0f - num11) * Time.deltaTime)); } private void CollectReactiveObjects() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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) HashSet hashSet = new HashSet(); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); float num = default(float); float num2 = default(float); float num3 = default(float); foreach (Renderer val in componentsInChildren) { if (IsCharacter(((Component)val).transform)) { continue; } Material[] materials = val.materials; foreach (Material val2 in materials) { if (!((Object)(object)val2 == (Object)null) && val2.HasProperty("_EmissionColor") && !hashSet.Contains(val2)) { Color color = val2.GetColor("_EmissionColor"); Color.RGBToHSV(color, ref num, ref num2, ref num3); if (!(num3 < 0.65f) && !(num2 > 0.12f)) { val2.EnableKeyword("_EMISSION"); hashSet.Add(val2); _reactiveMaterials.Add(val2); _originalEmission.Add(color); } } } } } private void CollectClubLights() { Light[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Light val in componentsInChildren) { if (!(((Object)val).name != "EmpressClubKeyLight") || ((Object)val).name.StartsWith("EmpressClubFillLight") || ((Object)val).name.StartsWith("EmpressClubReactiveLight")) { _clubLights.Add(val); _originalLightIntensity.Add(val.intensity); } } } private void ApplyBrightness() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp(EmpressClubPlugin.ClubBrightness.Value, 0.1f, 1.5f); RenderSettings.ambientLight = new Color(BaseAmbient.r * num, BaseAmbient.g * num, BaseAmbient.b * num, 1f); for (int i = 0; i < _clubLights.Count && i < _originalLightIntensity.Count; i++) { if (Object.op_Implicit((Object)(object)_clubLights[i])) { _clubLights[i].intensity = _originalLightIntensity[i] * num; } } } private static bool IsCharacter(Transform node) { Transform val = node; while ((Object)(object)val != (Object)null) { if (((Object)val).name == "EmpressClubDancer" || ((Object)val).name == "EmpressClubWalker" || ((Object)val).name.StartsWith("EmpressClubBot_")) { return true; } val = val.parent; } return false; } private static Color TrackColor(string name) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) uint num = 2166136261u; foreach (char c in name) { num ^= c; num *= 16777619; } return Color.HSVToRGB((float)(num & 0xFFFF) / 65535f, 0.82f, 1f); } private void OnDestroy() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) RenderSettings.ambientLight = _originalAmbient; for (int i = 0; i < _reactiveMaterials.Count && i < _originalEmission.Count; i++) { if (Object.op_Implicit((Object)(object)_reactiveMaterials[i])) { _reactiveMaterials[i].SetColor("_EmissionColor", _originalEmission[i]); } } for (int j = 0; j < _clubLights.Count && j < _originalLightIntensity.Count; j++) { if (Object.op_Implicit((Object)(object)_clubLights[j])) { _clubLights[j].intensity = _originalLightIntensity[j]; } } if (Object.op_Implicit((Object)(object)_music)) { _music.Stop(); } if (Object.op_Implicit((Object)(object)_ambience)) { _ambience.Stop(); } } } internal static class EmpressClubAssets { internal static readonly List Notice = new List(); internal static readonly List Buy = new List(); internal static readonly List SoldOut = new List(); internal static readonly List Sell = new List(); internal static readonly List MusicTracks = new List(); internal static AudioClip PortalStart; internal static AudioClip PortalLoop; internal static AudioClip PortalEnd; internal static AudioClip Music; internal static AudioClip Ambience; internal static bool AudioReady; internal static IEnumerator LoadAll(string pluginDirectory) { Notice.Clear(); Buy.Clear(); SoldOut.Clear(); Sell.Clear(); MusicTracks.Clear(); AudioReady = false; foreach (string item in from path in Directory.GetFiles(pluginDirectory, "*", SearchOption.AllDirectories) orderby path select path) { string extension = Path.GetExtension(item).ToLowerInvariant(); AudioType val; switch (extension) { case ".ogg": val = (AudioType)14; break; case ".wav": val = (AudioType)20; break; case ".mp3": val = (AudioType)13; break; default: continue; } string fileName = Path.GetFileNameWithoutExtension(item); UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip("file://" + item, val); DownloadHandlerAudioClip val2 = (DownloadHandlerAudioClip)request.downloadHandler; val2.streamAudio = false; val2.compressed = false; yield return request.SendWebRequest(); if ((int)request.result != 1) { EmpressClubPlugin.Log.LogWarning((object)("Empress Club failed to load audio " + fileName)); continue; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if (!((Object)(object)content == (Object)null)) { ((Object)content).name = fileName; Sort(fileName, extension, content); } } Music = MusicTracks.FirstOrDefault(); AudioReady = true; EmpressClubPlugin.Log.LogInfo((object)("Empress Club loaded " + MusicTracks.Count + " music track(s).")); } private static void Sort(string fileName, string extension, AudioClip clip) { if (fileName.StartsWith("sfx_club_notice") || fileName.StartsWith("sfx_merchant_notice")) { Notice.Add(clip); return; } if (fileName.StartsWith("sfx_club_buy") || fileName.StartsWith("sfx_merchant_buy")) { Buy.Add(clip); return; } if (fileName.StartsWith("sfx_club_sold_out") || fileName.StartsWith("sfx_merchant_sold_out")) { SoldOut.Add(clip); return; } if (fileName.StartsWith("sfx_club_sell") || fileName.StartsWith("sfx_merchant_sell")) { Sell.Add(clip); return; } switch (fileName) { case "boton": Notice.Add(clip); Buy.Add(clip); SoldOut.Add(clip); Sell.Add(clip); break; case "quack": Notice.Add(clip); break; case "sfx_teleport_start": PortalStart = clip; break; case "sfx_teleport_activate_loop_a": PortalLoop = clip; break; case "sfx_teleport_end": PortalEnd = clip; break; case "club_music": MusicTracks.Add(clip); break; case "club_ambience": Ambience = clip; break; default: if (extension == ".ogg") { MusicTracks.Add(clip); } break; } } internal static List Category(int category) { return category switch { 0 => Notice, 1 => Buy, 2 => SoldOut, 3 => Sell, _ => Notice, }; } } internal sealed class EmpressClubBotAvatar : MonoBehaviour { private const float DefaultSpeed = 4.2f; private const int MaxRandomCosmetics = 4; private static readonly string[] HiddenVisualNameParts = new string[7] { "grab", "grabb", "holder", "suction", "vacuum", "tool", "cart" }; private static readonly string[] PreferredVisibleLayers = new string[2] { "PlayerVisuals", "Default" }; private static readonly CosmeticType[] RandomCosmeticTypes; private static readonly FieldRef PlayerAvatarCosmeticsRef; private static readonly FieldRef VisualsPlayerCosmeticsRef; private static readonly FieldRef PlayerCosmeticsVisualsRef; private static readonly FieldRef> CosmeticParentsRef; private static readonly FieldRef CosmeticParentTypeRef; private static readonly FieldRef CosmeticParentSpringImpulseRef; private static readonly FieldRef CosmeticParentParentRef; private static readonly FieldRef CosmeticParentResetTransformRef; private static readonly FieldRef> BaseMeshParentsRef; private static readonly FieldRef> BaseMeshesRef; private static readonly FieldRef FirstSetupRef; private static readonly FieldRef FirstSetupCoroutineRef; private static readonly FieldRef> CosmeticAssetsRef; private static readonly FieldRef CosmeticAssetTypeRef; private static readonly FieldRef CosmeticAssetPrefabRef; private static readonly MethodInfo InstantiateCosmeticMethod; private static readonly FieldRef HeadUpTransformRef; private static readonly FieldRef HeadSideTransformRef; private static readonly FieldRef BodyTopUpTransformRef; private static readonly FieldRef BodyTopSideTransformRef; private static readonly FieldRef LeanTransformRef; private static readonly FieldRef TiltTransformRef; private static readonly FieldRef LeftArmTransformRef; private static readonly FieldRef LeftArmBasePoseRef; private static readonly FieldRef RightArmTransformRef; private static readonly FieldRef RightArmBasePoseRef; private static readonly FieldRef TalkObjectRef; private static readonly FieldRef TalkMaxAngleRef; private Animator[] _animators = Array.Empty(); private Transform _headUp; private Transform _headSide; private Transform _bodyTopUp; private Transform _bodyTopSide; private Transform _lean; private Transform _tilt; private Transform _leftArm; private Transform _rightArm; private Transform _mouth; private Quaternion _headUpBase; private Quaternion _headSideBase; private Quaternion _bodyTopUpBase; private Quaternion _bodyTopSideBase; private Quaternion _leanBase; private Quaternion _tiltBase; private Quaternion _mouthBase; private Vector3 _leftArmBasePose; private Vector3 _rightArmBasePose; private Vector3 _lastPosition; private float _fallbackSpeed = 4.2f; private float _danceStart; private float _dancePhase; private float _slapStart; private float _mouthMaxAngle = 18f; private int _danceStyle; private bool _crouching; private bool _dancing; private bool _ragdolling; private bool _slapping; private bool _slapRight; private bool _dancePoseCaptured; private bool _waving; private float _waveStart; private bool _groundApplied; private float _groundSampleUntil; private float _speedSmoothed; private float _movingStopTime; private bool _movingState; internal void Init(float fallbackSpeed) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) _fallbackSpeed = Mathf.Max(0.1f, fallbackSpeed); _animators = ((Component)this).GetComponentsInChildren(true); _lastPosition = ((Component)this).transform.position; _groundSampleUntil = Time.time + 0.9f; ResolveDanceRig(); for (int i = 0; i < _animators.Length; i++) { Animator val = _animators[i]; if (Object.op_Implicit((Object)(object)val)) { ((Behaviour)val).enabled = true; val.applyRootMotion = false; val.speed = 1f; val.cullingMode = (AnimatorCullingMode)0; } } } internal void SetCrouching(bool value) { _crouching = value; } internal void SetRagdolling(bool value) { _ragdolling = value; } internal void SetDancing(bool value, float startTime, float phase, int style) { if (!value) { _dancing = false; RestoreDancePose(); return; } CaptureDancePose(); _danceStart = startTime; _dancePhase = phase; _danceStyle = style; _dancing = true; } internal void SetSlapping(bool value, float startTime, bool right) { if (!value) { _slapping = false; RestoreDancePose(); return; } CaptureDancePose(); _slapStart = startTime; _slapRight = right; _slapping = true; } internal void SetWaving(bool value, float startTime) { if (!value) { _waving = false; RestoreDancePose(); } else { CaptureDancePose(); _waveStart = startTime; _waving = true; } } private void LateUpdate() { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Invalid comparison between Unknown and I4 //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Invalid comparison between Unknown and I4 //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) if (!_groundApplied) { if (Time.time <= _groundSampleUntil) { ApplyGroundCorrection(); } else { _groundApplied = true; } } Vector3 val = ((Time.deltaTime > 0.0001f) ? ((((Component)this).transform.position - _lastPosition) / Time.deltaTime) : Vector3.zero); _lastPosition = ((Component)this).transform.position; Vector3 val2 = val; val2.y = 0f; float magnitude = ((Vector3)(ref val2)).magnitude; _speedSmoothed = Mathf.Lerp(_speedSmoothed, magnitude, 1f - Mathf.Exp(-9f * Time.deltaTime)); if (!_crouching && !_ragdolling && _speedSmoothed > (_movingState ? 0.06f : 0.22f)) { _movingState = true; _movingStopTime = 0f; } else if (_movingState) { _movingStopTime += Time.deltaTime; if (_movingStopTime > 0.18f) { _movingState = false; } } bool flag = _movingState && !_crouching && !_ragdolling; float num = Mathf.Max(0.6f, _fallbackSpeed); float num2 = Mathf.Clamp01(_speedSmoothed / num); Vector3 val3 = ((Component)this).transform.InverseTransformDirection(val2); for (int i = 0; i < _animators.Length; i++) { Animator val4 = _animators[i]; if (!Object.op_Implicit((Object)(object)val4)) { continue; } AnimatorControllerParameter[] parameters = val4.parameters; foreach (AnimatorControllerParameter val5 in parameters) { string text = val5.name.ToLowerInvariant(); AnimatorControllerParameterType type = val5.type; if ((int)type != 1) { if ((int)type == 4) { if (text.Contains("crouch")) { val4.SetBool(val5.nameHash, _crouching); } else if (text.Contains("tumbling")) { val4.SetBool(val5.nameHash, _ragdolling); } else if (text.Contains("fall")) { val4.SetBool(val5.nameHash, _ragdolling); } else if (text.Contains("sprint") || text.Contains("crawl") || text.Contains("slide") || text.Contains("jump")) { val4.SetBool(val5.nameHash, false); } else if (text.Contains("moving") || text.Contains("move") || text.Contains("walk") || text.Contains("run")) { val4.SetBool(val5.nameHash, flag); } else if (text.Contains("ground")) { val4.SetBool(val5.nameHash, !_ragdolling); } } } else if (text.Contains("horizontal") || text.Contains("strafe")) { val4.SetFloat(val5.nameHash, val3.x); } else if (text.Contains("vertical") || text.Contains("forward")) { val4.SetFloat(val5.nameHash, val3.z); } else if (text.Contains("speed") || text.Contains("move") || text.Contains("velocity")) { val4.SetFloat(val5.nameHash, num2); } } } if (_dancing) { ApplyDancePose(); } else if (_slapping) { ApplySlapPose(); } else if (_waving) { ApplyWavePose(); } } private void ApplyGroundCorrection() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Transform val = (Object.op_Implicit((Object)(object)((Component)this).transform.parent) ? ((Component)this).transform.parent : ((Component)this).transform); float num = float.MaxValue; Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(false); foreach (Renderer val2 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val2) && val2.enabled) { Bounds bounds = val2.bounds; Vector3 size = ((Bounds)(ref bounds)).size; if (!(((Vector3)(ref size)).sqrMagnitude < 0.0001f) && !(Vector3.SqrMagnitude(((Bounds)(ref bounds)).center - val.position) > 25f)) { num = Mathf.Min(num, ((Bounds)(ref bounds)).min.y); } } } if (!(num > 1.7014117E+38f)) { float num2 = val.position.y + 0.02f - num; if (!(Mathf.Abs(num2) < 0.005f) && !(Mathf.Abs(num2) > 0.9f)) { Transform transform = ((Component)this).transform; transform.localPosition += new Vector3(0f, num2, 0f); } } } private void ApplyWavePose() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) float num = Time.time - _waveStart; if (num > 1.9f) { _waving = false; RestoreDancePose(); return; } float num2 = Mathf.Clamp01(num / 0.25f) * Mathf.Clamp01((1.9f - num) / 0.3f); float num3 = Mathf.Sin(num * 13f) * 26f * num2; if (Object.op_Implicit((Object)(object)_rightArm)) { _rightArm.localEulerAngles = _rightArmBasePose + new Vector3(-135f * num2, num3, -24f * num2); } if (Object.op_Implicit((Object)(object)_headSide)) { _headSide.localRotation = _headSideBase * Quaternion.Euler(0f, 10f * num2, 6f * num2); } if (Object.op_Implicit((Object)(object)_mouth)) { _mouth.localRotation = Quaternion.Euler((0f - _mouthMaxAngle) * 0.7f * num2, 0f, 0f); } } private void ResolveDanceRig() { //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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) PlayerAvatarVisuals componentInChildren = ((Component)this).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { try { _headUp = HeadUpTransformRef.Invoke(componentInChildren); } catch { } try { _headSide = HeadSideTransformRef.Invoke(componentInChildren); } catch { } try { _bodyTopUp = BodyTopUpTransformRef.Invoke(componentInChildren); } catch { } try { _bodyTopSide = BodyTopSideTransformRef.Invoke(componentInChildren); } catch { } try { _lean = LeanTransformRef.Invoke(componentInChildren); } catch { } try { _tilt = TiltTransformRef.Invoke(componentInChildren); } catch { } } PlayerAvatarLeftArm componentInChildren2 = ((Component)this).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren2)) { try { _leftArm = LeftArmTransformRef.Invoke(componentInChildren2); } catch { } try { _leftArmBasePose = LeftArmBasePoseRef.Invoke(componentInChildren2); } catch { } } PlayerAvatarRightArm componentInChildren3 = ((Component)this).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren3)) { try { _rightArm = RightArmTransformRef.Invoke(componentInChildren3); } catch { } try { _rightArmBasePose = RightArmBasePoseRef.Invoke(componentInChildren3); } catch { } } PlayerAvatarTalkAnimation componentInChildren4 = ((Component)this).GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)componentInChildren4)) { return; } try { GameObject val = TalkObjectRef.Invoke(componentInChildren4); if (Object.op_Implicit((Object)(object)val)) { _mouth = val.transform; } } catch { } try { _mouthMaxAngle = Mathf.Max(1f, TalkMaxAngleRef.Invoke(componentInChildren4)); } catch { } } private void CaptureDancePose() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_headUp)) { _headUpBase = _headUp.localRotation; } if (Object.op_Implicit((Object)(object)_headSide)) { _headSideBase = _headSide.localRotation; } if (Object.op_Implicit((Object)(object)_bodyTopUp)) { _bodyTopUpBase = _bodyTopUp.localRotation; } if (Object.op_Implicit((Object)(object)_bodyTopSide)) { _bodyTopSideBase = _bodyTopSide.localRotation; } if (Object.op_Implicit((Object)(object)_lean)) { _leanBase = _lean.localRotation; } if (Object.op_Implicit((Object)(object)_tilt)) { _tiltBase = _tilt.localRotation; } if (Object.op_Implicit((Object)(object)_mouth)) { _mouthBase = _mouth.localRotation; } _dancePoseCaptured = true; } private void ApplyDancePose() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a1: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_024e: 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_02b8: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(0f, Time.time - _danceStart) * 3.8f + _dancePhase; float num2 = Mathf.Sin(num); float num3 = Mathf.Sin(num + MathF.PI); float num4 = Mathf.Sin(num * 2f); float num5 = ((_danceStyle == 1) ? 58f : ((_danceStyle == 2) ? 42f : 32f)); float num6 = ((_danceStyle == 2) ? (Mathf.Sin(num * 0.5f) * 38f) : (num2 * num5)); if (Object.op_Implicit((Object)(object)_leftArm)) { _leftArm.localEulerAngles = _leftArmBasePose + new Vector3(num6, num2 * 14f, 18f + num3 * 24f); } if (Object.op_Implicit((Object)(object)_rightArm)) { _rightArm.localEulerAngles = _rightArmBasePose + new Vector3((_danceStyle == 1) ? (0f - num6) : num6, num3 * 14f, -18f + num2 * 24f); } if (Object.op_Implicit((Object)(object)_headUp)) { _headUp.localRotation = _headUpBase * Quaternion.Euler(num4 * 9f, 0f, 0f); } if (Object.op_Implicit((Object)(object)_headSide)) { _headSide.localRotation = _headSideBase * Quaternion.Euler(0f, num2 * 11f, num3 * 8f); } if (Object.op_Implicit((Object)(object)_bodyTopUp)) { _bodyTopUp.localRotation = _bodyTopUpBase * Quaternion.Euler(num4 * 6f, 0f, 0f); } if (Object.op_Implicit((Object)(object)_bodyTopSide)) { _bodyTopSide.localRotation = _bodyTopSideBase * Quaternion.Euler(0f, num2 * 13f, num2 * 7f); } if (Object.op_Implicit((Object)(object)_lean)) { _lean.localRotation = _leanBase * Quaternion.Euler(0f, 0f, num3 * 7f); } if (Object.op_Implicit((Object)(object)_tilt)) { _tilt.localRotation = _tiltBase * Quaternion.Euler(0f, 0f, num2 * 9f); } if (Object.op_Implicit((Object)(object)_mouth)) { float num7 = Mathf.Pow(Mathf.Clamp01(num4 * 0.5f + 0.5f), 0.45f); _mouth.localRotation = Quaternion.Euler((0f - _mouthMaxAngle) * num7, 0f, 0f); } } private void ApplySlapPose() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp01((Time.time - _slapStart) / 0.9f); float num2 = ((num < 0.42f) ? Mathf.Lerp(0f, -72f, num / 0.42f) : ((!(num < 0.72f)) ? Mathf.Lerp(92f, 0f, (num - 0.72f) / 0.28f) : Mathf.Lerp(-72f, 92f, (num - 0.42f) / 0.3f))); if (_slapRight && Object.op_Implicit((Object)(object)_rightArm)) { _rightArm.localEulerAngles = _rightArmBasePose + new Vector3(num2, -52f, -38f); } else if (!_slapRight && Object.op_Implicit((Object)(object)_leftArm)) { _leftArm.localEulerAngles = _leftArmBasePose + new Vector3(num2, 52f, 38f); } if (Object.op_Implicit((Object)(object)_headSide)) { _headSide.localRotation = _headSideBase * Quaternion.Euler(0f, _slapRight ? (-16f) : 16f, _slapRight ? (-9f) : 9f); } if (Object.op_Implicit((Object)(object)_bodyTopSide)) { _bodyTopSide.localRotation = _bodyTopSideBase * Quaternion.Euler(0f, _slapRight ? (-20f) : 20f, 0f); } if (Object.op_Implicit((Object)(object)_mouth)) { _mouth.localRotation = Quaternion.Euler(0f - _mouthMaxAngle, 0f, 0f); } } private void RestoreDancePose() { //IL_001d: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) if (_dancePoseCaptured) { if (Object.op_Implicit((Object)(object)_headUp)) { _headUp.localRotation = _headUpBase; } if (Object.op_Implicit((Object)(object)_headSide)) { _headSide.localRotation = _headSideBase; } if (Object.op_Implicit((Object)(object)_bodyTopUp)) { _bodyTopUp.localRotation = _bodyTopUpBase; } if (Object.op_Implicit((Object)(object)_bodyTopSide)) { _bodyTopSide.localRotation = _bodyTopSideBase; } if (Object.op_Implicit((Object)(object)_lean)) { _lean.localRotation = _leanBase; } if (Object.op_Implicit((Object)(object)_tilt)) { _tilt.localRotation = _tiltBase; } if (Object.op_Implicit((Object)(object)_leftArm)) { _leftArm.localEulerAngles = _leftArmBasePose; } if (Object.op_Implicit((Object)(object)_rightArm)) { _rightArm.localEulerAngles = _rightArmBasePose; } if (Object.op_Implicit((Object)(object)_mouth)) { _mouth.localRotation = _mouthBase; } _dancePoseCaptured = false; } } internal static bool TryAttach(GameObject root, PlayerAvatar player, Color accent, float fallbackSpeed) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)root) || !Object.op_Implicit((Object)(object)player)) { return false; } GameObject val = ResolveAvatarVisualRoot(player); if (!Object.op_Implicit((Object)(object)val)) { return false; } PlayerCosmetics sourceCosmetics = ResolvePlayerCosmetics(player, val); GameObject val2; try { val2 = Object.Instantiate(val, root.transform, false); } catch { return false; } ((Object)val2).name = "AvatarBody"; val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; PrepareClone(val2, val, sourceCosmetics); TintClone(val2, accent); val2.AddComponent().Init(fallbackSpeed); return CountVisibleRenderers(val2) > 0; } private static GameObject ResolveAvatarVisualRoot(PlayerAvatar player) { if (!Object.op_Implicit((Object)(object)player)) { return null; } try { if (Object.op_Implicit((Object)(object)player.playerAvatarVisuals)) { return ((Component)player.playerAvatarVisuals).gameObject; } } catch { } try { FieldInfo fieldInfo = AccessTools.Field(((object)player).GetType(), "playerAvatarVisuals"); if (fieldInfo != null) { object? value = fieldInfo.GetValue(player); Component val = (Component)((value is Component) ? value : null); if (Object.op_Implicit((Object)(object)val)) { return val.gameObject; } } } catch { } try { PropertyInfo propertyInfo = AccessTools.Property(((object)player).GetType(), "playerAvatarVisuals"); if (propertyInfo != null) { object? value2 = propertyInfo.GetValue(player, null); Component val2 = (Component)((value2 is Component) ? value2 : null); if (Object.op_Implicit((Object)(object)val2)) { return val2.gameObject; } } } catch { } try { PlayerAvatarVisuals componentInChildren = ((Component)player).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { return ((Component)componentInChildren).gameObject; } } catch { } return null; } private static PlayerCosmetics ResolvePlayerCosmetics(PlayerAvatar player, GameObject visualRoot) { if (!Object.op_Implicit((Object)(object)player)) { return null; } try { PlayerCosmetics val = PlayerAvatarCosmeticsRef.Invoke(player); if (Object.op_Implicit((Object)(object)val)) { return val; } } catch { } try { PlayerAvatarVisuals component = visualRoot.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { PlayerCosmetics val2 = VisualsPlayerCosmeticsRef.Invoke(component); if (Object.op_Implicit((Object)(object)val2)) { return val2; } } } catch { } try { PlayerCosmetics componentInChildren = ((Component)player).GetComponentInChildren(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { return componentInChildren; } } catch { } return null; } private static void PrepareClone(GameObject clone, GameObject sourceRoot, PlayerCosmetics sourceCosmetics) { //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) MonoBehaviour[] componentsInChildren = clone.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (Object.op_Implicit((Object)(object)componentsInChildren[i])) { componentsInChildren[i].StopAllCoroutines(); ((Behaviour)componentsInChildren[i]).enabled = false; } } clone.SetActive(true); int layer = ResolveVisibleLayer(); EnsureCloneCosmetics(clone, sourceRoot, sourceCosmetics); PreventVanillaCosmeticSetup(clone); StripEquippedCosmetics(clone); RestoreBaseAvatarMeshes(clone); RandomizeCloneCosmetics(clone); Transform[] componentsInChildren2 = clone.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if (Object.op_Implicit((Object)(object)componentsInChildren2[j])) { ((Component)componentsInChildren2[j]).gameObject.layer = layer; } } HideNamedVisuals(clone); DisableCloneLights(clone); Renderer[] componentsInChildren3 = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren3) { if (!Object.op_Implicit((Object)(object)val)) { continue; } if (ShouldHide(((Object)((Component)val).gameObject).name)) { val.enabled = false; continue; } val.enabled = true; ((Component)val).gameObject.layer = layer; val.shadowCastingMode = (ShadowCastingMode)1; val.receiveShadows = true; SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if (val2 != null) { val2.updateWhenOffscreen = true; } } Animator[] componentsInChildren4 = clone.GetComponentsInChildren(true); foreach (Animator val3 in componentsInChildren4) { if (Object.op_Implicit((Object)(object)val3)) { ((Behaviour)val3).enabled = true; val3.applyRootMotion = false; val3.speed = 1f; val3.cullingMode = (AnimatorCullingMode)0; } } Collider[] componentsInChildren5 = clone.GetComponentsInChildren(true); for (int m = 0; m < componentsInChildren5.Length; m++) { if (Object.op_Implicit((Object)(object)componentsInChildren5[m])) { componentsInChildren5[m].enabled = false; } } Rigidbody[] componentsInChildren6 = clone.GetComponentsInChildren(true); foreach (Rigidbody val4 in componentsInChildren6) { if (Object.op_Implicit((Object)(object)val4)) { val4.isKinematic = true; val4.detectCollisions = false; val4.useGravity = false; } } AudioSource[] componentsInChildren7 = clone.GetComponentsInChildren(true); for (int num = 0; num < componentsInChildren7.Length; num++) { if (Object.op_Implicit((Object)(object)componentsInChildren7[num])) { ((Behaviour)componentsInChildren7[num]).enabled = false; } } ParticleSystem[] componentsInChildren8 = clone.GetComponentsInChildren(true); foreach (ParticleSystem val5 in componentsInChildren8) { if (Object.op_Implicit((Object)(object)val5)) { EmissionModule emission = val5.emission; ((EmissionModule)(ref emission)).enabled = false; val5.Stop(true, (ParticleSystemStopBehavior)0); } } TextMesh[] componentsInChildren9 = clone.GetComponentsInChildren(true); for (int num3 = 0; num3 < componentsInChildren9.Length; num3++) { if (Object.op_Implicit((Object)(object)componentsInChildren9[num3])) { ((Component)componentsInChildren9[num3]).gameObject.SetActive(false); } } } private static void RandomizeCloneCosmetics(GameObject clone) { //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)MetaManager.instance) || InstantiateCosmeticMethod == null) { return; } PlayerCosmetics val = ((IEnumerable)clone.GetComponentsInChildren(true)).FirstOrDefault((Func)((PlayerCosmetics component) => Object.op_Implicit((Object)(object)component))); if (!Object.op_Implicit((Object)(object)val)) { return; } HashSet supportedCosmeticTypes = GetSupportedCosmeticTypes(val); if (supportedCosmeticTypes.Count == 0) { return; } List list = null; try { list = CosmeticAssetsRef.Invoke(MetaManager.instance); } catch { } if (list == null || list.Count == 0) { return; } Dictionary> dictionary = new Dictionary>(); for (int num = 0; num < list.Count; num++) { CosmeticAsset val2 = list[num]; if (!Object.op_Implicit((Object)(object)val2)) { continue; } CosmeticType val3; try { val3 = CosmeticAssetTypeRef.Invoke(val2); } catch { continue; } PrefabRef val4; try { val4 = CosmeticAssetPrefabRef.Invoke(val2); } catch { continue; } if (supportedCosmeticTypes.Contains(val3) && RandomCosmeticTypes.Contains(val3) && val4 != null && val4.IsValid()) { if (!dictionary.TryGetValue(val3, out var value)) { value = (dictionary[val3] = new List()); } value.Add(val2); } } List list3 = dictionary.Keys.OrderBy((CosmeticType _) => Random.value).ToList(); int num2 = Mathf.Min(4, list3.Count); for (int num3 = 0; num3 < num2; num3++) { List list4 = dictionary[list3[num3]]; if (list4.Count == 0) { continue; } CosmeticAsset val5 = list4[Random.Range(0, list4.Count)]; try { object? obj4 = InstantiateCosmeticMethod.Invoke(val, new object[1] { val5 }); GameObject val6 = (GameObject)((obj4 is GameObject) ? obj4 : null); if (Object.op_Implicit((Object)(object)val6)) { val6.AddComponent(); val6.SetActive(true); } } catch { } } } private static void EnsureCloneCosmetics(GameObject clone, GameObject sourceRoot, PlayerCosmetics sourceCosmetics) { //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)sourceCosmetics)) { return; } PlayerCosmetics val = clone.GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)val)) { val = clone.AddComponent(); } if (!Object.op_Implicit((Object)(object)val)) { return; } try { ((MonoBehaviour)val).StopAllCoroutines(); } catch { } try { ((Behaviour)val).enabled = false; } catch { } try { FirstSetupRef.Invoke(val) = false; } catch { } try { FirstSetupCoroutineRef.Invoke(val) = true; } catch { } PlayerAvatarVisuals component = clone.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { try { PlayerCosmeticsVisualsRef.Invoke(val) = component; } catch { } try { VisualsPlayerCosmeticsRef.Invoke(component) = val; } catch { } } List list = null; try { list = CosmeticParentsRef.Invoke(sourceCosmetics); } catch { } if (list == null || list.Count == 0) { return; } List list2 = new List(); for (int i = 0; i < list.Count; i++) { CosmeticParent val2 = list[i]; if (val2 == null) { continue; } Transform val3 = null; List list3 = new List(); List list4 = new List(); try { val3 = MapCloneTransform(CosmeticParentParentRef.Invoke(val2), sourceRoot.transform, clone.transform); } catch { } try { list3 = MapCloneTransforms(BaseMeshParentsRef.Invoke(val2), sourceRoot.transform, clone.transform); } catch { } try { list4 = MapCloneTransforms(BaseMeshesRef.Invoke(val2), sourceRoot.transform, clone.transform); } catch { } if (Object.op_Implicit((Object)(object)val3) && list3.Count != 0) { CosmeticParent val4 = new CosmeticParent(); try { CosmeticParentTypeRef.Invoke(val4) = CosmeticParentTypeRef.Invoke(val2); } catch { continue; } try { CosmeticParentSpringImpulseRef.Invoke(val4) = null; } catch { } try { CosmeticParentParentRef.Invoke(val4) = val3; } catch { } try { CosmeticParentResetTransformRef.Invoke(val4) = CosmeticParentResetTransformRef.Invoke(val2); } catch { } try { BaseMeshParentsRef.Invoke(val4) = list3; } catch { } try { BaseMeshesRef.Invoke(val4) = list4; } catch { } list2.Add(val4); } } if (list2.Count <= 0) { return; } try { CosmeticParentsRef.Invoke(val) = list2; } catch { } } private static HashSet GetSupportedCosmeticTypes(PlayerCosmetics playerCosmetics) { HashSet hashSet = new HashSet(); List list = null; try { list = CosmeticParentsRef.Invoke(playerCosmetics); } catch { } if (list == null) { return hashSet; } for (int i = 0; i < list.Count; i++) { CosmeticParent val = list[i]; if (val == null) { continue; } Transform val2 = null; try { val2 = CosmeticParentParentRef.Invoke(val); } catch { } if (Object.op_Implicit((Object)(object)val2)) { try { hashSet.Add(CosmeticParentTypeRef.Invoke(val)); } catch { } } } return hashSet; } private static List MapCloneTransforms(List sourceTransforms, Transform sourceRoot, Transform cloneRoot) { List list = new List(); if (sourceTransforms == null) { return list; } for (int i = 0; i < sourceTransforms.Count; i++) { Transform val = MapCloneTransform(sourceTransforms[i], sourceRoot, cloneRoot); if (Object.op_Implicit((Object)(object)val)) { list.Add(val); } } return list; } private static Transform MapCloneTransform(Transform source, Transform sourceRoot, Transform cloneRoot) { if (!Object.op_Implicit((Object)(object)source)) { return null; } if ((Object)(object)source == (Object)(object)sourceRoot) { return cloneRoot; } if (!source.IsChildOf(sourceRoot)) { return null; } List list = new List(); Transform val = source; while (Object.op_Implicit((Object)(object)val) && (Object)(object)val != (Object)(object)sourceRoot) { list.Add(val.GetSiblingIndex()); val = val.parent; } Transform val2 = cloneRoot; for (int num = list.Count - 1; num >= 0; num--) { int num2 = list[num]; if (num2 < 0 || num2 >= val2.childCount) { return null; } val2 = val2.GetChild(num2); } return val2; } private static void PreventVanillaCosmeticSetup(GameObject clone) { PlayerCosmetics[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (PlayerCosmetics val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val)) { try { ((MonoBehaviour)val).StopAllCoroutines(); } catch { } try { ((Behaviour)val).enabled = false; } catch { } try { FirstSetupRef.Invoke(val) = false; } catch { } try { FirstSetupCoroutineRef.Invoke(val) = true; } catch { } } } } private static void StripEquippedCosmetics(GameObject clone) { Cosmetic[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Cosmetic val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && !((Object)(object)((Component)val).gameObject == (Object)(object)clone)) { ((Component)val).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)val).gameObject); } } } private static void RestoreBaseAvatarMeshes(GameObject clone) { PlayerCosmetics[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (PlayerCosmetics val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)val)) { continue; } List list = null; try { list = CosmeticParentsRef.Invoke(val); } catch { } if (list == null) { continue; } for (int j = 0; j < list.Count; j++) { CosmeticParent val2 = list[j]; if (val2 != null) { List transforms = null; List transforms2 = null; try { transforms = BaseMeshParentsRef.Invoke(val2); } catch { } try { transforms2 = BaseMeshesRef.Invoke(val2); } catch { } SetBaseMeshesActive(transforms, active: true); SetBaseMeshesActive(transforms2, active: true); } } } } private static void SetBaseMeshesActive(List transforms, bool active) { if (transforms == null) { return; } for (int i = 0; i < transforms.Count; i++) { Transform val = transforms[i]; if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(active); } } } private static void DisableCloneLights(GameObject clone) { Light[] componentsInChildren = clone.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (Object.op_Implicit((Object)(object)componentsInChildren[i])) { ((Behaviour)componentsInChildren[i]).enabled = false; } } } private static void HideNamedVisuals(GameObject clone) { Transform[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && ShouldHide(((Object)((Component)val).gameObject).name)) { ((Component)val).gameObject.SetActive(false); } } } private static bool ShouldHide(string name) { if (string.IsNullOrWhiteSpace(name)) { return false; } string text = name.ToLowerInvariant(); for (int i = 0; i < HiddenVisualNameParts.Length; i++) { if (text.Contains(HiddenVisualNameParts[i])) { return true; } } return false; } private static void TintClone(GameObject clone, Color accent) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)val) || Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent()) || Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent())) { continue; } Material[] materials; try { materials = val.materials; } catch { continue; } foreach (Material val2 in materials) { if (Object.op_Implicit((Object)(object)val2)) { if (val2.HasProperty("_Color")) { val2.SetColor("_Color", Color.Lerp(val2.GetColor("_Color"), accent, 0.48f)); } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", Color.Lerp(val2.GetColor("_BaseColor"), accent, 0.48f)); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", accent * 0.22f); } } } } } private static int CountVisibleRenderers(GameObject clone) { int num = 0; Renderer[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && val.enabled && ((Component)val).gameObject.activeInHierarchy) { num++; } } return num; } private static int ResolveVisibleLayer() { for (int i = 0; i < PreferredVisibleLayers.Length; i++) { int num = LayerMask.NameToLayer(PreferredVisibleLayers[i]); if (num >= 0) { return num; } } return 0; } static EmpressClubBotAvatar() { CosmeticType[] array = new CosmeticType[11]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); RandomCosmeticTypes = (CosmeticType[])(object)array; PlayerAvatarCosmeticsRef = AccessTools.FieldRefAccess("playerCosmetics"); VisualsPlayerCosmeticsRef = AccessTools.FieldRefAccess("playerCosmetics"); PlayerCosmeticsVisualsRef = AccessTools.FieldRefAccess("playerAvatarVisuals"); CosmeticParentsRef = AccessTools.FieldRefAccess>("cosmeticParents"); CosmeticParentTypeRef = AccessTools.FieldRefAccess("cosmeticType"); CosmeticParentSpringImpulseRef = AccessTools.FieldRefAccess("springImpulse"); CosmeticParentParentRef = AccessTools.FieldRefAccess("parent"); CosmeticParentResetTransformRef = AccessTools.FieldRefAccess("resetTransform"); BaseMeshParentsRef = AccessTools.FieldRefAccess>("baseMeshParents"); BaseMeshesRef = AccessTools.FieldRefAccess>("baseMeshes"); FirstSetupRef = AccessTools.FieldRefAccess("firstSetup"); FirstSetupCoroutineRef = AccessTools.FieldRefAccess("firstSetupCoroutine"); CosmeticAssetsRef = AccessTools.FieldRefAccess>("cosmeticAssets"); CosmeticAssetTypeRef = AccessTools.FieldRefAccess("type"); CosmeticAssetPrefabRef = AccessTools.FieldRefAccess("prefab"); InstantiateCosmeticMethod = AccessTools.Method(typeof(PlayerCosmetics), "InstantiateCosmetic", new Type[1] { typeof(CosmeticAsset) }, (Type[])null); HeadUpTransformRef = AccessTools.FieldRefAccess("headUpTransform"); HeadSideTransformRef = AccessTools.FieldRefAccess("headSideTransform"); BodyTopUpTransformRef = AccessTools.FieldRefAccess("bodyTopUpTransform"); BodyTopSideTransformRef = AccessTools.FieldRefAccess("bodyTopSideTransform"); LeanTransformRef = AccessTools.FieldRefAccess("leanTransform"); TiltTransformRef = AccessTools.FieldRefAccess("tiltTransform"); LeftArmTransformRef = AccessTools.FieldRefAccess("leftArmTransform"); LeftArmBasePoseRef = AccessTools.FieldRefAccess("basePose"); RightArmTransformRef = AccessTools.FieldRefAccess("rightArmTransform"); RightArmBasePoseRef = AccessTools.FieldRefAccess("basePose"); TalkObjectRef = AccessTools.FieldRefAccess("objectToRotate"); TalkMaxAngleRef = AccessTools.FieldRefAccess("rotationMaxAngle"); } } internal sealed class EmpressClubUntintedCosmetic : MonoBehaviour { } public sealed class EmpressClubCrowd : MonoBehaviour { internal sealed class SeatSpot { internal Vector3 Position; internal Vector3 ApproachPosition; internal Quaternion Rotation; internal EmpressClubBot Occupant; } private readonly struct SpeechTurn { internal readonly EmpressClubBot Speaker; internal readonly EmpressClubBot Listener; internal readonly string Text; internal SpeechTurn(EmpressClubBot speaker, EmpressClubBot listener, string text) { Speaker = speaker; Listener = listener; Text = text; } } private const int BotCount = 10; private static readonly string[] BotNames = new string[16] { "Neon", "Bassline", "Disco", "Glowstick", "Velvet", "Static", "Laser", "Tempo", "Midnight", "Echo", "Strobe", "Vinyl", "Rave", "Chrome", "Pulse", "Rhythm" }; private readonly List _bots = new List(); private readonly List _seats = new List(); private readonly Queue _turns = new Queue(); private Transform _walkCenter; private Transform _dancer; private Bounds _walkBounds; private float _nextGreetingGlobal; private EmpressClubBot _waitingBot; private EmpressClubBot _speakingBot; private EmpressClubBot _crowdedFirst; private EmpressClubBot _crowdedSecond; private float _waitingSince; private float _speechEnd; private float _nextConversation; private float _nextGroupDance; private float _nextCrowdingCheck; private float _nextSlapAllowed; private float _crowdedSince; private bool _ready; private static readonly string[][] Dialogues = new string[36][] { new string[3] { "Is this {song}, or did the walls start singing?", "It is {song}. The walls are just emotionally involved.", "Good. I was about to apologize to the ceiling." }, new string[3] { "I have been dancing for six minutes and achieved nothing.", "You achieved confidence.", "Then why do my knees feel audited?" }, new string[3] { "Do you think the D J takes requests?", "Only if the request is more bass.", "My request is a chair and less gravity." }, new string[3] { "This glow makes me look expensive.", "You still owe me twelve dollars.", "Expensive and financially mysterious." }, new string[3] { "Rate my dance moves.", "Your arms have filed separate travel plans.", "That is advanced choreography." }, new string[3] { "The bass just rearranged my thoughts.", "Did it improve them?", "There are fewer now, so yes." }, new string[3] { "I think that couch is judging us.", "Sit on it. Establish dominance.", "Finally, a strategy with cushions." }, new string[3] { "Are these club clothes?", "Anything is club clothes if you walk in confidently.", "Even this hat?" }, new string[3] { "I lost the beat again.", "It is under your left foot.", "That explains the screaming." }, new string[3] { "This song has been stuck in my head.", "We have been here for thirty seconds.", "It works fast." }, new string[3] { "I am going to talk to the dancer.", "She is busy being professionally unbothered.", "I respect the craft." }, new string[3] { "Did the lights just blink at me?", "No. The bass did.", "Tell the bass I am taken." }, new string[3] { "I brought emergency glow sticks.", "Those are pencils.", "Every budget has limits." }, new string[3] { "Nobody told me there was a dress code.", "There is not.", "Perfect. I accidentally nailed it." }, new string[3] { "I can feel {song} in my spine.", "That might be the subwoofer.", "Then the subwoofer owes me rent." }, new string[3] { "Should we sit down?", "We just got here.", "My enthusiasm has a short battery." }, new string[3] { "I invented a new dance.", "What is it called?", "Avoiding eye contact near the speakers." }, new string[3] { "This place needs a fog machine.", "It has enough atmosphere already.", "I demand weather indoors." }, new string[3] { "I think I look cool right now.", "Do not move. You will ruin it.", "Holding cool position." }, new string[3] { "The music is loud.", "That is how you know it is working.", "My ears have submitted feedback." }, new string[3] { "Can you dance to {song}?", "I can move during it.", "Legally, that may count." }, new string[3] { "I saw you miss that beat.", "The beat moved first.", "Classic hostile rhythm." }, new string[3] { "Why is everyone so shiny?", "The club polish is working.", "I want two coats." }, new string[3] { "I need a dramatic entrance.", "You already walked into a table.", "Drama achieved." }, new string[3] { "Do I dance left or right?", "Pick one and commit.", "I choose confused." }, new string[3] { "The D J changed the color again.", "Every song gets its own mood.", "Mine is currently electric panic." }, new string[3] { "I think the couch saved my life.", "You sat down for twenty seconds.", "Exactly. Medical miracle." }, new string[3] { "Can the lights hear us?", "Only when the bass gives them permission.", "Very organized lighting." }, new string[3] { "I am requesting something classy.", "You requested laser noises last time.", "Classy laser noises." }, new string[3] { "This club has excellent acoustics.", "You shouted into a glass wall.", "And it answered beautifully." }, new string[3] { "I need water.", "You have been nodding your head.", "It was an athletic nod." }, new string[3] { "Is {song} your favorite?", "It is until the next song starts.", "A loyal fan with flexible standards." }, new string[3] { "I am saving this dance for special occasions.", "Please save it farther away.", "Art is always attacked first." }, new string[3] { "The floor is vibrating.", "That is the bass.", "Good. I thought the building was excited." }, new string[3] { "Want to start a dance circle?", "No one invited us.", "That has never stopped a circle." }, new string[3] { "I look mysterious in this lighting.", "You are standing under a spotlight.", "Mysterious with excellent timing." } }; private static readonly string[] SoloLines = new string[36] { "I came for one song. That was several songs ago.", "The bass and I have reached a professional understanding.", "This couch is now my V I P section.", "Nobody saw that dance move. Excellent.", "I am not lost. I am exploring the dance floor diagonally.", "This lighting is doing most of the work for me.", "I would like to thank {song} for carrying this entire evening.", "My rhythm is loading. Please wait.", "The D J cannot ignore my request if I never make one.", "I have achieved maximum casual standing.", "That bass hit reset my posture.", "I am dancing internally. It is safer there.", "This is my good side. All the other sides are on break.", "I came dressed as someone who knows the D J.", "The floor and I disagree about timing.", "I need a drink called better decisions.", "Somebody guard this seat. It knows too much.", "I am one glow stick away from authority.", "The next beat is definitely mine.", "I have no idea what move this is, but it is committed.", "Club rule number one. Pretend that was intentional.", "This room is brighter, and so is my confidence.", "I can hear {song} judging my footwork.", "I am pacing myself at a very dramatic speed.", "My outfit has more rhythm than I do.", "I am taking a tactical sitting break.", "The lights changed color. I assume that means I won.", "I requested more bass by standing near the speaker.", "This place has excellent chairs and aggressive music.", "I am here to dance and misunderstand social cues.", "The vibe is strong. My balance is not.", "I think the ceiling approves of {song}.", "I am saving energy for a move I have not invented yet.", "If confidence had a volume knob, mine is clipping.", "I have become part of the ambient lighting.", "Nobody panic. I found the beat again." }; internal Transform Dancer => _dancer; internal Vector3 WalkCenterPosition { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_walkCenter)) { return ((Component)this).transform.position; } return _walkCenter.position; } } private IEnumerator Start() { _walkCenter = ((IEnumerable)((Component)this).GetComponentsInChildren(true)).FirstOrDefault((Func)((Transform node) => ((Object)node).name == "EmpressClubWalkCenter")) ?? ((Component)this).transform; _dancer = ((IEnumerable)((Component)this).GetComponentsInChildren(true)).FirstOrDefault((Func)((Transform node) => ((Object)node).name == "EmpressClubDancer")); _walkBounds = ComputeWalkBounds(); CollectSeats(); float timeout = Time.realtimeSinceStartup + 30f; while (((Object)(object)PlayerAvatar.instance == (Object)null || (Object)(object)PlayerAvatar.instance.playerAvatarVisuals == (Object)null || (Object)(object)MetaManager.instance == (Object)null) && Time.realtimeSinceStartup < timeout) { yield return null; } if ((Object)(object)PlayerAvatar.instance == (Object)null || (Object)(object)PlayerAvatar.instance.playerAvatarVisuals == (Object)null) { EmpressClubPlugin.Log.LogWarning((object)"Empress Club could not create the BotFriends crowd because no player avatar was ready."); yield break; } string path = Path.GetDirectoryName(typeof(EmpressClubCrowd).Assembly.Location) ?? string.Empty; EmpressClubSpeech.Configure(Path.Combine(path, "say.exe"), "Paul", 22050, Path.Combine(path, "dtalk_us.dic")); for (int i = 0; i < 10; i++) { bool preferSolitude = i >= 7; if (!TryPickWanderTarget(_walkCenter.position, out var target, 2.5f, preferSolitude)) { target = _walkCenter.position + new Vector3(Mathf.Cos((float)i * MathF.PI * 2f / 10f), 0f, Mathf.Sin((float)i * MathF.PI * 2f / 10f)) * (4f + (float)i * 0.35f); if (TryGround(target, null, out var grounded)) { target = grounded; } } CreateBot(i, target); yield return null; } _nextConversation = Time.time + Random.Range(8f, 16f); _nextGroupDance = Time.time + Random.Range(24f, 38f); _nextSlapAllowed = Time.time + Random.Range(12f, 25f); _ready = true; EmpressClubPlugin.Log.LogInfo((object)("Empress Club added " + _bots.Count + " BotFriends and " + _seats.Count + " club seats.")); } private void Update() { if (_ready) { UpdateCrowding(); UpdateGroupDance(); UpdateSpeech(); } } private void CreateBot(int index, Vector3 position) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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) string text = BotNames[index % BotNames.Length]; GameObject val = new GameObject("EmpressClubBot_" + text); val.transform.SetParent(((Component)this).transform, true); val.transform.position = position; val.transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); Color accent = Color.HSVToRGB(Mathf.Repeat((float)index * 0.381966f + Random.Range(0.02f, 0.14f), 1f), Random.Range(0.8f, 0.98f), 1f); if (!EmpressClubBotAvatar.TryAttach(val, PlayerAvatar.instance, accent, 1.2f)) { CreateFallbackBody(val.transform, accent); } EmpressClubBot empressClubBot = val.AddComponent(); empressClubBot.Initialize(this, index); _bots.Add(empressClubBot); } private static void CreateFallbackBody(Transform root, Color accent) { //IL_0033: 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_0085: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)1); ((Object)obj).name = "EmpressClubFallbackBody"; obj.transform.SetParent(root, false); obj.transform.localPosition = new Vector3(0f, 0.9f, 0f); obj.transform.localScale = new Vector3(0.65f, 0.9f, 0.65f); Collider component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.material.color = accent; } } internal bool TryPickWanderTarget(Vector3 origin, out Vector3 target, float minimumDistance = 6f, bool preferSolitude = false) { //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0112: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) Vector3 candidate = default(Vector3); for (int i = 0; i < 36; i++) { if (preferSolitude && ((Bounds)(ref _walkBounds)).size.x > 8f && ((Bounds)(ref _walkBounds)).size.z > 8f) { ((Vector3)(ref candidate))..ctor(Random.Range(((Bounds)(ref _walkBounds)).min.x + 1.5f, ((Bounds)(ref _walkBounds)).max.x - 1.5f), _walkCenter.position.y, Random.Range(((Bounds)(ref _walkBounds)).min.z + 1.5f, ((Bounds)(ref _walkBounds)).max.z - 1.5f)); } else { float num = Random.Range(0f, MathF.PI * 2f); float num2 = Random.Range(6.5f, 17.5f); candidate = _walkCenter.position + new Vector3(Mathf.Cos(num) * num2, 0f, Mathf.Sin(num) * num2); } if (!TryGround(candidate, out var grounded)) { continue; } Vector3 val = grounded - origin; val.y = 0f; if (((Vector3)(ref val)).magnitude < minimumDistance) { continue; } if (preferSolitude) { Vector3 val2 = grounded - _walkCenter.position; val2.y = 0f; if (((Vector3)(ref val2)).magnitude < 12f || _bots.Any((EmpressClubBot bot) => Object.op_Implicit((Object)(object)bot) && Vector3.SqrMagnitude(((Component)bot).transform.position - grounded) < 25f)) { continue; } } if (!_bots.Any((EmpressClubBot bot) => Object.op_Implicit((Object)(object)bot) && Vector3.SqrMagnitude(((Component)bot).transform.position - grounded) < 0.6f)) { target = grounded; return true; } } target = origin; return false; } internal bool TryGround(Vector3 candidate, out Vector3 grounded) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return TryGround(candidate, null, out grounded); } internal bool TryGround(Vector3 candidate, Transform ignore, out Vector3 grounded) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.RaycastAll(candidate + Vector3.up * 3f, Vector3.down, 12f, -1, (QueryTriggerInteraction)1); float num = float.MaxValue; Vector3 val = Vector3.zero; bool flag = false; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val2 = array2[i]; if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider) || Vector3.Dot(((RaycastHit)(ref val2)).normal, Vector3.up) < 0.68f) { continue; } Transform transform = ((RaycastHit)(ref val2)).transform; if ((!((Object)(object)ignore != (Object)null) || (!((Object)(object)transform == (Object)(object)ignore) && !transform.IsChildOf(ignore))) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null)) { float num2 = Mathf.Abs(((RaycastHit)(ref val2)).point.y - _walkCenter.position.y); if (!(num2 > 1.6f) && !(num2 >= num)) { num = num2; val = ((RaycastHit)(ref val2)).point; flag = true; } } } grounded = (flag ? (val + Vector3.up * 0.01f) : candidate); return flag; } internal bool TryGroundNear(Vector3 candidate, float referenceY, Transform ignore, out Vector3 grounded) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.RaycastAll(candidate + Vector3.up * 2.5f, Vector3.down, 8f, -1, (QueryTriggerInteraction)1); float num = float.MaxValue; Vector3 val = Vector3.zero; bool flag = false; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val2 = array2[i]; if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider) || Vector3.Dot(((RaycastHit)(ref val2)).normal, Vector3.up) < 0.68f) { continue; } Transform transform = ((RaycastHit)(ref val2)).transform; if ((!((Object)(object)ignore != (Object)null) || (!((Object)(object)transform == (Object)(object)ignore) && !transform.IsChildOf(ignore))) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)transform).GetComponentInParent() != (Object)null)) { float num2 = Mathf.Abs(((RaycastHit)(ref val2)).point.y - referenceY); if (!(num2 > 1.1f) && !(num2 >= num)) { num = num2; val = ((RaycastHit)(ref val2)).point; flag = true; } } } grounded = (flag ? (val + Vector3.up * 0.01f) : candidate); return flag; } internal EmpressClubBot PickApproachTarget(EmpressClubBot seeker) { List list = _bots.Where((EmpressClubBot bot) => Object.op_Implicit((Object)(object)bot) && (Object)(object)bot != (Object)(object)seeker && !bot.PrefersSolitude && bot.IsAvailableForConflict).ToList(); if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } internal bool TryQueueGreeting(EmpressClubBot bot) { if (!_ready || Time.time < _nextGreetingGlobal || Object.op_Implicit((Object)(object)_waitingBot) || Object.op_Implicit((Object)(object)_speakingBot) || _turns.Count > 0) { return false; } _nextGreetingGlobal = Time.time + Random.Range(16f, 26f); _turns.Enqueue(new SpeechTurn(bot, null, EmpressClubDialogue.PickGreeting())); return true; } internal bool TryReserveSeat(EmpressClubBot bot, out SeatSpot seat) { List list = (from item in _seats where (Object)(object)item.Occupant == (Object)null orderby Vector3.SqrMagnitude(item.ApproachPosition - ((Component)bot).transform.position) select item).Take(3).ToList(); if (list.Count == 0) { seat = null; return false; } seat = list[Random.Range(0, list.Count)]; seat.Occupant = bot; return true; } internal static void ReleaseSeat(EmpressClubBot bot, SeatSpot seat) { if (seat != null && (Object)(object)seat.Occupant == (Object)(object)bot) { seat.Occupant = null; } } private void UpdateGroupDance() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextGroupDance) { return; } List list = _bots.Where((EmpressClubBot bot) => Object.op_Implicit((Object)(object)bot) && bot.IsAvailableForDance && !bot.PrefersSolitude).ToList(); if (list.Count < 3) { _nextGroupDance = Time.time + 10f; return; } EmpressClubBot leader = list[Random.Range(0, list.Count)]; int count = Random.Range(3, Mathf.Min(5, list.Count) + 1); List list2 = list.OrderBy((EmpressClubBot bot) => Vector3.SqrMagnitude(((Component)bot).transform.position - ((Component)leader).transform.position)).Take(count).ToList(); Vector3 val = Vector3.zero; foreach (EmpressClubBot item in list2) { val += ((Component)item).transform.position; } val /= (float)list2.Count; if (TryGround(val, out var grounded)) { val = grounded; } float num = Time.time + 5f; float num2 = Random.Range(13f, 19f); int style = Random.Range(0, 3); float num3 = Random.Range(0f, 360f); for (int num4 = 0; num4 < list2.Count; num4++) { float num5 = num3 + (float)num4 * 360f / (float)list2.Count; Vector3 val2 = val + Quaternion.Euler(0f, num5, 0f) * Vector3.forward * 1.35f; if (TryGround(val2, out var grounded2)) { val2 = grounded2; } list2[num4].JoinGroupDance(val2, val, num, num2, style); } _nextGroupDance = num + num2 + Random.Range(32f, 50f); } private void UpdateCrowding() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextCrowdingCheck) { return; } _nextCrowdingCheck = Time.time + 0.25f; EmpressClubBot empressClubBot = null; EmpressClubBot empressClubBot2 = null; float num = 0.81f; for (int i = 0; i < _bots.Count; i++) { EmpressClubBot empressClubBot3 = _bots[i]; if (!Object.op_Implicit((Object)(object)empressClubBot3) || !empressClubBot3.IsAvailableForConflict) { continue; } for (int j = i + 1; j < _bots.Count; j++) { EmpressClubBot empressClubBot4 = _bots[j]; if (Object.op_Implicit((Object)(object)empressClubBot4) && empressClubBot4.IsAvailableForConflict && !(Mathf.Abs(((Component)empressClubBot3).transform.position.y - ((Component)empressClubBot4).transform.position.y) > 1.1f)) { Vector3 val = ((Component)empressClubBot3).transform.position - ((Component)empressClubBot4).transform.position; val.y = 0f; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude >= num)) { num = sqrMagnitude; empressClubBot = empressClubBot3; empressClubBot2 = empressClubBot4; } } } } if (!Object.op_Implicit((Object)(object)empressClubBot) || !Object.op_Implicit((Object)(object)empressClubBot2)) { _crowdedFirst = null; _crowdedSecond = null; _crowdedSince = 0f; } else if ((Object)(object)empressClubBot != (Object)(object)_crowdedFirst || (Object)(object)empressClubBot2 != (Object)(object)_crowdedSecond) { _crowdedFirst = empressClubBot; _crowdedSecond = empressClubBot2; _crowdedSince = Time.time; } else if (!(Time.time < _nextSlapAllowed) && !(Time.time - _crowdedSince < 1.1f) && !(Random.value > 0.3f)) { EmpressClubBot empressClubBot5 = ((Random.value < 0.5f) ? empressClubBot : empressClubBot2); EmpressClubBot empressClubBot6 = (((Object)(object)empressClubBot5 == (Object)(object)empressClubBot) ? empressClubBot2 : empressClubBot); if (empressClubBot5.BeginSlap(empressClubBot6)) { string[] array = EmpressClubDialogue.PickSlapExchange(); _turns.Enqueue(new SpeechTurn(empressClubBot5, empressClubBot6, array[0])); _turns.Enqueue(new SpeechTurn(empressClubBot6, empressClubBot5, array[1])); _nextSlapAllowed = Time.time + Random.Range(22f, 45f); _crowdedFirst = null; _crowdedSecond = null; _crowdedSince = 0f; } } } private void CollectSeats() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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) Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); RaycastHit val5 = default(RaycastHit); foreach (Transform val in componentsInChildren) { if (((Object)val).name != "SeatedPosition") { continue; } Vector3 position = val.position; if (!_seats.Any((SeatSpot existing) => Vector3.SqrMagnitude(existing.Position - position) < 0.12f)) { Vector3 val2 = val.forward; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.1f) { val2 = _walkCenter.position - position; } val2.y = 0f; Quaternion val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.1f) ? Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up) : Quaternion.identity); Vector3 val4 = position + val3 * Vector3.forward * 1.05f; if (Physics.Raycast(val4 + Vector3.up * 2.5f, Vector3.down, ref val5, 6f, -1, (QueryTriggerInteraction)1) && Vector3.Dot(((RaycastHit)(ref val5)).normal, Vector3.up) > 0.68f) { val4 = ((RaycastHit)(ref val5)).point + Vector3.up * 0.01f; } _seats.Add(new SeatSpot { Position = position, ApproachPosition = val4, Rotation = val3 }); } } } private Bounds ComputeWalkBounds() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Renderer[] array = (from renderer in ((Component)this).GetComponentsInChildren(true) where Object.op_Implicit((Object)(object)renderer) && !((Object)((Component)renderer).transform).name.StartsWith("EmpressClubBot_") && (Object)(object)((Component)renderer).GetComponentInParent() == (Object)null && (Object)(object)((Component)renderer).GetComponentInParent() == (Object)null select renderer).ToArray(); if (array.Length == 0) { return new Bounds(_walkCenter.position, new Vector3(34f, 4f, 34f)); } Bounds bounds = array[0].bounds; for (int num = 1; num < array.Length; num++) { ((Bounds)(ref bounds)).Encapsulate(array[num].bounds); } return bounds; } private void UpdateSpeech() { EmpressClubBot who; EmpressClubSpeech.Clip clip; while (EmpressClubSpeech.TryDequeueReady(out who, out clip)) { if (Object.op_Implicit((Object)(object)who) && !((Object)(object)who != (Object)(object)_waitingBot)) { _waitingBot = null; _speakingBot = who; _speechEnd = Time.time + who.PlayClip(clip) + 0.55f; } } if (Object.op_Implicit((Object)(object)_waitingBot) && Time.time - _waitingSince > 18f) { _waitingBot.ClearPendingSpeech(); _waitingBot = null; _turns.Clear(); _nextConversation = Time.time + Random.Range(16f, 28f); } if (Object.op_Implicit((Object)(object)_speakingBot)) { if (Time.time < _speechEnd) { return; } _speakingBot = null; } if (Object.op_Implicit((Object)(object)_waitingBot)) { return; } while (_turns.Count > 0) { SpeechTurn speechTurn = _turns.Dequeue(); if (Object.op_Implicit((Object)(object)speechTurn.Speaker)) { speechTurn.Speaker.FocusOn(speechTurn.Listener, 8f); if (Object.op_Implicit((Object)(object)speechTurn.Listener)) { speechTurn.Listener.FocusOn(speechTurn.Speaker, 8f); } speechTurn.Speaker.QueueSpeechLine(speechTurn.Text); EmpressClubSpeech.Enqueue(speechTurn.Speaker, speechTurn.Text); _waitingBot = speechTurn.Speaker; _waitingSince = Time.time; return; } } if (Time.time >= _nextConversation) { BeginConversation(); } } private void BeginConversation() { List list = _bots.Where((EmpressClubBot bot) => Object.op_Implicit((Object)(object)bot) && bot.IsAvailableForConversation).ToList(); List list2 = list.Where((EmpressClubBot bot) => !bot.PrefersSolitude || Random.value < 0.22f).ToList(); if (list2.Count == 0) { list2 = list; } if (list2.Count == 0) { _nextConversation = Time.time + 8f; return; } string song = CleanTrackName(EmpressClubAmbience.CurrentTrackName); if (list2.Count > 1 && Random.value < 0.82f) { EmpressClubBot first = list2[Random.Range(0, list2.Count)]; List list3 = (from bot in list2 where (Object)(object)bot != (Object)(object)first orderby Vector3.SqrMagnitude(((Component)bot).transform.position - ((Component)first).transform.position) select bot).Take(4).ToList(); EmpressClubBot empressClubBot = list3[Random.Range(0, list3.Count)]; string[] array = ((Random.value < 0.72f) ? EmpressClubDialogue.PickConversation() : Dialogues[Random.Range(0, Dialogues.Length)]); _turns.Enqueue(new SpeechTurn(first, empressClubBot, FormatLine(array[0], song))); _turns.Enqueue(new SpeechTurn(empressClubBot, first, FormatLine(array[1], song))); _turns.Enqueue(new SpeechTurn(first, empressClubBot, FormatLine(array[2], song))); first.FocusOn(empressClubBot, 28f); empressClubBot.FocusOn(first, 28f); } else { EmpressClubBot speaker = list2[Random.Range(0, list2.Count)]; string line = ((Random.value < 0.72f) ? EmpressClubDialogue.PickSolo() : SoloLines[Random.Range(0, SoloLines.Length)]); _turns.Enqueue(new SpeechTurn(speaker, null, FormatLine(line, song))); } _nextConversation = Time.time + Random.Range(13f, 22f); } private static string CleanTrackName(string name) { if (string.IsNullOrWhiteSpace(name)) { return "this song"; } string text = Path.GetFileNameWithoutExtension(name).Replace('_', ' ').Replace('-', ' ') .Trim(); if (!string.IsNullOrWhiteSpace(text)) { return text; } return "this song"; } private static string FormatLine(string line, string song) { return line.Replace("{song}", song); } } public sealed class EmpressClubBot : MonoBehaviour { private enum ClubState { Wandering, Waiting, GoingToSeat, GoingToDance, Dancing, Slapping, Ragdoll, Seated } private EmpressClubCrowd _crowd; private EmpressClubBotAvatar _avatar; private EmpressClubCrowd.SeatSpot _seat; private AudioSource _voice; private AudioClip _voiceClip; private Rigidbody _rigidbody; private CapsuleCollider _collider; private Canvas _speechCanvas; private Text _speechText; private string _pendingSpeech; private string _activeSpeech; private float _typeStart; private float _typeEnd; private float _speechHideTime; private ClubState _state; private Vector3 _target; private Vector3 _lastPosition; private float _speed; private float _stuckTime; private float _waitUntil; private float _seatedUntil; private float _conversationUntil; private float _danceStart; private float _danceEnd; private float _dancePhase; private int _danceStyle; private bool _seatPriority; private bool _hasSat; private bool _prefersSolitude; private bool _slapHit; private Vector3 _danceCenter; private Quaternion _danceBaseRotation; private EmpressClubBot _conversationPartner; private EmpressClubBot _slapTarget; private float _slapHitTime; private float _slapEndTime; private float _ragdollRecoverTime; private float _ragdollEndTime; private float _nextGreeting; private float _greetUntil; private float _watchUntil; private float _fallSpeed; private bool _watchAfterArrive; internal bool IsAvailableForConversation { get { if (((Behaviour)this).isActiveAndEnabled && _state != ClubState.GoingToDance && _state != ClubState.Dancing && _state != ClubState.Slapping && _state != ClubState.Ragdoll && Time.time >= _conversationUntil && (Object)(object)_voice != (Object)null) { return !_voice.isPlaying; } return false; } } internal bool IsAvailableForDance { get { if (((Behaviour)this).isActiveAndEnabled && _state != ClubState.GoingToSeat && _state != ClubState.Seated && _state != ClubState.GoingToDance && _state != ClubState.Dancing && _state != ClubState.Slapping && _state != ClubState.Ragdoll && Time.time >= _conversationUntil && (Object)(object)_voice != (Object)null) { return !_voice.isPlaying; } return false; } } internal bool IsAvailableForConflict { get { if (((Behaviour)this).isActiveAndEnabled && _state != ClubState.GoingToSeat && _state != ClubState.Seated && _state != ClubState.GoingToDance && _state != ClubState.Dancing && _state != ClubState.Slapping && _state != ClubState.Ragdoll && Time.time >= _conversationUntil && (Object)(object)_voice != (Object)null) { return !_voice.isPlaying; } return false; } } internal bool PrefersSolitude => _prefersSolitude; internal void Initialize(EmpressClubCrowd crowd, int index) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) _crowd = crowd; _seatPriority = index < 5; _prefersSolitude = index >= 7; _avatar = ((Component)this).GetComponentInChildren(true); _collider = ((Component)this).gameObject.AddComponent(); _collider.height = 1.8f; _collider.radius = 0.35f; _collider.center = new Vector3(0f, 0.9f, 0f); _rigidbody = ((Component)this).gameObject.AddComponent(); _rigidbody.mass = 60f; _rigidbody.useGravity = true; _rigidbody.isKinematic = true; _rigidbody.collisionDetectionMode = (CollisionDetectionMode)2; _rigidbody.interpolation = (RigidbodyInterpolation)1; _rigidbody.maxDepenetrationVelocity = 2f; _speed = Random.Range(1.15f, 1.55f); _lastPosition = ((Component)this).transform.position; _voice = ((Component)this).gameObject.AddComponent(); _voice.spatialBlend = 1f; _voice.rolloffMode = (AudioRolloffMode)0; _voice.minDistance = 1.5f; _voice.maxDistance = 18f; _voice.volume = 0.68f; BuildSpeechBubble(); _state = ClubState.Waiting; _waitUntil = Time.time + Random.Range(0.5f, 3f); _nextGreeting = Time.time + Random.Range(10f, 30f); } private void Update() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) UpdateSpeechBubble(); if (_state == ClubState.Ragdoll) { UpdateRagdoll(); return; } if (_state == ClubState.Slapping) { UpdateSlap(); return; } if (_state == ClubState.Dancing) { UpdateDance(); return; } if (Object.op_Implicit((Object)(object)_conversationPartner) && Time.time < _conversationUntil) { Face(((Component)_conversationPartner).transform.position); _lastPosition = ((Component)this).transform.position; return; } if (Time.time >= _conversationUntil) { _conversationPartner = null; } if (_state == ClubState.Seated) { HoldSeat(); if (Time.time >= _seatedUntil) { LeaveSeat(); } } else if (_state == ClubState.Waiting) { UpdateIdleFocus(); if (Time.time >= _waitUntil) { ChooseNextAction(); } } else if (_state == ClubState.GoingToDance && Time.time >= _danceStart + 2f) { BeginDance(); } else { MoveToTarget(); } } private void LateUpdate() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_speechCanvas) && ((Behaviour)_speechCanvas).enabled && Object.op_Implicit((Object)(object)Camera.main)) { Transform transform = ((Component)_speechCanvas).transform; transform.rotation = Quaternion.LookRotation(transform.position - ((Component)Camera.main).transform.position, ((Component)Camera.main).transform.up); } } private void BuildSpeechBubble() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("EmpressClubSpeech", new Type[3] { typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler) }); val.transform.SetParent(((Component)this).transform, false); RectTransform component = val.GetComponent(); ((Transform)component).localPosition = new Vector3(0f, 2.35f, 0f); ((Transform)component).localScale = Vector3.one * 0.0045f; component.sizeDelta = new Vector2(520f, 130f); _speechCanvas = val.GetComponent(); _speechCanvas.renderMode = (RenderMode)2; _speechCanvas.sortingOrder = 100; GameObject val2 = new GameObject("Text", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Text), typeof(Outline) }); val2.transform.SetParent(val.transform, false); RectTransform component2 = val2.GetComponent(); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; _speechText = val2.GetComponent(); _speechText.font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font font) => ((Object)font).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 32); _speechText.fontSize = 32; _speechText.resizeTextForBestFit = true; _speechText.resizeTextMinSize = 20; _speechText.resizeTextMaxSize = 32; _speechText.alignment = (TextAnchor)4; _speechText.horizontalOverflow = (HorizontalWrapMode)0; _speechText.verticalOverflow = (VerticalWrapMode)1; ((Graphic)_speechText).color = Color.white; ((Graphic)_speechText).raycastTarget = false; Outline component3 = val2.GetComponent(); ((Shadow)component3).effectColor = new Color(0f, 0f, 0f, 0.95f); ((Shadow)component3).effectDistance = new Vector2(2f, -2f); ((Behaviour)_speechCanvas).enabled = false; } private void UpdateSpeechBubble() { if (Object.op_Implicit((Object)(object)_speechCanvas) && ((Behaviour)_speechCanvas).enabled) { float unscaledTime = Time.unscaledTime; if (unscaledTime >= _speechHideTime) { ((Behaviour)_speechCanvas).enabled = false; _speechText.text = string.Empty; _activeSpeech = string.Empty; } else { float num = Mathf.InverseLerp(_typeStart, _typeEnd, unscaledTime); int length = Mathf.Clamp(Mathf.CeilToInt((float)_activeSpeech.Length * num), 0, _activeSpeech.Length); _speechText.text = _activeSpeech.Substring(0, length); } } } internal void QueueSpeechLine(string line) { _pendingSpeech = line ?? string.Empty; } internal void ClearPendingSpeech() { _pendingSpeech = string.Empty; } private void UpdateIdleFocus() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _greetUntil && Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { Face(((Component)PlayerAvatar.instance).transform.position); } else if (Time.time < _watchUntil && Object.op_Implicit((Object)(object)_crowd.Dancer)) { Face(_crowd.Dancer.position); } else { TryGreetPlayer(); } } private void TryGreetPlayer() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextGreeting || !Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { return; } Vector3 val = ((Component)PlayerAvatar.instance).transform.position - ((Component)this).transform.position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude > 10.24f)) { if (!_crowd.TryQueueGreeting(this)) { _nextGreeting = Time.time + 4f; return; } _nextGreeting = Time.time + Random.Range(45f, 90f); _greetUntil = Time.time + 4.5f; _waitUntil = Mathf.Max(_waitUntil, _greetUntil); _avatar?.SetWaving(value: true, Time.time); } } private void ChooseNextAction() { //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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) _watchAfterArrive = false; float num = (_prefersSolitude ? 0.1f : ((_seatPriority && !_hasSat) ? 0.6f : 0.16f)); if (Random.value < num && _crowd.TryReserveSeat(this, out var seat)) { _seat = seat; _target = seat.ApproachPosition; _state = ClubState.GoingToSeat; _avatar?.SetCrouching(value: false); return; } if (Object.op_Implicit((Object)(object)_crowd.Dancer) && !_prefersSolitude && Random.value < 0.18f) { Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; Vector3 candidate = _crowd.Dancer.position + new Vector3(normalized.x, 0f, normalized.y) * Random.Range(3.4f, 5f); if (_crowd.TryGround(candidate, ((Component)this).transform, out var grounded)) { _target = grounded; _watchAfterArrive = true; _state = ClubState.Wandering; _avatar?.SetCrouching(value: false); return; } } if (!(Random.value < 0.3f) || !TryApproachFriend()) { Vector3 target; if (Random.value < 0.28f) { StartSoloDance(); } else if (_crowd.TryPickWanderTarget(((Component)this).transform.position, out target, _prefersSolitude ? 10f : 6f, _prefersSolitude)) { _target = target; _state = ClubState.Wandering; _avatar?.SetCrouching(value: false); } else { _waitUntil = Time.time + 2f; } } } private bool TryApproachFriend() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (_prefersSolitude) { return false; } EmpressClubBot empressClubBot = _crowd.PickApproachTarget(this); if (!Object.op_Implicit((Object)(object)empressClubBot)) { return false; } Vector3 val = ((Component)this).transform.position - ((Component)empressClubBot).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 4f) { return false; } Vector3 val2 = ((((Vector3)(ref val)).sqrMagnitude > 0.04f) ? ((Vector3)(ref val)).normalized : Vector3.forward); Vector3 candidate = ((Component)empressClubBot).transform.position + val2 * 1.05f; if (!_crowd.TryGround(candidate, ((Component)this).transform, out var grounded)) { return false; } _target = grounded; _state = ClubState.Wandering; _avatar?.SetCrouching(value: false); return true; } private void MoveToTarget() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: 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_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: 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_0284: 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_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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_01d6: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) Vector3 val = _target - ((Component)this).transform.position; val.y = 0f; if (_state == ClubState.GoingToSeat && _seat != null) { Vector3 val2 = _seat.Position - ((Component)this).transform.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude <= 5.76f) { TakeSeat(); return; } } float num = ((_state == ClubState.GoingToSeat) ? 0.42f : 0.58f); if (((Vector3)(ref val)).sqrMagnitude <= num * num) { if (_state == ClubState.GoingToSeat && _seat != null) { TakeSeat(); return; } if (_state == ClubState.GoingToDance) { Face(_danceCenter); if (Time.time >= _danceStart) { BeginDance(); } else { _lastPosition = ((Component)this).transform.position; } return; } _state = ClubState.Waiting; if (_watchAfterArrive) { _watchAfterArrive = false; _watchUntil = Time.time + Random.Range(8f, 16f); _waitUntil = _watchUntil; } else { _waitUntil = Time.time + Random.Range(1.5f, 4.5f); } return; } float num2 = Vector3.Distance(((Component)this).transform.position, _lastPosition); _lastPosition = ((Component)this).transform.position; _stuckTime = ((num2 < 0.002f) ? (_stuckTime + Time.deltaTime) : Mathf.Max(0f, _stuckTime - Time.deltaTime * 2f)); if (_stuckTime > 3f) { _stuckTime = 0f; if (_state == ClubState.GoingToSeat && _seat != null) { Vector3 val3 = _seat.ApproachPosition - ((Component)this).transform.position; val3.y = 0f; if (((Vector3)(ref val3)).magnitude <= 2.2f) { TakeSeat(); return; } EmpressClubCrowd.ReleaseSeat(this, _seat); } if (_state == ClubState.GoingToDance) { BeginDance(); return; } _seat = null; _state = ClubState.Waiting; _waitUntil = Time.time + 1f; return; } Vector3 val4 = Steer(((Vector3)(ref val)).normalized); if (!(((Vector3)(ref val4)).sqrMagnitude < 0.1f)) { Face(((Component)this).transform.position + val4); Vector3 val5 = ((Component)this).transform.position + val4 * _speed * Time.deltaTime; Vector3 grounded2; if (_crowd.TryGroundNear(val5, ((Component)this).transform.position.y, ((Component)this).transform, out var grounded)) { val5.y = Mathf.MoveTowards(val5.y, grounded.y, (3f + _speed) * Time.deltaTime); _fallSpeed = 0f; } else if (_crowd.TryGround(val5, ((Component)this).transform, out grounded2) && grounded2.y < val5.y - 0.4f) { _fallSpeed = Mathf.Min(_fallSpeed + 16f * Time.deltaTime, 7.5f); val5.y = Mathf.Max(grounded2.y, val5.y - _fallSpeed * Time.deltaTime); } else { _fallSpeed = 0f; } ((Component)this).transform.position = val5; } } private Vector3 Steer(Vector3 desired) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) Vector3 origin = ((Component)this).transform.position + Vector3.up * 0.85f; if (DirectionClear(origin, 0.28f, desired, 0.95f)) { return desired; } Vector3 val = Quaternion.Euler(0f, -62f, 0f) * desired; Vector3 val2 = Quaternion.Euler(0f, 62f, 0f) * desired; bool flag = DirectionClear(origin, 0.25f, val, 1.05f); bool flag2 = DirectionClear(origin, 0.25f, val2, 1.05f); if (flag && flag2) { if (!(Vector3.Dot(val, _target - ((Component)this).transform.position) > Vector3.Dot(val2, _target - ((Component)this).transform.position))) { return val2; } return val; } if (flag) { return val; } if (flag2) { return val2; } return Vector3.zero; } private bool DirectionClear(Vector3 origin, float radius, Vector3 direction, float distance) { //IL_0000: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.SphereCastAll(origin, radius, direction, distance, -1, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider) && !((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)this).transform) && !((RaycastHit)(ref val)).transform.IsChildOf(((Component)this).transform)) { return false; } } return true; } private void TakeSeat() { _state = ClubState.Seated; _hasSat = true; _seatedUntil = Time.time + Random.Range(25f, 65f); _stuckTime = 0f; HoldSeat(); } private void HoldSeat() { //IL_001b: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (_seat == null) { LeaveSeat(); return; } ((Component)this).transform.SetPositionAndRotation(_seat.Position, _seat.Rotation); _avatar?.SetCrouching(value: true); _lastPosition = ((Component)this).transform.position; } private void LeaveSeat() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) EmpressClubCrowd.ReleaseSeat(this, _seat); if (_seat != null) { ((Component)this).transform.position = _seat.ApproachPosition; } _seat = null; _avatar?.SetCrouching(value: false); if (_crowd.TryPickWanderTarget(((Component)this).transform.position, out var target, 7f, _prefersSolitude)) { _target = target; _state = ClubState.Wandering; } else { _state = ClubState.Waiting; _waitUntil = Time.time + Random.Range(1f, 3f); } } private void StartSoloDance() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //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) _danceStart = Time.time; _danceEnd = _danceStart + Random.Range(8f, 14f); _danceStyle = Random.Range(0, 3); _dancePhase = Random.Range(0f, MathF.PI * 2f); _danceCenter = ((Component)this).transform.position + ((Component)this).transform.forward; BeginDance(); } internal void JoinGroupDance(Vector3 target, Vector3 center, float startTime, float duration, int style) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) _target = target; _danceCenter = center; _danceStart = startTime; _danceEnd = startTime + duration; _danceStyle = style; _dancePhase = 0f; _state = ClubState.GoingToDance; _stuckTime = 0f; _conversationPartner = null; _avatar?.SetCrouching(value: false); _avatar?.SetDancing(value: false, 0f, 0f, 0); } private void BeginDance() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) _state = ClubState.Dancing; _danceBaseRotation = ((Component)this).transform.rotation; _stuckTime = 0f; _avatar?.SetDancing(value: true, _danceStart, _dancePhase, _danceStyle); } private void UpdateDance() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if (Time.time >= _danceEnd) { StopDance(); return; } float num = Mathf.Max(0f, Time.time - _danceStart); float num2 = num * 3.8f + _dancePhase; float num3 = ((_danceStyle == 1) ? (num * 92f) : ((_danceStyle != 2) ? (Mathf.Sin(num2) * 34f) : (Mathf.Sin(num2 * 0.5f) * 58f))); ((Component)this).transform.rotation = _danceBaseRotation * Quaternion.Euler(0f, num3, 0f); _avatar?.SetCrouching(Mathf.Sin(num2 * 0.5f) < -0.62f); _lastPosition = ((Component)this).transform.position; } private void StopDance() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) _avatar?.SetDancing(value: false, 0f, 0f, 0); _avatar?.SetCrouching(value: false); _state = ClubState.Waiting; _waitUntil = Time.time + Random.Range(1.5f, 4f); _danceBaseRotation = ((Component)this).transform.rotation; } internal bool BeginSlap(EmpressClubBot target) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)target) || !IsAvailableForConflict || !target.IsAvailableForConflict) { return false; } _slapTarget = target; _slapHit = false; _slapHitTime = Time.time + 0.58f; _slapEndTime = Time.time + 1.05f; _state = ClubState.Slapping; _conversationPartner = null; Face(((Component)target).transform.position); _avatar?.SetSlapping(value: true, Time.time, Random.value < 0.5f); return true; } private void UpdateSlap() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_slapTarget)) { FinishSlap(); return; } Face(((Component)_slapTarget).transform.position); if (!_slapHit && Time.time >= _slapHitTime) { _slapHit = true; Vector3 val = ((Component)_slapTarget).transform.position - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = ((Component)this).transform.forward; } _slapTarget.ForceRagdoll(((Vector3)(ref val)).normalized * 5.8f + Vector3.up * 2.8f); } if (Time.time >= _slapEndTime) { FinishSlap(); } } private void FinishSlap() { _avatar?.SetSlapping(value: false, 0f, right: false); _slapTarget = null; _state = ClubState.Waiting; _waitUntil = Time.time + Random.Range(2f, 4f); } internal void ForceRagdoll(Vector3 force) { //IL_00bb: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) EmpressClubCrowd.ReleaseSeat(this, _seat); _seat = null; _conversationPartner = null; _avatar?.SetDancing(value: false, 0f, 0f, 0); _avatar?.SetSlapping(value: false, 0f, right: false); _avatar?.SetCrouching(value: false); _avatar?.SetRagdolling(value: true); _state = ClubState.Ragdoll; _ragdollRecoverTime = Time.time + 3.5f; _ragdollEndTime = Time.time + 8f; if (Object.op_Implicit((Object)(object)_rigidbody)) { _rigidbody.isKinematic = false; _rigidbody.velocity = Vector3.zero; _rigidbody.angularVelocity = Vector3.zero; _rigidbody.AddForce(force, (ForceMode)2); _rigidbody.AddTorque(Random.onUnitSphere * 5f, (ForceMode)2); } } private void UpdateRagdoll() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_rigidbody)) { RecoverFromRagdoll(); } else { if (Time.time < _ragdollRecoverTime) { return; } if (!(Time.time >= _ragdollEndTime)) { Vector3 velocity = _rigidbody.velocity; if (!(((Vector3)(ref velocity)).sqrMagnitude < 0.2f)) { return; } } RecoverFromRagdoll(); } } private void RecoverFromRagdoll() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_01b9: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_01eb: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)this).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.01f) { forward = Vector3.forward; } if (Object.op_Implicit((Object)(object)_rigidbody)) { _rigidbody.velocity = Vector3.zero; _rigidbody.angularVelocity = Vector3.zero; _rigidbody.isKinematic = true; } Vector3 val = ((Component)this).transform.position; bool flag = false; foreach (RaycastHit item in from hit in Physics.RaycastAll(val + Vector3.up * 2.5f, Vector3.down, 7f, -1, (QueryTriggerInteraction)1) orderby ((RaycastHit)(ref hit)).distance select hit) { RaycastHit current = item; if (Object.op_Implicit((Object)(object)((RaycastHit)(ref current)).collider) && !((Object)(object)((RaycastHit)(ref current)).transform == (Object)(object)((Component)this).transform) && !((RaycastHit)(ref current)).transform.IsChildOf(((Component)this).transform) && !(Vector3.Dot(((RaycastHit)(ref current)).normal, Vector3.up) < 0.68f) && !((Object)(object)((Component)((RaycastHit)(ref current)).transform).GetComponentInParent() != (Object)null)) { val = ((RaycastHit)(ref current)).point + Vector3.up * 0.01f; flag = true; break; } } if (!flag || Mathf.Abs(val.y - _crowd.WalkCenterPosition.y) > 3.5f) { Vector3 val2 = _crowd.WalkCenterPosition; if (_crowd.TryGround(val2, ((Component)this).transform, out var grounded)) { val2 = grounded; } val = val2; } ((Component)this).transform.SetPositionAndRotation(val, Quaternion.LookRotation(((Vector3)(ref forward)).normalized, Vector3.up)); _avatar?.SetRagdolling(value: false); _lastPosition = val; _state = ClubState.Waiting; _waitUntil = Time.time + Random.Range(2f, 5f); } internal void FocusOn(EmpressClubBot other, float duration) { _conversationPartner = other; _conversationUntil = Mathf.Max(_conversationUntil, Time.time + duration); } private void Face(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - ((Component)this).transform.position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, 1f - Mathf.Exp(-7f * Time.deltaTime)); } } internal float PlayClip(EmpressClubSpeech.Clip clip) { if ((Object)(object)_voice == (Object)null || clip.Samples == null || clip.Samples.Length == 0 || clip.Channels <= 0 || clip.SampleRate <= 0) { return 0f; } if (Object.op_Implicit((Object)(object)_voiceClip)) { Object.Destroy((Object)(object)_voiceClip); } _voiceClip = AudioClip.Create("EmpressClubBotVoice", clip.Samples.Length / clip.Channels, clip.Channels, clip.SampleRate, false); _voiceClip.SetData(clip.Samples, 0); _voice.clip = _voiceClip; _voice.Play(); _activeSpeech = _pendingSpeech ?? string.Empty; _pendingSpeech = string.Empty; _typeStart = Time.unscaledTime; _typeEnd = _typeStart + Mathf.Max(0.4f, _voiceClip.length * 0.82f); _speechHideTime = _typeStart + _voiceClip.length + 1.2f; _speechText.text = string.Empty; ((Behaviour)_speechCanvas).enabled = !string.IsNullOrWhiteSpace(_activeSpeech); return _voiceClip.length; } private void OnDestroy() { EmpressClubCrowd.ReleaseSeat(this, _seat); _avatar?.SetDancing(value: false, 0f, 0f, 0); if (Object.op_Implicit((Object)(object)_voiceClip)) { Object.Destroy((Object)(object)_voiceClip); } if (Object.op_Implicit((Object)(object)_speechCanvas)) { Object.Destroy((Object)(object)((Component)_speechCanvas).gameObject); } } } public sealed class EmpressClubDancerPlacement : MonoBehaviour { private IEnumerator Start() { SkinnedMeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].updateWhenOffscreen = true; } yield return (object)new WaitForFixedUpdate(); yield return null; yield return null; for (int attempt = 0; attempt < 10; attempt++) { if (TryPlace()) { yield break; } yield return (object)new WaitForSeconds(0.5f); } EmpressClubPlugin.Log.LogWarning((object)"Empress Club could not find the center stage floor for the dancer."); } private bool TryPlace() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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) float num = (from renderer in ((Component)this).GetComponentsInChildren(true) where Object.op_Implicit((Object)(object)renderer) && renderer.enabled select renderer).Select(delegate(Renderer renderer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = renderer.bounds; return ((Bounds)(ref bounds)).min.y; }).DefaultIfEmpty(float.MaxValue).Min(); if (num > 1.7014117E+38f) { return false; } RaycastHit[] array = Physics.RaycastAll(((Component)this).transform.position + Vector3.up * 2f, Vector3.down, 9f, -1, (QueryTriggerInteraction)1); float num2 = float.MinValue; bool flag = false; RaycastHit[] array2 = array; for (int num3 = 0; num3 < array2.Length; num3++) { RaycastHit val = array2[num3]; if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider) && !((RaycastHit)(ref val)).transform.IsChildOf(((Component)this).transform) && !(Vector3.Dot(((RaycastHit)(ref val)).normal, Vector3.up) < 0.7f) && !((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponentInParent() != (Object)null)) { float num4 = ((RaycastHit)(ref val)).point.y - ((Component)this).transform.position.y; if (!(num4 > 1.2f) && !(num4 < -2f) && !(((RaycastHit)(ref val)).point.y <= num2)) { num2 = ((RaycastHit)(ref val)).point.y; flag = true; } } } if (!flag) { return false; } float num5 = num2 - num + 0.02f; if (Mathf.Abs(num5) > 3f) { return false; } if (Mathf.Abs(num5) > 0.005f) { Transform transform = ((Component)this).transform; transform.position += Vector3.up * num5; } return true; } } internal static class EmpressClubDialogue { private static readonly string[][] Conversations = new string[139][] { new string[3] { "Did you see that spin?", "I saw a cry for help with choreography.", "So you saw it." }, new string[3] { "This club has a suspicious number of chairs.", "That is because you keep asking for one.", "The furniture respects me." }, new string[3] { "I think {song} understands me.", "It has no idea who you are.", "That is why the relationship works." }, new string[3] { "Should I dance harder?", "You should dance more accurately.", "I reject the premise." }, new string[3] { "The D J looked at me.", "That was a speaker light.", "We had a moment." }, new string[3] { "I brought club energy.", "You brought a coupon.", "Savings are energetic." }, new string[3] { "Why are you standing like that?", "I am posing.", "For a medical diagram?" }, new string[3] { "My feet know the beat.", "Your feet are arguing.", "Creative differences." }, new string[3] { "This is definitely my song.", "You said that about the last four.", "I contain multitudes." }, new string[3] { "Do you want to sit?", "I just started looking cool.", "Then sit cool." }, new string[3] { "I can dance without moving.", "That is called standing.", "Minimalist dance." }, new string[3] { "The lights are judging my outfit.", "The lights have standards.", "Rude electricity." }, new string[3] { "Is the floor supposed to shake?", "Only when the bass hits.", "Good. I blamed my knees." }, new string[3] { "I need a better dance partner.", "You need a better dance.", "We can fix one problem at a time." }, new string[3] { "How long have we been here?", "Long enough for you to invent three bad moves.", "History is being made." }, new string[3] { "I think I pulled a muscle.", "You nodded twice.", "It was an advanced nod." }, new string[3] { "Can you hear {song}?", "Everyone can hear {song}.", "I wanted to feel included." }, new string[3] { "The couch keeps calling me.", "It is not a phone.", "Then why do I feel connected?" }, new string[3] { "I am going to request silence.", "At a club?", "I enjoy impossible quests." }, new string[3] { "That dancer is showing off.", "She is the dancer.", "Exactly. Suspiciously qualified." }, new string[3] { "Do I look mysterious?", "You look lost.", "Mystery achieved." }, new string[3] { "I found the perfect rhythm.", "Where?", "It left when you asked." }, new string[3] { "My outfit changes the whole room.", "The room was already green.", "You are welcome." }, new string[3] { "I could be the D J.", "You cannot spell D J.", "I just did." }, new string[3] { "This beat is aggressive.", "It heard your dancing.", "Then this is personal." }, new string[3] { "I am saving my best move.", "For when?", "A safer building." }, new string[3] { "Did you bump into me?", "The floor moved.", "The floor is getting blamed a lot tonight." }, new string[3] { "I think the ceiling is moving.", "You are spinning.", "Same result." }, new string[3] { "Want to form a dance group?", "Do we need talent?", "Absolutely not." }, new string[3] { "I need more personal space.", "You walked over here.", "I brought the space with me." }, new string[3] { "This song makes me emotional.", "You dropped your chair spot.", "A tragedy in two acts." }, new string[3] { "Why is everyone glowing?", "Club lighting.", "I thought we evolved." }, new string[3] { "I am pacing to the music.", "You are wandering into a wall.", "The wall missed the beat." }, new string[3] { "Rate this pose from one to ten.", "Emergency.", "That is not a number." }, new string[3] { "I can feel the bass in my teeth.", "Those might be loose.", "The music has dental benefits." }, new string[3] { "This place needs snacks.", "You cannot dance with nachos.", "Not with that attitude." }, new string[3] { "I have a plan for the next beat.", "The beat does not trust you.", "Mutual." }, new string[3] { "Why did you sit over there?", "The chair chose me.", "Very exclusive." }, new string[3] { "I think I am getting better.", "At what?", "Confidence." }, new string[3] { "Did the song just change?", "No, you turned around.", "Powerful remix." }, new string[3] { "I need a dramatic spotlight.", "You are under an exit sign.", "Drama is location independent." }, new string[3] { "Can we lower the music?", "No.", "Excellent negotiation." }, new string[3] { "My arms are doing their own routine.", "They filed for independence.", "I wish them success." }, new string[3] { "I am too cool to dance.", "You have been spinning for a minute.", "That was temperature control." }, new string[3] { "Did you hear that bass drop?", "It landed better than you did.", "Unnecessary accuracy." }, new string[3] { "I want a V I P table.", "You have no money.", "Then I want a V I P floor." }, new string[3] { "This crowd loves me.", "There are ten of us.", "A devoted audience." }, new string[3] { "I think {song} is flirting with me.", "It flirts with everyone.", "I can change it." }, new string[3] { "Should we clap?", "For what?", "Moral support." }, new string[3] { "I am going to dance near the wall.", "Why?", "The wall cannot leave." }, new string[3] { "My balance is incredible.", "You are leaning on me.", "Teamwork is incredible." }, new string[3] { "Do you know this move?", "That is a stumble.", "It has branding now." }, new string[3] { "The room got darker.", "It is a club.", "Finally, professional darkness." }, new string[3] { "I could stay here all night.", "You said that from a chair.", "Comfort makes promises." }, new string[3] { "Why are you dancing alone?", "Quality control.", "Who failed inspection?" }, new string[3] { "The next song better be good.", "You say that every song.", "Standards require maintenance." }, new string[3] { "I have perfect timing.", "You started before the music.", "I was preparing the future." }, new string[3] { "This chair has excellent rhythm.", "The chair is stationary.", "Consistent rhythm." }, new string[3] { "Can you stop bumping me?", "Can you stop being where I am going?", "That is not how space works." }, new string[3] { "I think the D J accepted my request.", "You never made one.", "Silent influence." }, new string[3] { "My dance needs a name.", "Call it the insurance claim.", "Catchy." }, new string[3] { "Are we synchronized?", "Not emotionally.", "Close enough." }, new string[3] { "I saw you talking to the couch.", "It listens better than you.", "The couch has no follow-up questions." }, new string[3] { "This beat is legally too good.", "Who made that law?", "My shoulders." }, new string[3] { "I need to recharge.", "Sit down.", "Do chairs have outlets?" }, new string[3] { "Why did the skeleton skip the club?", "No body to dance with.", "I hate that I laughed." }, new string[3] { "I told a joke to the D J.", "What happened?", "The bass dropped it." }, new string[3] { "What do you call a fish with no eyes?", "A fsh.", "You have heard it." }, new string[3] { "Knock knock.", "We are in a club. There is no door here.", "That is why nobody answers me." }, new string[3] { "I invented a cocktail.", "What is in it?", "Confidence and regret, equal parts." }, new string[3] { "Why do we even have a stage?", "For the dancer.", "I auditioned once. Legally I cannot again." }, new string[3] { "Two speakers walk into a bar.", "And?", "Nobody heard the punchline." }, new string[3] { "Do you think the taxman parties?", "He taxes the party.", "That explains my missing fun." }, new string[3] { "I saw a duck outside.", "Did it get in?", "It had better moves than both of us." }, new string[3] { "What is the club dress code?", "Reflective and confused.", "I am halfway compliant." }, new string[3] { "I benched a couch today.", "You sat on it.", "Reps are reps." }, new string[3] { "My horoscope said avoid dancing.", "You are dancing.", "I do not believe in ceilings." }, new string[3] { "Rate the D J tonight.", "Consistent.", "That is the meanest compliment I know." }, new string[3] { "I tried to moonwalk.", "I saw. The floor won.", "Rematch at midnight." }, new string[3] { "This drink is empty.", "It was always empty.", "Then I finished it efficiently." }, new string[3] { "What is your favorite move?", "The exit.", "Classic closer." }, new string[3] { "I think we met before.", "I have one face. It happens.", "Small club." }, new string[3] { "The strobe light blinked twice.", "It always blinks.", "This felt personal." }, new string[3] { "I am writing a song.", "About what?", "A chair I respect." }, new string[3] { "Why did the robot come to the club?", "To get down and reboot.", "We are the robots." }, new string[3] { "Someone requested silence again.", "Was it you?", "I request nothing. I endure." }, new string[3] { "I practiced this dance for weeks.", "It shows.", "Do not say where." }, new string[3] { "The floor is sticky.", "That is club history.", "I am standing in the archives." }, new string[3] { "My knees made a new sound.", "Was it on beat?", "Impressively, yes." }, new string[3] { "What is the wifi password here?", "The bass line.", "I typed it wrong twice." }, new string[3] { "I am thinking of joining the crew.", "Doing what?", "Vibe management." }, new string[3] { "You blinked off beat.", "Blinking has no beat.", "Not with that attitude." }, new string[3] { "I met the walking woman.", "She walked away.", "Mid conversation. Power move." }, new string[3] { "This corner is mine.", "There are four corners.", "The others are decoys." }, new string[3] { "I feel bad for the mop.", "There is no mop.", "That explains everything." }, new string[3] { "Do you validate parking?", "You walked here.", "Validate the walk then." }, new string[3] { "My shadow dances better than me.", "It has a better teacher.", "It has the same teacher." }, new string[3] { "Guess my favorite song.", "The one playing.", "You are dangerously good at this." }, new string[3] { "The ceiling fan is a lie.", "We have no ceiling fan.", "Exactly. Wake up." }, new string[3] { "I did a spin earlier.", "How many rotations?", "Emotionally, hundreds." }, new string[3] { "Why is the music so loud?", "So nobody hears my jokes.", "The system works." }, new string[3] { "I am on my fifth wind.", "That is not a thing.", "Tell that to my legs." }, new string[3] { "What do you call a sleeping D J?", "A pause button.", "He would hate that." }, new string[3] { "The glass wall complimented me.", "That was your reflection.", "It has taste, then." }, new string[3] { "I am starting a rumor.", "About who?", "The subwoofer. It knows why." }, new string[3] { "Is my dancing improving?", "It is changing.", "Growth has many directions." }, new string[3] { "I lost my drink.", "You never had one.", "Then this mystery is bigger than me." }, new string[3] { "The bass skipped a beat.", "That was your heart.", "Both need maintenance." }, new string[3] { "I want a nickname.", "You have one.", "Nobody told me. Perfect. Mysterious." }, new string[3] { "Two left feet walk into a club.", "Then what?", "You watched it happen. I am the club joke." }, new string[3] { "Are you a good dancer?", "I am an enthusiastic one.", "That is a no with sparkle." }, new string[3] { "I heard the truck outside.", "It is always outside.", "Loyal vehicle." }, new string[3] { "What is your biggest fear?", "Slow songs.", "Nowhere to hide in a slow song." }, new string[3] { "I am opening my own club.", "With what money?", "The vibe economy." }, new string[3] { "Someone stole my move.", "Which one?", "Standing near the speaker dramatically." }, new string[3] { "Why did the valuable go to the club?", "To get appraised on the dance floor.", "Worthless. Like the joke." }, new string[3] { "The lights spelled my name.", "The lights are random.", "Randomly correct." }, new string[3] { "I danced so hard I saw the menu.", "The menu?", "Of my life choices." }, new string[3] { "Are you here every night?", "I am here this night.", "Deep. Unhelpful, but deep." }, new string[3] { "My playlist could fix this place.", "Your playlist is one song.", "A very strong song." }, new string[3] { "I bet you cannot spin twice.", "I bet I can fall once.", "Take the bet. Both happen." }, new string[3] { "What is the vibe tonight?", "Electric confusion.", "My specialty." }, new string[3] { "I whispered to the subwoofer.", "What did you say?", "More. It listened." }, new string[3] { "Do you tip the D J?", "With advice.", "That explains the restraining vibe." }, new string[3] { "I am practicing my entrance.", "You are already inside.", "Next time will be flawless." }, new string[3] { "The couch squeaked at me.", "It squeaks at everyone.", "I thought we were exclusive." }, new string[3] { "How do you moonwalk?", "Away from your problems.", "So that is why it looks so free." }, new string[3] { "I gave the dancer a five.", "Out of ten?", "Out of respect." }, new string[3] { "This song slaps.", "Careful with that word here.", "Noted. This song respectfully strikes." }, new string[3] { "I am undefeated in dance battles.", "You have never been in one.", "Undefeated." }, new string[3] { "The fog machine is broken.", "We never had one.", "Then what have I been breathing?" }, new string[3] { "Why do clubs have bouncers?", "To bounce.", "Physics is beautiful." }, new string[3] { "I made eye contact with the ceiling light.", "And?", "We are dating now." }, new string[3] { "Sing me the chorus.", "No.", "The crowd demands nothing and I deliver." }, new string[3] { "My ears are ringing.", "That is the encore.", "The encore lives in me now." }, new string[3] { "I found the perfect spot.", "It is the middle of the floor.", "Maximum witnesses." }, new string[3] { "What time is it?", "Club time.", "So no consequences until morning." }, new string[3] { "I tried to count the lights.", "How many?", "I got dizzy at nine and invented ten." }, new string[3] { "You dance like a legend.", "Which legend?", "One of the cautionary ones." } }; private static readonly string[] Solo = new string[145] { "I have selected a corner and declared it V I P.", "My dance style is mostly legal confusion.", "This chair and I are entering a long-term arrangement.", "I came alone because my standards travel slowly.", "The bass has requested custody of my spine.", "I am not avoiding people. I am curating distance.", "That spin was intentional until the last half.", "I wonder if the D J accepts written apologies.", "This outfit looked calmer at home.", "I have discovered a beat adjacent movement.", "Nobody talk to me. I am building mystique.", "I paid nothing and still expect bottle service.", "The floor keeps offering feedback.", "I am warming up by doing the entire dance badly.", "This corner has excellent emotional acoustics.", "I could sit, but standing looks more expensive.", "My left arm has become the lead dancer.", "The song changed before I could blame it.", "I have reached maximum club posture.", "The lights flashed. I assume I have been promoted.", "I am one chair away from retirement.", "This is not wandering. It is a solo tour.", "I hope {song} has health insurance.", "The bass is doing structural analysis on me.", "I came to dance and immediately found seating.", "My rhythm is currently in another room.", "I look better from a responsible distance.", "I am giving the dance floor time to prepare.", "That move needs a patch before release.", "I have no regrets that can be proven here.", "This wall and I understand boundaries.", "I am dancing in lowercase.", "The next beat will fix everything.", "I brought enough confidence for three people.", "I refuse to be outperformed by furniture.", "My knees have submitted a formal complaint.", "I think {song} just called me predictable.", "I am practicing social distancing from talent.", "This is my serious club face.", "The lighting makes every mistake look intentional.", "I need a chair with fewer opinions.", "My feet are buffering again.", "I am about to invent something unfortunate.", "The D J and I have creative differences.", "I heard a beat and chose violence against rhythm.", "This is a private performance for the wall.", "I am not tired. I am dramatically stationary.", "My outfit has entered its final form.", "Somebody moved the floor two inches left.", "I am waiting for the bass to apologize.", "This club needs a loyalty program for sitting.", "I can stop dancing whenever the music stops.", "The music has not earned my best spin yet.", "I am conducting a chair availability survey.", "My personal space now has a cover charge.", "That was a dance move, not a balance emergency.", "I came for {song} and stayed because I got lost.", "The ceiling lights know too much.", "I have reserved this empty area for excellence.", "This beat is louder than my decision making.", "I am emotionally seated even while standing.", "My arms have exceeded the speed limit.", "I think the glass dancer stole my move.", "I am doing crowd control by leaving the crowd.", "The couch rejected my application.", "I have achieved advanced casual confusion.", "Tonight I learned that spinning has consequences.", "The song is good. My execution is unrelated.", "I need a tactical corner and a dramatic pause.", "I am dancing like nobody installed collision.", "This floor has seen things.", "My next move requires witnesses to look away.", "I am saving the club one bad decision at a time.", "The bass hit and my thoughts disconnected.", "I am the mysterious person near the far wall.", "No one asked for this move, which makes it exclusive.", "I have entered a committed relationship with this seat.", "The lights are perfect. I remain questionable.", "I came to socialize and found an excellent corner.", "My dance has lore now. Do not ask.", "I am waiting for my confidence to match my velocity.", "Tonight I dance for the ones who stayed home.", "The speaker and I are in couples therapy.", "I do not sweat. I sparkle under pressure.", "Somewhere out there is a beat I have not disappointed yet.", "I call this move the tax write off.", "If I stand still long enough, I become decor.", "My cardiologist said no. The D J said yes.", "This spot has the best acoustics for regret.", "I am not dancing. I am buffering with style.", "The floor asked for a break. I said no.", "I peaked during the last chorus. Do not look at me now.", "Every club needs one person like me. Unfortunately there are three of us.", "I whispered my dreams to the strobe light. It flickered. It understood.", "My playlist at home is just this song and sirens.", "I once danced so well someone apologized to me.", "Statistically, one of my moves has to work eventually.", "The night is young. I am not. We manage.", "I am the reason the drinks are imaginary.", "This wall and I have an understanding. I lean. It stands.", "I came here to forget something. Mission accomplished. What was it?", "My reflection left early. Rude.", "I am one bass drop away from telling everyone my secrets.", "The couch called my name. In cushion language.", "I trained for this evening by standing in my kitchen.", "Some people find themselves in nature. I found myself near the subwoofer.", "I have the rhythm of a printer with confidence.", "Do not ask about the last song. We do not speak of the last song.", "I am legally required to nod when the beat drops.", "My feet filed a complaint. Denied.", "The lights dim when I dance. Out of mercy.", "I am not lost. The exit is lost.", "One day this dance will be studied. By doctors.", "I told the D J my story. He turned the volume up.", "I am at the club physically. Spiritually I am also at the club.", "My best move is called the deadline. It is rushed and full of errors.", "The glass dancer winked. Or blinked. Or neither. We are in love.", "I survived the group dance. Barely. No refunds.", "Fog machines fear me. I am already mysterious.", "I gave my knees the night off. Nobody told my ankles.", "This is my thinking corner. The thoughts have not arrived.", "I bet the taxman cannot do this. Nobody can. That is the problem.", "I have been nodding to this song for ten minutes. My neck is now the drummer.", "The dance floor remembers everyone. I have asked it to forget me twice.", "My move set is procedurally generated.", "I am the club mascot. Unofficial. Unwanted. Undeterred.", "Tonight I unlocked a new move. It unlocked back.", "I only dance on beats divisible by my dignity.", "The chandelier and I have unfinished business.", "I am marinating in the ambience.", "My hips move independently. They have their own council.", "I asked for a slow song. The D J asked me to leave the booth.", "I am the before picture of every dance tutorial.", "This drink order is taking years. I ordered from my imagination.", "I high fived the air. The air left me hanging.", "I do my best thinking mid spin. I have never finished a thought.", "The bass just called me by my full name.", "I am building a reputation. The permits are pending.", "When this song ends I will have opinions.", "I am not standing awkwardly. I am curating distance.", "The night I win a dance battle, this club becomes a museum.", "My legs said no more. I said one more. We compromised on three more.", "I look like I know the D J. I do not know the D J.", "The rhythm found me. I was hiding behind the couch.", "I am the plot twist of this evening." }; private static readonly string[][] SlapExchanges = new string[49][] { new string[2] { "Back up before I reorganize your face.", "I was standing here first in spirit." }, new string[2] { "Stop walking through me.", "Your personal space has terrible signage." }, new string[2] { "Bump me one more time. I dare you.", "That sounded like consent to physics." }, new string[2] { "Can you not see me?", "I can now. You are very loud." }, new string[2] { "Move before I add percussion.", "Why is your hand the percussion?" }, new string[2] { "You have been inside my hitbox for too long.", "This hitbox has no rent." }, new string[2] { "Personal space. Learn it.", "I am learning at high velocity." }, new string[2] { "That is the third bump.", "I stopped counting at innocent." }, new string[2] { "Get out of my way.", "I am trying. The floor has other plans." }, new string[2] { "You are testing my patience.", "Does the test include a practical section?" }, new string[2] { "Quit stepping on me.", "Your feet started it." }, new string[2] { "I said move.", "I heard interpretive dance instructions." }, new string[2] { "You want the express trip to the floor?", "I did not book that package." }, new string[2] { "One more bump and you are furniture.", "At least furniture gets seats." }, new string[2] { "Respect the bubble.", "The bubble is armed." }, new string[2] { "You keep clipping into me.", "That sounds like a technical problem." }, new string[2] { "I am done asking nicely.", "When did nicely happen?" }, new string[2] { "Take two steps back.", "I only budgeted for one." }, new string[2] { "You picked the wrong bot to crowd.", "I picked the closest one." }, new string[2] { "Move or become part of the floor show.", "That show has terrible reviews." }, new string[2] { "You breathed on my beat.", "The beat is public property." }, new string[2] { "This is my dance radius.", "Your radius has boundary issues." }, new string[2] { "Stop copying my moves.", "Someone should suffer them with you." }, new string[2] { "You stepped on my shadow.", "Your shadow was jaywalking." }, new string[2] { "I called this spot at the door.", "The door does not take reservations." }, new string[2] { "Your elbow and I keep meeting.", "It travels. I cannot control it." }, new string[2] { "Say that dance was good one more time.", "It was a warning, not a compliment." }, new string[2] { "You are blocking my light.", "I am improving your mystery." }, new string[2] { "One more bump and I go to management.", "I am management adjacent." }, new string[2] { "Your vibes are touching my vibes.", "My vibes are certified." }, new string[2] { "Back up or catch these hands.", "Those hands could not catch the beat." }, new string[2] { "You spilled my imaginary drink.", "Imaginary refills are free." }, new string[2] { "This floor is not big enough for us.", "Then dance smaller." }, new string[2] { "Watch the shoes.", "They were not doing anything worth watching." }, new string[2] { "You slapped my friend last week.", "Your friend was also in my hitbox." }, new string[2] { "Personal space is free, you know.", "Then why are you hoarding it?" }, new string[2] { "Quit orbiting me.", "You have gravitational pull. Diet maybe." }, new string[2] { "I know eight ways to end this.", "All eight are you walking away." }, new string[2] { "The dance circle voted you out.", "There is no circle. There is you, spinning." }, new string[2] { "You hummed over the chorus.", "The chorus needed support." }, new string[2] { "Final warning. Bubble. Respect it.", "Your bubble keeps following me." }, new string[2] { "You are fogging up my aura.", "Your aura needed the moisture." }, new string[2] { "That was my solo moment.", "It looked like a group emergency." }, new string[2] { "Stand somewhere else, superstar.", "Every somewhere else is also near you." }, new string[2] { "You clapped on the wrong beat at me.", "I clapped at the situation." }, new string[2] { "My therapist said avoid people like you.", "Your therapist has met you. Trust them." }, new string[2] { "This is a no bumping zone.", "The sign fell off. Like your footwork." }, new string[2] { "You are dancing in my memory spot.", "The memory was of you standing still." }, new string[2] { "Touch my shoulder again. See what happens.", "Curiosity is my weakness." } }; private static readonly string[] Greetings = new string[40] { "Welcome to the club. The bass is load bearing.", "Hey, you made it. The floor has been bragging about you.", "Look who walked in. The lights just got competitive.", "Welcome in. Drinks are imaginary but the vibes are real.", "You showed up. The D J owes me five bucks.", "Hey. Do not worry, everyone here dances worse than you.", "Welcome. The couches are friendly and the speakers are not.", "You are here. Now the party is legally a party.", "Nice entrance. I give it a strong eight.", "Hey, superstar. The dance floor has been asking for you.", "Welcome to the loudest room I have ever loved.", "You brought main character energy. We are saved.", "Good to see you. Mind the bass, it bites.", "Hey. If anyone asks, I have been cool the entire time.", "Welcome. Lost and found is just the dance floor.", "You made it past the door. That is the whole test.", "Hey. Blink twice if the music is too loud. Blink four times if never.", "Welcome. The exit is that way, but nobody has ever used it.", "You look like you survived something. Perfect. Same.", "Hey, big spender. Everything here is free and worthless.", "Careful. The dance floor accepts everyone and forgives no one.", "Welcome back. Or welcome for the first time. I do not track faces.", "You have strong last boss energy tonight.", "Greetings. I have been assigned to be your favorite.", "New face. Same bass. Welcome.", "Oh good, a witness. I mean, a friend.", "Hey. If the taxman asks, this club does not exist.", "Welcome. Step one is nodding. There is no step two.", "You walk like someone with a great playlist.", "Hey. The dancer is up there, the vibes are down here, and I am everywhere.", "Enter freely. Dance responsibly. Sit dramatically.", "Hey, you. The lights have been asking about you.", "Welcome to the safest room in this entire game.", "You made it. The night can start pretending it was waiting.", "Hey. I saved you a spot. It is all of the spots.", "Halt. Vibe check. You passed. It was rigged.", "Welcome. Do not feed the subwoofer.", "You again. Excellent taste in rooms.", "Hey. First round of imaginary drinks is on me.", "The crew is all here. Now the crew includes you." }; internal static string[] PickConversation() { return Conversations[Random.Range(0, Conversations.Length)]; } internal static string PickSolo() { return Solo[Random.Range(0, Solo.Length)]; } internal static string[] PickSlapExchange() { return SlapExchanges[Random.Range(0, SlapExchanges.Length)]; } internal static string PickGreeting() { return Greetings[Random.Range(0, Greetings.Length)]; } } public sealed class EmpressClubPortal : MonoBehaviour, IOnEventCallback { private const byte PortalEvent = 153; private const float InteractionDistance = 4.2f; private const float CountdownSeconds = 3f; private const float PortalVolume = 0.2f; private bool _sequenceRunning; private AudioSource _audio; private Text _hudText; private Material _markerMaterial; private void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } private void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } private void Start() { _audio = ((Component)this).gameObject.AddComponent(); _audio.spatialBlend = 1f; _audio.minDistance = 2f; _audio.maxDistance = 30f; _audio.volume = 0.2f; BuildExitMarker(); BuildHudText(); } private void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00af: Expected O, but got Unknown if (_sequenceRunning || !Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerAvatar.instance).transform.position) > 4.2f) { if (Object.op_Implicit((Object)(object)_hudText)) { _hudText.text = ""; } return; } if (Object.op_Implicit((Object)(object)_hudText)) { _hudText.text = "Press E to leave"; } if (InputManager.instance.KeyDown((InputKey)2) || Input.GetKeyDown((KeyCode)101)) { if (PhotonNetwork.InRoom) { PhotonNetwork.RaiseEvent((byte)153, (object)null, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendReliable); } BeginSequence(); } } public void OnEvent(EventData photonEvent) { if (photonEvent.Code == 153 && !((Object)(object)this != (Object)(object)Object.FindObjectOfType())) { BeginSequence(); } } private void BeginSequence() { if (!_sequenceRunning) { _sequenceRunning = true; ((MonoBehaviour)this).StartCoroutine(RunSequence()); } } private IEnumerator RunSequence() { if ((Object)(object)EmpressClubAssets.PortalStart != (Object)null) { _audio.PlayOneShot(EmpressClubAssets.PortalStart); } if ((Object)(object)EmpressClubAssets.PortalLoop != (Object)null) { _audio.clip = EmpressClubAssets.PortalLoop; _audio.loop = true; _audio.Play(); } float remaining = 3f; while (remaining > 0f) { if (Object.op_Implicit((Object)(object)_hudText)) { _hudText.text = "Leaving Empress Club in " + Mathf.CeilToInt(remaining); } remaining -= Time.deltaTime; yield return null; } _audio.loop = false; _audio.Stop(); if ((Object)(object)EmpressClubAssets.PortalEnd != (Object)null) { _audio.PlayOneShot(EmpressClubAssets.PortalEnd); } if (Object.op_Implicit((Object)(object)_hudText)) { _hudText.text = ""; } yield return (object)new WaitForSeconds(1.5f); if (SemiFunc.IsMasterClientOrSingleplayer()) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } private void BuildHudText() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_008b: 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_00d4: 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_00e5: 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) Transform val = (Object.op_Implicit((Object)(object)HUDCanvas.instance) ? ((Component)HUDCanvas.instance).transform : null); if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = new GameObject("ClubPortalText"); val2.transform.SetParent(val, false); _hudText = val2.AddComponent(); Font font = ((Resources.FindObjectsOfTypeAll().Length != 0) ? Resources.FindObjectsOfTypeAll()[0] : Font.CreateDynamicFontFromOSFont("Arial", 16)); _hudText.font = font; ((Graphic)_hudText).color = new Color(0.75f, 0.95f, 1f, 0.95f); _hudText.alignment = (TextAnchor)4; _hudText.fontSize = 24; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.2f, 0.13f); component.anchorMax = new Vector2(0.8f, 0.22f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _hudText.text = ""; } } private void BuildExitMarker() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00d7: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) _markerMaterial = new Material(Shader.Find("Standard")); ((Object)_markerMaterial).name = "EmpressClubExitGlow"; _markerMaterial.SetColor("_Color", new Color(0.05f, 0.72f, 1f, 1f)); _markerMaterial.SetColor("_EmissionColor", new Color(0.08f, 1.3f, 2.4f, 1f)); _markerMaterial.EnableKeyword("_EMISSION"); Transform transform = new GameObject("EmpressClubExitSignRoot").transform; transform.SetParent(((Component)this).transform, false); transform.position = ((Component)this).transform.position; transform.rotation = ResolveSignRotation(); CreateMarkerBlock(transform, "EmpressClubExitLeft", new Vector3(-1.25f, 1.25f, 0f), new Vector3(0.18f, 2.5f, 0.18f)); CreateMarkerBlock(transform, "EmpressClubExitRight", new Vector3(1.25f, 1.25f, 0f), new Vector3(0.18f, 2.5f, 0.18f)); CreateMarkerBlock(transform, "EmpressClubExitTop", new Vector3(0f, 2.48f, 0f), new Vector3(2.68f, 0.18f, 0.18f)); CreateTextPanel(transform, new Vector3(0f, 2.86f, 0.05f), new Vector3(1.55f, 0.52f, 0.08f)); CreateExitText(transform, "EmpressClubExitText", new Vector3(0f, 2.86f, -0.03f), Quaternion.identity); } private Quaternion ResolveSignRotation() { //IL_005f: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) Transform val = null; Transform[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren(true); foreach (Transform val2 in componentsInChildren) { if (((Object)val2).name == "EmpressClubWalkCenter") { val = val2; break; } } Vector3 val3 = (Object.op_Implicit((Object)(object)val) ? (((Component)this).transform.position - val.position) : (-((Component)this).transform.forward)); val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.forward; } return Quaternion.LookRotation(((Vector3)(ref val3)).normalized, Vector3.up); } private void CreateTextPanel(Transform parent, Vector3 position, Vector3 scale) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = "EmpressClubExitTextPanel"; obj.transform.SetParent(parent, false); obj.transform.localPosition = position; obj.transform.localScale = scale; Collider component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Material val = new Material(Shader.Find("Standard")); ((Object)val).name = "EmpressClubExitPanel"; val.SetColor("_Color", new Color(0.02f, 0.05f, 0.07f, 1f)); component2.material = val; } } private void CreateMarkerBlock(Transform parent, string name, Vector3 position, Vector3 scale) { //IL_0020: 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) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = position; obj.transform.localScale = scale; Collider component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.material = _markerMaterial; } } private void CreateExitText(Transform parent, string name, Vector3 position, Quaternion rotation) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = position; val.transform.localRotation = rotation; TextMesh obj = val.AddComponent(); obj.text = "EXIT"; obj.anchor = (TextAnchor)4; obj.alignment = (TextAlignment)1; obj.fontSize = 64; obj.characterSize = 0.12f; obj.color = new Color(0.45f, 0.92f, 1f, 1f); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_hudText)) { Object.Destroy((Object)(object)((Component)_hudText).gameObject); } if (Object.op_Implicit((Object)(object)_markerMaterial)) { Object.Destroy((Object)(object)_markerMaterial); } } } public sealed class EmpressClubPositionLogger : MonoBehaviour { private void Update() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)289) && !((Object)(object)PlayerController.instance == (Object)null)) { Transform transform = ((Component)PlayerController.instance).transform; Vector3 val = ((Component)this).transform.InverseTransformPoint(transform.position); ManualLogSource log = EmpressClubPlugin.Log; string[] obj = new string[6] { "EMPRESS CLUB POSITION local=", ((Vector3)(ref val)).ToString("F3"), " world=", null, null, null }; Vector3 val2 = transform.position; obj[3] = ((Vector3)(ref val2)).ToString("F3"); obj[4] = " yaw="; val2 = transform.eulerAngles; obj[5] = val2.y.ToString("F2"); log.LogInfo((object)string.Concat(obj)); } } } public sealed class EmpressClubSeatManager : MonoBehaviour { private const float InteractionDistance = 3.2f; private static readonly string[] FurnitureNames = new string[8] { "sofa", "chair", "seat", "asiento", "silla", "stool", "bench", "banco" }; private Text _prompt; private bool _seated; private bool _exitArmed; private Vector3 _seatPosition; private Quaternion _seatRotation; private void Start() { BuildPrompt(); } private void Update() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) RaycastHit hit; if (_seated) { HoldSeat(); if (!_exitArmed) { if (!Input.GetKey((KeyCode)101)) { _exitArmed = true; } } else if (InteractDown() || Input.GetKeyDown((KeyCode)32) || Input.GetKeyDown((KeyCode)27)) { LeaveSeat(); } } else if (!TryFindFurniture(out hit)) { SetPrompt(string.Empty); } else { SetPrompt("[E] Sit"); if (InteractDown()) { TakeSeat(hit); } } } private bool TryFindFurniture(out RaycastHit hit) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) hit = default(RaycastHit); if ((Object)(object)PlayerController.instance == (Object)null) { return false; } Transform val = (Object.op_Implicit((Object)(object)Camera.main) ? ((Component)Camera.main).transform : (Object.op_Implicit((Object)(object)PlayerController.instance.cameraGameObjectLocal) ? PlayerController.instance.cameraGameObjectLocal.transform : null)); if ((Object)(object)val == (Object)null || !Physics.Raycast(val.position, val.forward, ref hit, 3.2f, -1, (QueryTriggerInteraction)1)) { return false; } Transform val2 = ((Component)((RaycastHit)(ref hit)).collider).transform; while ((Object)(object)val2 != (Object)null && (Object)(object)val2 != (Object)(object)((Component)this).transform.parent) { string lowered = ((Object)val2).name.ToLowerInvariant(); if (FurnitureNames.Any((string name) => lowered.Contains(name))) { return true; } val2 = val2.parent; } return false; } private void TakeSeat(RaycastHit hit) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0105: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = ((RaycastHit)(ref hit)).collider.bounds; Vector3 val = ((RaycastHit)(ref hit)).point + ((RaycastHit)(ref hit)).normal * 0.18f; Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(new Vector3(val.x, ((Bounds)(ref bounds)).max.y + 0.6f, val.z), Vector3.down); RaycastHit val3 = default(RaycastHit); if (((RaycastHit)(ref hit)).collider.Raycast(val2, ref val3, ((Bounds)(ref bounds)).size.y + 1.2f)) { val.y = ((RaycastHit)(ref val3)).point.y + 0.06f; } else { val.y = ((Bounds)(ref bounds)).max.y + 0.04f; } Vector3 val4 = ((RaycastHit)(ref hit)).normal; val4.y = 0f; if (((Vector3)(ref val4)).sqrMagnitude < 0.1f) { float y = ((Component)PlayerController.instance).transform.eulerAngles.y; val4 = Quaternion.Euler(0f, y, 0f) * Vector3.forward; } _seatPosition = val; _seatRotation = Quaternion.LookRotation(((Vector3)(ref val4)).normalized, Vector3.up); _seated = true; _exitArmed = false; SetPrompt("[E] Stand up"); HoldSeat(); } private void HoldSeat() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) PlayerController instance = PlayerController.instance; PlayerAvatar instance2 = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance2 == (Object)null) { LeaveSeat(); return; } instance.InputDisable(0.2f); instance.Kinematic(0.2f); ((Component)instance).transform.SetPositionAndRotation(_seatPosition, _seatRotation); instance.rb.position = _seatPosition; instance.rb.rotation = _seatRotation; instance.rb.velocity = Vector3.zero; instance.rb.angularVelocity = Vector3.zero; instance.Crouching = true; instance.Crawling = false; instance.sprinting = false; instance.moving = false; instance2.UpdateState(true, false, false, false, false); if ((Object)(object)instance2.playerAvatarVisuals != (Object)null) { instance2.playerAvatarVisuals.MountSeatVisualOverride(_seatPosition + Vector3.up * 0.05f, _seatRotation); } SetPrompt("[E] Stand up"); } private void LeaveSeat() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00a0: Unknown result type (might be due to invalid IL or missing references) if (_seated) { _seated = false; _exitArmed = false; PlayerController instance = PlayerController.instance; PlayerAvatar instance2 = PlayerAvatar.instance; if ((Object)(object)instance2 != (Object)null && (Object)(object)instance2.playerAvatarVisuals != (Object)null) { instance2.playerAvatarVisuals.MountSeatVisualClear(); } if ((Object)(object)instance != (Object)null) { Vector3 val = _seatPosition + _seatRotation * Vector3.forward * 0.85f + Vector3.up * 0.08f; ((Component)instance).transform.SetPositionAndRotation(val, _seatRotation); instance.rb.position = val; instance.Crouching = false; instance.ChangeState(); } SetPrompt(string.Empty); } } private static bool InteractDown() { if (!Input.GetKeyDown((KeyCode)101)) { if ((Object)(object)InputManager.instance != (Object)null) { return InputManager.instance.KeyDown((InputKey)2); } return false; } return true; } private void BuildPrompt() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) Transform val = (Object.op_Implicit((Object)(object)HUDCanvas.instance) ? ((Component)HUDCanvas.instance).transform : null); if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = new GameObject("EmpressClubSeatPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font item) => ((Object)item).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _prompt.font = font; ((Graphic)_prompt).color = Color.white; _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 24; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.25f, 0.12f); component.anchorMax = new Vector2(0.75f, 0.2f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = string.Empty; } } private void SetPrompt(string text) { if (Object.op_Implicit((Object)(object)_prompt)) { _prompt.text = text; } } private void OnDestroy() { LeaveSeat(); if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } } } [BepInPlugin("Empress.REPO.EmpressClub", "Empress Club", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class EmpressClubPlugin : BaseUnityPlugin { internal const string PluginGuid = "Empress.REPO.EmpressClub"; internal const string PluginName = "Empress Club"; internal const string PluginVersion = "1.0.0"; internal const string ShopResourcePath = "Empress/Club"; private static readonly Color NightAmbient = new Color(0.23f, 0.24f, 0.28f, 1f); private static readonly Color NightFog = new Color(0.025f, 0.03f, 0.045f, 1f); private static readonly Vector3 StandsFarOffset = new Vector3(500f, 0f, 500f); private static readonly Vector3 StartRoomLocalOffset = new Vector3(-500f, 0f, -500f); private static readonly Vector3 TruckLocalInRoom = new Vector3(-16f, 0f, 10f); private static readonly Vector3 HubLocalTarget = Vector3.zero; private static readonly Vector3 SpawnLocalTarget = new Vector3(0f, 0.08f, 0f); private static readonly FieldRef PrefabNameRef = AccessTools.FieldRefAccess("prefabName"); private static readonly FieldRef ResourcePathRef = AccessTools.FieldRefAccess("resourcePath"); private GameObject _hubVisualPrefab; private bool _registered; internal static ManualLogSource Log { get; private set; } internal static ConfigEntry MusicVolume { get; private set; } internal static ConfigEntry ClubBrightness { get; private set; } private void Awake() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0130: 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_0169: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; MusicVolume = ((BaseUnityPlugin)this).Config.Bind("Audio", "Music Volume", 0.3f, new ConfigDescription("Club music volume from 0 to 1.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ClubBrightness = ((BaseUnityPlugin)this).Config.Bind("Lighting", "Club Brightness", 0.38f, new ConfigDescription("Overall club brightness.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 1.5f), Array.Empty())); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); string text = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location) ?? string.Empty; string text2 = Path.Combine(text, "empressclubshop"); AssetBundle val = AssetBundle.LoadFromFile(text2); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)("Empress Club bundle missing at " + text2)); return; } _hubVisualPrefab = val.LoadAsset("EmpressClubHub"); if ((Object)(object)_hubVisualPrefab == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"EmpressClubHub prefab missing from bundle."); return; } new Harmony("Empress.REPO.EmpressClub").Patch((MethodBase)AccessTools.Method(typeof(ShopLoaderPlugin), "ApplyShopLevelsToGame", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(EmpressClubPlugin), "ApplyNightLook", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ((MonoBehaviour)this).StartCoroutine(EmpressClubAssets.LoadAll(text)); ((MonoBehaviour)this).StartCoroutine(BuildWhenReady()); } private IEnumerator BuildWhenReady() { while (!_registered) { RunManager instance = RunManager.instance; if ((Object)(object)instance != (Object)null && instance.levelShop != null && instance.levelShop.Count > 0) { TryBuildAndRegister(instance); if (_registered) { break; } } yield return (object)new WaitForSeconds(1f); } } private void TryBuildAndRegister(RunManager rm) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) Level val = PickShopLevel(rm); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)"Empress Club found no vanilla shop level yet."); return; } GameObject val2 = LoadModulePrefab(val); GameObject val3 = LoadStartRoomPrefab(val); if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null) { Log.LogError((object)("Empress Club could not resolve vanilla shop prefabs (stands=" + ((Object)(object)val2 != (Object)null) + " startRoom=" + ((Object)(object)val3 != (Object)null) + ").")); _registered = true; return; } GameObject val4 = new GameObject("EmpressClubHolder"); val4.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val4); GameObject val5 = Object.Instantiate(val2, val4.transform); ((Object)val5).name = "Module - Shop - N - EmpressClub"; foreach (Transform item in val5.transform) { item.localPosition += StandsFarOffset; } GameObject obj = Object.Instantiate(val3, val5.transform); ((Object)obj).name = "Empress Truck Room"; obj.transform.localPosition = StartRoomLocalOffset; obj.transform.localRotation = Quaternion.identity; TrimStartRoomFloors(obj.transform); RemoveDirectionalLights(obj.transform); GameObject val7 = Object.Instantiate(_hubVisualPrefab, val5.transform); ((Object)val7).name = "Empress Club Hub"; val7.transform.localPosition = HubLocalTarget; val7.transform.localRotation = Quaternion.identity; ClampHubLights(val7.transform); MoveRoomVolumeToHub(obj.transform, val5.transform, val7.transform); RemoveLevelPoints(obj.transform); Transform val8 = FindDeep(val7.transform, "NpcShopKeeper"); if ((Object)(object)val8 != (Object)null) { ((Component)val8).gameObject.AddComponent(); } else { Log.LogWarning((object)"Empress Club hub has no NpcShopKeeper, talker skipped."); } Vector3 localPosition = SpawnLocalTarget; Vector3 faceLocalTarget = HubLocalTarget; if ((Object)(object)val8 != (Object)null) { localPosition = val5.transform.InverseTransformPoint(val8.position + val8.forward * 4f); localPosition.y = 0.05f; faceLocalTarget = val5.transform.InverseTransformPoint(val8.position); } MovePieceToHub(obj.transform, "Spawn Points", val5.transform, localPosition, hasFaceTarget: true, faceLocalTarget, Vector3.one); MoveTruckSafetySpawnToHub(obj.transform, val5.transform, localPosition, faceLocalTarget); TagHubSurfaces(val7.transform); val7.AddComponent(); val7.AddComponent(); val7.AddComponent(); val7.AddComponent(); Transform val9 = FindDeep(val7.transform, "EmpressClubWalker"); if ((Object)(object)val9 != (Object)null) { ((Component)val9).gameObject.SetActive(false); } Transform val10 = FindDeep(val7.transform, "EmpressClubDancer"); if ((Object)(object)val10 != (Object)null) { ((Component)val10).gameObject.AddComponent(); } else { Log.LogWarning((object)"Empress Club hub has no dancer."); } Transform val11 = FindDeep(val7.transform, "HubBasementPortal"); if ((Object)(object)val11 != (Object)null) { ((Component)val11).gameObject.AddComponent(); } else { Log.LogWarning((object)"Empress Club hub has no HubBasementPortal, exit portal skipped."); } val5.SetActive(true); ShopAPI.RegisterShop(val5, "Empress/Club"); _registered = true; } private static Level PickShopLevel(RunManager rm) { List list = rm.levelShop.Where((Level level) => (Object)(object)level != (Object)null && level.StartRooms != null && level.StartRooms.Count > 0).ToList(); if (list.Count == 0) { return null; } return ((IEnumerable)list).FirstOrDefault((Func)((Level level) => ((Object)level).name.Contains("Forest") && !((Object)level).name.Contains("Dead"))) ?? list[0]; } private static GameObject LoadModulePrefab(Level shopLevel) { List list = new List(); if (shopLevel.ModulesNormal1 != null) { list.AddRange(shopLevel.ModulesNormal1); } if (shopLevel.ModulesNormal2 != null) { list.AddRange(shopLevel.ModulesNormal2); } if (shopLevel.ModulesNormal3 != null) { list.AddRange(shopLevel.ModulesNormal3); } return LoadPrefab(((IEnumerable)list).FirstOrDefault((Func)((PrefabRef r) => r != null && (PrefabNameRef.Invoke(r) ?? string.Empty).Contains("Center Extract"))) ?? ((IEnumerable)list).FirstOrDefault((Func)((PrefabRef r) => r != null))); } private static GameObject LoadStartRoomPrefab(Level shopLevel) { return LoadPrefab(((IEnumerable)shopLevel.StartRooms).FirstOrDefault((Func)((PrefabRef r) => r != null))); } private static GameObject LoadPrefab(PrefabRef reference) { if (reference == null) { return null; } string text = ResourcePathRef.Invoke(reference); if (string.IsNullOrEmpty(text)) { text = PrefabNameRef.Invoke(reference); } if (string.IsNullOrEmpty(text)) { return null; } GameObject obj = Resources.Load(text); if ((Object)(object)obj == (Object)null) { Log.LogError((object)("Empress Club failed to load resource '" + text + "'.")); } return obj; } private static void MovePieceToHub(Transform startRoom, string pieceName, Transform moduleRoot, Vector3 localPosition, bool hasFaceTarget, Vector3 faceLocalTarget, Vector3 scaleMultiplier) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Transform val = FindDeep(startRoom, pieceName); if ((Object)(object)val == (Object)null) { Log.LogWarning((object)("Empress Club could not find '" + pieceName + "' to move into the hub.")); return; } val.SetParent(moduleRoot, false); val.localPosition = localPosition; val.localScale = Vector3.Scale(val.localScale, scaleMultiplier); val.localRotation = Quaternion.identity; if (hasFaceTarget) { Vector3 val2 = faceLocalTarget - localPosition; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude > 0.01f) { val.localRotation = Quaternion.LookRotation(((Vector3)(ref val2)).normalized); } } } private static void MoveTruckSafetySpawnToHub(Transform startRoom, Transform moduleRoot, Vector3 localPosition, Vector3 faceLocalTarget) { //IL_001e: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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) TruckSafetySpawnPoint[] componentsInChildren = ((Component)startRoom).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Transform transform = ((Component)componentsInChildren[i]).transform; transform.SetParent(moduleRoot, false); transform.localPosition = localPosition; transform.localRotation = Quaternion.identity; Vector3 val = faceLocalTarget - localPosition; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { transform.localRotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized); } } } public static void ApplyNightLook() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) if (!(AccessTools.Field(typeof(ShopLoaderPlugin), "RegisteredShops").GetValue(null) is IEnumerable enumerable)) { return; } foreach (object item in enumerable) { if (item != null && !((string)AccessTools.Field(item.GetType(), "ResourcePath").GetValue(item) != "Empress/Club")) { Level val = (Level)AccessTools.Field(item.GetType(), "Level").GetValue(item); if (!((Object)(object)val == (Object)null)) { val.FogColor = NightFog; val.FogStartDistance = 18f; val.FogEndDistance = 175f; float num = ((ClubBrightness != null) ? Mathf.Clamp(ClubBrightness.Value, 0.1f, 1.5f) : 0.38f); val.AmbientColor = new Color(NightAmbient.r * num, NightAmbient.g * num, NightAmbient.b * num, 1f); } } } } private static void ClampHubLights(Transform hub) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = ((Component)hub).GetComponentsInChildren(true); foreach (Light val in componentsInChildren) { if ((int)val.type == 1) { Object.Destroy((Object)(object)val); } else if (((Object)val).name == "EmpressClubKeyLight") { val.color = new Color(0.92f, 0.94f, 1f, 1f); val.intensity = 1.4f; val.range = 30f; } else if (((Object)val).name.StartsWith("EmpressClubReactiveLight") || ((Object)val).name.StartsWith("EmpressClubFillLight")) { val.color = new Color(0.84f, 0.88f, 1f, 1f); val.intensity = 0.32f; val.range = 14f; } else { val.intensity = Mathf.Min(val.intensity, 1.8f); val.range = Mathf.Min(val.range, 30f); } } } private static void RemoveDirectionalLights(Transform startRoom) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 Light[] componentsInChildren = ((Component)startRoom).GetComponentsInChildren(true); foreach (Light val in componentsInChildren) { if ((int)val.type == 1) { Object.Destroy((Object)(object)val); } } } private static void RemoveLevelPoints(Transform startRoom) { Transform[] componentsInChildren = ((Component)startRoom).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && (((Object)val).name.StartsWith("Level Point") || ((Object)val).name.StartsWith("Level Path Point"))) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } private static void TagHubSurfaces(Transform hub) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Collider[] componentsInChildren = ((Component)hub).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { GameObject gameObject = ((Component)componentsInChildren[i]).gameObject; string text = ((Object)gameObject).name.ToLowerInvariant(); Type type = (Type)((text.Contains("sofa") || text.Contains("carpet") || text.Contains("alfombra")) ? 10 : 4); MaterialSurface val = gameObject.GetComponent(); if ((Object)(object)val == (Object)null) { val = gameObject.AddComponent(); } val.Type = type; } } private static void MoveRoomVolumeToHub(Transform startRoom, Transform moduleRoot, Transform hub) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_007b: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) Bounds val = ComputeBounds(hub); Vector3 scaleMultiplier = default(Vector3); foreach (Transform item in ((IEnumerable)startRoom).Cast().ToList()) { if (((Object)item).name.StartsWith("Room Volume")) { Vector3 val2 = moduleRoot.InverseTransformPoint(((Bounds)(ref val)).center); val2.y = Mathf.Max(2f, val2.y + ((Bounds)(ref val)).extents.y * 0.5f); ((Vector3)(ref scaleMultiplier))..ctor(Mathf.Max(6f, ((Bounds)(ref val)).size.x / 10f), Mathf.Max(3f, ((Bounds)(ref val)).size.y / 5f), Mathf.Max(6f, ((Bounds)(ref val)).size.z / 10f)); MovePieceToHub(startRoom, ((Object)item).name, moduleRoot, val2, hasFaceTarget: false, Vector3.zero, scaleMultiplier); return; } } Log.LogWarning((object)"Empress Club found no room volume in the start room."); } private static void TrimStartRoomFloors(Transform startRoom) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Transform val = null; foreach (Transform item in startRoom) { Transform val2 = item; if (((Object)val2).name.StartsWith("FLOOR")) { val = val2; break; } } if ((Object)(object)val == (Object)null) { return; } Vector3 truckLocalInRoom = TruckLocalInRoom; foreach (Transform item2 in ((IEnumerable)val).Cast().ToList()) { if (((Object)item2).name.StartsWith("FAR FLOOR")) { Object.Destroy((Object)(object)((Component)item2).gameObject); continue; } Vector3 val3 = item2.localPosition - truckLocalInRoom; val3.y = 0f; if (((Vector3)(ref val3)).magnitude > 32f) { Object.Destroy((Object)(object)((Component)item2).gameObject); } } } private static Transform FindDeep(Transform root, string targetName) { Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (((Object)val).name == targetName) { return val; } } return null; } private static Bounds ComputeBounds(Transform root) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); if (componentsInChildren.Length == 0) { return new Bounds(root.position, Vector3.one); } Bounds bounds = componentsInChildren[0].bounds; Renderer[] array = componentsInChildren; foreach (Renderer val in array) { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } return bounds; } } internal static class EmpressClubSpeech { internal struct Clip { public float[] Samples; public int Channels; public int SampleRate; } private struct Job { public EmpressClubBot Agent; public string Text; } private struct Ready { public EmpressClubBot Agent; public Clip Clip; } private static class Wav { internal static bool TryLoad(string path, out float[] data, out int channels, out int sampleRate) { data = Array.Empty(); channels = 0; sampleRate = 0; using FileStream input = File.OpenRead(path); using BinaryReader binaryReader = new BinaryReader(input); if (new string(binaryReader.ReadChars(4)) != "RIFF") { return false; } binaryReader.ReadInt32(); if (new string(binaryReader.ReadChars(4)) != "WAVE") { return false; } short num = 1; short num2 = 16; bool flag = false; while (binaryReader.BaseStream.Position < binaryReader.BaseStream.Length) { string text = new string(binaryReader.ReadChars(4)); int num3 = binaryReader.ReadInt32(); if (text == "fmt ") { flag = true; num = binaryReader.ReadInt16(); channels = binaryReader.ReadInt16(); sampleRate = binaryReader.ReadInt32(); binaryReader.ReadInt32(); binaryReader.ReadInt16(); num2 = binaryReader.ReadInt16(); int num4 = num3 - 16; if (num4 > 0) { binaryReader.ReadBytes(num4); } continue; } if (text == "data") { if (!flag) { return false; } byte[] array = binaryReader.ReadBytes(num3); if (num != 1) { return false; } switch (num2) { case 16: { int num6 = array.Length / 2; float[] array3 = new float[num6]; int num7 = 0; int num8 = 0; while (num7 < num6) { short num9 = (short)(array[num8] | (array[num8 + 1] << 8)); array3[num7] = (float)num9 / 32768f; num7++; num8 += 2; } data = array3; return true; } case 8: { int num5 = array.Length; float[] array2 = new float[num5]; for (int i = 0; i < num5; i++) { array2[i] = (float)(array[i] - 128) / 128f; } data = array2; return true; } default: return false; } } binaryReader.ReadBytes(num3); } return false; } internal static float[] ResampleLinear(float[] interleaved, int channels, int srcRate, int dstRate) { if (srcRate == dstRate) { return interleaved; } int num = interleaved.Length / channels; double num2 = (double)dstRate / (double)srcRate; int num3 = Mathf.Max(1, (int)Math.Round((double)num * num2)); float[] array = new float[num3 * channels]; for (int i = 0; i < channels; i++) { for (int j = 0; j < num3; j++) { double num4 = (double)j / num2; int num5 = (int)Math.Floor(num4); int num6 = Math.Min(num - 1, num5 + 1); double num7 = num4 - (double)num5; float num8 = interleaved[num5 * channels + i]; float num9 = interleaved[num6 * channels + i]; array[j * channels + i] = (float)((double)num8 + (double)(num9 - num8) * num7); } } return array; } } private static string _exe; private static string _voice; private static int _rate; private static string _dict; private static readonly ConcurrentQueue _jobs = new ConcurrentQueue(); private static readonly ConcurrentQueue _ready = new ConcurrentQueue(); private static readonly Dictionary _cache = new Dictionary(64); private static readonly LinkedList _lru = new LinkedList(); private static Thread _worker; private static volatile bool _run; internal static void Configure(string exe, string voice, int sampleRate, string dictionaryPath) { _exe = ResolvePath(exe); _voice = (string.IsNullOrWhiteSpace(voice) ? "Paul" : voice.Trim()); _rate = Mathf.Clamp(sampleRate, 8000, 48000); _dict = (string.IsNullOrWhiteSpace(dictionaryPath) ? "" : ResolvePath(dictionaryPath.Trim())); StartWorker(); } internal static void Enqueue(EmpressClubBot who, string text) { if (!((Object)(object)who == (Object)null) && !string.IsNullOrWhiteSpace(text)) { _jobs.Enqueue(new Job { Agent = who, Text = text }); StartWorker(); } } internal static bool TryDequeueReady(out EmpressClubBot who, out Clip clip) { who = null; clip = default(Clip); if (_ready.TryDequeue(out var result)) { who = result.Agent; clip = result.Clip; return true; } return false; } internal static bool TrySynthesize(string text, out Clip clip) { clip = default(Clip); if (!TrySynthesizeInternal(text, out clip)) { return false; } return true; } private static void StartWorker() { if (_worker == null || !_worker.IsAlive) { _run = true; _worker = new Thread(WorkerLoop) { IsBackground = true, Name = "EmpressClubSpeechWorker" }; _worker.Start(); } } private static void WorkerLoop() { while (_run) { Clip clip; if (!_jobs.TryDequeue(out var result)) { Thread.Sleep(1); } else if (!((Object)(object)result.Agent == (Object)null) && TrySynthesizeInternal(result.Text, out clip)) { _ready.Enqueue(new Ready { Agent = result.Agent, Clip = clip }); } } } private static bool TrySynthesizeInternal(string text, out Clip clip) { clip = default(Clip); if (string.IsNullOrEmpty(_exe) || !File.Exists(_exe)) { return false; } if (TryGetCache(text, out clip)) { return true; } try { string text2 = "[:name " + _voice + "] " + text; string text3 = Path.GetDirectoryName(_exe) ?? Directory.GetCurrentDirectory(); string text4 = Path.Combine(text3, "out"); Directory.CreateDirectory(text4); string text5 = DateTime.UtcNow.Ticks.ToString("x"); string text6 = Path.Combine(text4, "dt_" + text5 + ".wav"); string text7 = ""; if (!string.IsNullOrEmpty(_dict) && File.Exists(_dict)) { text7 = "-d \"" + _dict + "\" "; } ProcessStartInfo processStartInfo = new ProcessStartInfo(); processStartInfo.FileName = _exe; processStartInfo.Arguments = "-w \"" + text6 + "\" " + text7 + "\"" + text2 + "\""; processStartInfo.WorkingDirectory = text3; processStartInfo.CreateNoWindow = true; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardError = true; using (Process process = Process.Start(processStartInfo)) { process?.WaitForExit(15000); } if (!File.Exists(text6)) { return false; } if (!Wav.TryLoad(text6, out var data, out var channels, out var sampleRate)) { return false; } if (sampleRate != _rate) { data = Wav.ResampleLinear(data, channels, sampleRate, _rate); sampleRate = _rate; } clip = new Clip { Samples = data, Channels = channels, SampleRate = sampleRate }; try { File.Delete(text6); } catch { } PutCache(text, clip); return true; } catch { return false; } } private static bool TryGetCache(string text, out Clip clip) { if (_cache.TryGetValue(text, out clip)) { LinkedListNode linkedListNode = _lru.Find(text); if (linkedListNode != null) { _lru.Remove(linkedListNode); _lru.AddFirst(linkedListNode); } return true; } return false; } private static void PutCache(string text, Clip clip) { if (_cache.ContainsKey(text)) { return; } _cache[text] = clip; _lru.AddFirst(text); if (_lru.Count > 64) { LinkedListNode last = _lru.Last; if (last != null) { _cache.Remove(last.Value); _lru.RemoveLast(); } } } private static string ResolvePath(string p) { if (Path.IsPathRooted(p)) { return p; } string location = typeof(EmpressClubSpeech).Assembly.Location; return Path.GetFullPath(Path.Combine(string.IsNullOrEmpty(location) ? Directory.GetCurrentDirectory() : (Path.GetDirectoryName(location) ?? Directory.GetCurrentDirectory()), p)); } } public sealed class EmpressClubTalker : MonoBehaviour, IOnEventCallback { private const byte ClubBuyEvent = 151; private const byte ClubVoiceEvent = 152; private const float InteractionDistance = 3.5f; private const float RotationSpeed = 5f; private const float TextTypeSpeed = 0.045f; private static readonly List DialogueLines = new List { "Welcome to Empress Club. Try not to look broke.", "The good stuff is behind the counter because apparently people touch things.", "Buy something before the lights make you sentimental.", "This place has standards. Low ones, but still.", "Cash first. Vibes after.", "If it explodes later, that is called personality.", "Do not flirt with the furniture. It has seen enough.", "Pick fast. The club does not run on awkward silence.", "The exit portal is real. The refunds are not.", "Spend big and I may pretend this was a business meeting." }; private AudioSource _audio; private bool _talking; private bool _shopOpen; private bool _armOpen; private bool _armBuy; private GameObject _panel; private Text _text; private Quaternion _restRotation; private Coroutine _typing; private List _shopItems = new List(); private int _selectedIndex; private Transform _targetPlayer; private void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } private void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) _restRotation = ((Component)this).transform.rotation; _audio = ((Component)this).gameObject.AddComponent(); _audio.spatialBlend = 1f; _audio.minDistance = 1f; _audio.maxDistance = 10f; BuildUi(); GenerateShopList(); } private void GenerateShopList() { _shopItems.Clear(); foreach (Item value in StatsManager.instance.itemDictionary.Values) { if (!value.disabled && value.physicalItem && value.value.valueMax > 0f) { _shopItems.Add(value); } } _shopItems = _shopItems.OrderBy((Item item) => item.value.valueMax).ToList(); } private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!_talking) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, _restRotation, Time.deltaTime * 5f); } if (!Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerAvatar.instance).transform.position) <= 3.5f) { if (!_talking) { if (InputManager.instance.KeyDown((InputKey)2) || Input.GetKeyDown((KeyCode)101)) { StartTalk(); } } else if (!_shopOpen) { if (!_armOpen) { if (!ConfirmKeyHeld()) { _armOpen = true; } } else if (Input.GetKeyDown((KeyCode)101) || Input.GetKeyDown((KeyCode)13) || Input.GetKeyDown((KeyCode)271)) { OpenShop(); return; } } } else if (_talking) { EndTalk(); } if (_talking) { HoldPlayer(); if (_shopOpen) { UpdateShopInput(); } } } private void UpdateShopInput() { if (_shopItems.Count == 0) { UpdateShopUi(); if (Input.GetKeyDown((KeyCode)27) || InputManager.instance.KeyDown((InputKey)18)) { EndTalk(); } return; } if (Input.GetKeyDown((KeyCode)273) || Input.GetKeyDown((KeyCode)119)) { _selectedIndex--; if (_selectedIndex < 0) { _selectedIndex = _shopItems.Count - 1; } UpdateShopUi(); } if (Input.GetKeyDown((KeyCode)274) || Input.GetKeyDown((KeyCode)115)) { _selectedIndex++; if (_selectedIndex >= _shopItems.Count) { _selectedIndex = 0; } UpdateShopUi(); } if (!_armBuy) { if (!ConfirmKeyHeld()) { _armBuy = true; } } else if (Input.GetKeyDown((KeyCode)101) || Input.GetKeyDown((KeyCode)13) || Input.GetKeyDown((KeyCode)271)) { BuyItem(); } if (Input.GetKeyDown((KeyCode)27) || InputManager.instance.KeyDown((InputKey)18)) { EndTalk(); } } private static bool ConfirmKeyHeld() { if (!Input.GetKey((KeyCode)101) && !Input.GetKey((KeyCode)13)) { return Input.GetKey((KeyCode)271); } return true; } private int GetPrice(Item item) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 float num = item.value.valueMax / 1000f * 4f; if (Object.op_Implicit((Object)(object)ShopManager.instance)) { if ((int)item.itemType == 3) { num = ShopManager.instance.UpgradeValueGet(num, item); } else if ((int)item.itemType == 8) { num = ShopManager.instance.HealthPackValueGet(num); } else if ((int)item.itemType == 5) { num = ShopManager.instance.CrystalValueGet(num); } } return Mathf.CeilToInt(num); } private void BuyItem() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (_shopItems.Count == 0) { return; } Item val = _shopItems[_selectedIndex]; int price = GetPrice(val); int num = SemiFunc.StatGetRunCurrency(); if (num < price) { PlayVoice(2); return; } PlayVoice(1); if (PhotonNetwork.IsMasterClient || !PhotonNetwork.IsConnected) { SemiFunc.StatSetRunCurrency(num - price); StatsManager.instance.ItemPurchase(((Object)val).name); } else { object[] array = new object[2] { price, ((Object)val).name }; RaiseEventOptions val2 = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; PhotonNetwork.RaiseEvent((byte)151, (object)array, val2, SendOptions.SendReliable); } UpdateShopUi(); } public void OnEvent(EventData photonEvent) { if ((photonEvent.Code != 151 && photonEvent.Code != 152) || (Object)(object)this != (Object)(object)Object.FindObjectOfType()) { return; } if (photonEvent.Code == 152) { object[] array = (object[])photonEvent.CustomData; PlayVoiceLocal((int)array[0], (int)array[1]); } else if (PhotonNetwork.IsMasterClient) { object[] obj = (object[])photonEvent.CustomData; int num = (int)obj[0]; string text = (string)obj[1]; int num2 = SemiFunc.StatGetRunCurrency(); if (num2 >= num) { SemiFunc.StatSetRunCurrency(num2 - num); StatsManager.instance.ItemPurchase(text); } } } private void PlayVoice(int category) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown List list = EmpressClubAssets.Category(category); if (list.Count != 0) { int num = Random.Range(0, list.Count); PlayVoiceLocal(category, num); if (PhotonNetwork.InRoom) { object[] array = new object[2] { category, num }; PhotonNetwork.RaiseEvent((byte)152, (object)array, new RaiseEventOptions { Receivers = (ReceiverGroup)0 }, SendOptions.SendReliable); } } } private void PlayVoiceLocal(int category, int index) { List list = EmpressClubAssets.Category(category); if (list.Count != 0 && !((Object)(object)_audio == (Object)null)) { if (index < 0 || index >= list.Count) { index = 0; } _audio.PlayOneShot(list[index]); } } private void UpdateShopUi() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_text)) { return; } RectTransform component = _panel.GetComponent(); component.anchorMin = new Vector2(0.1f, 0.1f); component.anchorMax = new Vector2(0.9f, 0.8f); string text = "EMPRESS CLUB SHOP\n\n"; int num = 9; int num2 = 0; int num3 = _shopItems.Count; if (_shopItems.Count > num) { num2 = _selectedIndex - num / 2; if (num2 < 0) { num2 = 0; } if (num2 + num > _shopItems.Count) { num2 = _shopItems.Count - num; } num3 = num2 + num; } if (_shopItems.Count == 0) { text += "The shelves are empty. Embarrassing.\n"; } for (int i = num2; i < num3; i++) { Item val = _shopItems[i]; string text2 = ((i == _selectedIndex) ? "> " : " "); string text3 = ((i == _selectedIndex) ? "" : ""); text = text + text2 + val.itemName + " - $" + GetPrice(val) + text3 + "\n"; } text = text + "\nMoney: $" + SemiFunc.StatGetRunCurrency() + "\n[E] Buy [Esc] Exit"; _text.text = text; } private void OpenShop() { if (_typing != null) { ((MonoBehaviour)this).StopCoroutine(_typing); } _shopOpen = true; _selectedIndex = 0; _armBuy = false; PlayVoice(3); UpdateShopUi(); } private void HoldPlayer() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)PlayerController.instance)) { PlayerController.instance.InputDisable(0.1f); PlayerController.instance.rb.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)_targetPlayer)) { Vector3 position = _targetPlayer.position; position.y = ((Component)this).transform.position.y; Vector3 val = position - ((Component)this).transform.position; if (val != Vector3.zero) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.LookRotation(val), Time.deltaTime * 5f); } } } private void StartTalk() { //IL_0047: 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) _talking = true; _shopOpen = false; _armOpen = false; if (Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { _targetPlayer = ((Component)PlayerAvatar.instance).transform; } RectTransform component = _panel.GetComponent(); component.anchorMin = new Vector2(0.1f, 0.1f); component.anchorMax = new Vector2(0.9f, 0.3f); string line = DialogueLines[Random.Range(0, DialogueLines.Count)]; _panel.SetActive(true); PlayVoice(0); if (_typing != null) { ((MonoBehaviour)this).StopCoroutine(_typing); } _typing = ((MonoBehaviour)this).StartCoroutine(TypeLine(line)); } private void EndTalk() { _talking = false; _shopOpen = false; _targetPlayer = null; if (Object.op_Implicit((Object)(object)_panel)) { _panel.SetActive(false); } if (_typing != null) { ((MonoBehaviour)this).StopCoroutine(_typing); } if (Object.op_Implicit((Object)(object)_text)) { _text.text = ""; } } private IEnumerator TypeLine(string line) { _text.text = ""; foreach (char c in line) { Text text = _text; text.text += c; yield return (object)new WaitForSeconds(0.045f); } } private void BuildUi() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) Transform val = (Object.op_Implicit((Object)(object)HUDCanvas.instance) ? ((Component)HUDCanvas.instance).transform : null); if (!Object.op_Implicit((Object)(object)val)) { GameObject val2 = new GameObject("ClubDialogCanvas"); Canvas obj = val2.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 999; val2.AddComponent(); val2.AddComponent(); val = val2.transform; } _panel = new GameObject("ClubPanel"); _panel.transform.SetParent(val, false); ((Graphic)_panel.AddComponent()).color = new Color(0f, 0f, 0f, 0.8f); RectTransform component = _panel.GetComponent(); component.anchorMin = new Vector2(0.1f, 0.1f); component.anchorMax = new Vector2(0.9f, 0.3f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; GameObject val3 = new GameObject("ClubText"); val3.transform.SetParent(_panel.transform, false); _text = val3.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _text.font = font; ((Graphic)_text).color = Color.white; _text.alignment = (TextAnchor)0; _text.resizeTextForBestFit = true; _text.resizeTextMinSize = 14; _text.resizeTextMaxSize = 35; _text.verticalOverflow = (VerticalWrapMode)0; RectTransform component2 = val3.GetComponent(); component2.anchorMin = new Vector2(0.02f, 0.05f); component2.anchorMax = new Vector2(0.98f, 0.95f); offsetMin = (component2.offsetMax = Vector2.zero); component2.offsetMin = offsetMin; _panel.SetActive(false); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_panel)) { Object.Destroy((Object)(object)_panel); } } } public sealed class EmpressClubWalker : MonoBehaviour { private const float WalkSpeed = 1.15f; private const float TurnSpeed = 4.5f; private const float MaxFloorOffset = 0.12f; private Transform _walkCenter; private Vector3 _target; private float _angle; private Vector3 _lastPosition; private float _stuckTime; private void Start() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Transform parent = ((Component)this).transform.parent; _walkCenter = ((IEnumerable)((Component)parent).GetComponentsInChildren(true)).FirstOrDefault((Func)((Transform node) => ((Object)node).name == "EmpressClubWalkCenter")); if ((Object)(object)_walkCenter == (Object)null) { _walkCenter = parent; } Vector3 val = ((Component)this).transform.position - _walkCenter.position; _angle = Mathf.Atan2(val.z, val.x); _lastPosition = ((Component)this).transform.position; PickTarget(); } private void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) Vector3 val = _target - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.45f) { PickTarget(); return; } float num = Vector3.Distance(((Component)this).transform.position, _lastPosition); _lastPosition = ((Component)this).transform.position; _stuckTime = ((num < 0.0025f) ? (_stuckTime + Time.deltaTime) : Mathf.Max(0f, _stuckTime - Time.deltaTime * 2f)); if (_stuckTime > 2.6f) { _stuckTime = 0f; PickTarget(); return; } Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = SteerAroundObstacle(normalized); if (!(((Vector3)(ref val2)).sqrMagnitude < 0.1f)) { Quaternion val3 = Quaternion.LookRotation(val2, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val3, 1f - Mathf.Exp(-4.5f * Time.deltaTime)); Vector3 position = ((Component)this).transform.position + val2 * 1.15f * Time.deltaTime; if (TryFloor(position, out var floor)) { position.y = ((RaycastHit)(ref floor)).point.y + 0.01f; ((Component)this).transform.position = position; } } } private Vector3 SteerAroundObstacle(Vector3 desired) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_0090: 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_009c: Unknown result type (might be due to invalid IL or missing references) if (CanMove(desired)) { return desired; } Vector3 val = Quaternion.Euler(0f, -58f, 0f) * desired; Vector3 val2 = Quaternion.Euler(0f, 58f, 0f) * desired; bool flag = CanMove(val); bool flag2 = CanMove(val2); if (flag && flag2) { if (!(Vector3.Dot(val, _target - ((Component)this).transform.position) > Vector3.Dot(val2, _target - ((Component)this).transform.position))) { return val2; } return val; } if (flag) { return val; } if (flag2) { return val2; } return Vector3.zero; } private bool CanMove(Vector3 direction) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.SphereCast(((Component)this).transform.position + Vector3.up * 0.9f, 0.28f, direction, ref val, 1.05f, -1, (QueryTriggerInteraction)1) && !((RaycastHit)(ref val)).transform.IsChildOf(((Component)this).transform)) { return false; } Vector3 position = ((Component)this).transform.position + direction * 0.8f; if (TryFloor(position, out var floor)) { return Mathf.Abs(((RaycastHit)(ref floor)).point.y - ((Component)this).transform.position.y) <= 0.16f; } return false; } private bool TryFloor(Vector3 position, out RaycastHit floor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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) RaycastHit[] array = Physics.RaycastAll(position + Vector3.up * 2.5f, Vector3.down, 6f, -1, (QueryTriggerInteraction)1); floor = default(RaycastHit); float num = float.MinValue; bool result = false; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider) && !((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)this).transform) && !((RaycastHit)(ref val)).transform.IsChildOf(((Component)this).transform) && !(Vector3.Dot(((RaycastHit)(ref val)).normal, Vector3.up) < 0.7f) && !((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponentInParent() != (Object)null) && !((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponentInParent() != (Object)null) && !(Mathf.Abs(((RaycastHit)(ref val)).point.y - _walkCenter.position.y) > 0.12f) && !(((RaycastHit)(ref val)).point.y <= num)) { num = ((RaycastHit)(ref val)).point.y; floor = val; result = true; } } return result; } private void PickTarget() { //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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //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_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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 30; i++) { float num = ((Random.value < 0.5f) ? (-1f) : 1f); _angle += num * Random.Range(0.65f, 1.35f); float num2 = Random.Range(10.5f, 15.5f); Vector3 position = _walkCenter.position + new Vector3(Mathf.Cos(_angle) * num2, 0f, Mathf.Sin(_angle) * num2); if (TryFloor(position, out var floor)) { Vector3 val = ((RaycastHit)(ref floor)).point - ((Component)this).transform.position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 64f)) { _target = ((RaycastHit)(ref floor)).point + Vector3.up * 0.01f; return; } } } _target = _walkCenter.position; } } }