using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using REPOLib.Objects.Sdk; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; 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("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("EmpressAmongUs")] [assembly: AssemblyTitle("EmpressAmongUs")] [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.AmongUs { internal static class AmongUsAccess { private delegate void ModuleSetAllChecklistDelegate(Module module); private delegate void LevelGeneratorGenerateDoneDelegate(LevelGenerator instance, PhotonMessageInfo info); private static readonly FieldInfo EnvironmentSetupDoneField = AccessTools.Field(typeof(EnvironmentDirector), "SetupDone"); private static readonly FieldInfo EnvironmentMainCameraField = AccessTools.Field(typeof(EnvironmentDirector), "MainCamera"); private static readonly FieldInfo EnvironmentAmbientColorField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColor"); private static readonly FieldInfo EnvironmentAmbientColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorNew"); private static readonly FieldInfo EnvironmentAmbientColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorPrevious"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptation"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationNew"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationPrevious"); private static readonly FieldInfo EnvironmentDarkAdaptationLerpField = AccessTools.Field(typeof(EnvironmentDirector), "DarkAdaptationLerp"); private static readonly FieldInfo EnvironmentFogColorField = AccessTools.Field(typeof(EnvironmentDirector), "FogColor"); private static readonly FieldInfo EnvironmentFogColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorNew"); private static readonly FieldInfo EnvironmentFogColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorPrevious"); private static readonly FieldInfo EnvironmentFogStartDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistance"); private static readonly FieldInfo EnvironmentFogStartDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistanceNew"); private static readonly FieldInfo EnvironmentFogStartDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistancePrevious"); private static readonly FieldInfo EnvironmentFogEndDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistance"); private static readonly FieldInfo EnvironmentFogEndDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistanceNew"); private static readonly FieldInfo EnvironmentFogEndDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistancePrevious"); private static readonly FieldInfo LevelGeneratorAllPlayersReadyField = AccessTools.Field(typeof(LevelGenerator), "AllPlayersReady"); private static readonly FieldInfo LevelGeneratorEnemyReadyField = AccessTools.Field(typeof(LevelGenerator), "EnemyReady"); private static readonly FieldInfo LevelGeneratorModulesSpawnedField = AccessTools.Field(typeof(LevelGenerator), "ModulesSpawned"); private static readonly FieldInfo LevelGeneratorPlayerSpawnedField = AccessTools.Field(typeof(LevelGenerator), "playerSpawned"); private static readonly FieldInfo RunManagerLevelPreviousField = AccessTools.Field(typeof(RunManager), "levelPrevious"); private static readonly FieldInfo PlayerAvatarIsDisabledField = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo PlayerAvatarDeadSetField = AccessTools.Field(typeof(PlayerAvatar), "deadSet"); private static readonly FieldInfo PlayerAvatarPlayerNameField = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static readonly FieldInfo PlayerAvatarPhotonViewField = AccessTools.Field(typeof(PlayerAvatar), "photonView"); private static readonly FieldInfo PlayerAvatarIsLocalField = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static readonly FieldInfo PlayerAvatarSteamShortField = AccessTools.Field(typeof(PlayerAvatar), "steamIDshort"); private static readonly FieldInfo ValuableDirectorSetupCompleteField = AccessTools.Field(typeof(ValuableDirector), "setupComplete"); private static readonly FieldInfo PlayerAvatarTumbleField = AccessTools.Field(typeof(PlayerAvatar), "tumble"); private static readonly FieldInfo PlayerTumblePhysGrabObjectField = AccessTools.Field(typeof(PlayerTumble), "physGrabObject"); private static readonly FieldInfo PlayerAvatarRbField = AccessTools.Field(typeof(PlayerAvatar), "rb"); private static readonly FieldInfo PlayerAvatarVisualPositionField = AccessTools.Field(typeof(PlayerAvatarVisuals), "visualPosition"); private static readonly FieldInfo PlayerControllerRbField = AccessTools.Field(typeof(PlayerController), "rb"); private static readonly FieldInfo PlayerControllerVelocityField = AccessTools.Field(typeof(PlayerController), "Velocity"); private static readonly FieldInfo PlayerControllerVelocityRelativeField = AccessTools.Field(typeof(PlayerController), "VelocityRelative"); private static readonly FieldInfo PlayerControllerVelocityRelativeNewField = AccessTools.Field(typeof(PlayerController), "VelocityRelativeNew"); private static readonly FieldInfo PlayerControllerMoveForceTimerField = AccessTools.Field(typeof(PlayerController), "MoveForceTimer"); private static readonly MethodInfo PlayerControllerInputDisableMethod = AccessTools.Method(typeof(PlayerController), "InputDisable", new Type[1] { typeof(float) }, (Type[])null); private static readonly FieldInfo RoundDirectorExtractionPointsField = AccessTools.Field(typeof(RoundDirector), "extractionPoints"); private static readonly FieldInfo RoundDirectorExtractionPointsCompletedField = AccessTools.Field(typeof(RoundDirector), "extractionPointsCompleted"); private static readonly FieldInfo RoundDirectorExtractionPointListField = AccessTools.Field(typeof(RoundDirector), "extractionPointList"); private static readonly FieldInfo ModuleSetupDoneField = AccessTools.Field(typeof(Module), "SetupDone"); private static readonly FieldInfo ModuleStartRoomField = AccessTools.Field(typeof(Module), "StartRoom"); private static readonly FieldInfo ModuleGridXField = AccessTools.Field(typeof(Module), "GridX"); private static readonly FieldInfo ModuleGridYField = AccessTools.Field(typeof(Module), "GridY"); private static readonly FieldInfo ModuleFirstField = AccessTools.Field(typeof(Module), "First"); private static readonly FieldInfo LevelPointInStartRoomField = AccessTools.Field(typeof(LevelPoint), "inStartRoom"); private static readonly FieldInfo RunManagerSingleplayerPoolField = AccessTools.Field(typeof(RunManager), "singleplayerPool"); private static readonly FieldInfo RunManagerMultiplayerPoolField = AccessTools.Field(typeof(RunManager), "multiplayerPool"); private static readonly FieldInfo MultiplayerPoolResourceCacheField = AccessTools.Field(typeof(MultiplayerPool), "ResourceCache"); private static readonly MethodInfo ModuleSetAllChecklistMethod = AccessTools.Method(typeof(Module), "SetAllChecklist", (Type[])null, (Type[])null); private static readonly MethodInfo LevelGeneratorGenerateDoneMethod = AccessTools.Method(typeof(LevelGenerator), "GenerateDone", new Type[1] { typeof(PhotonMessageInfo) }, (Type[])null); private static readonly MethodInfo LevelGeneratorEnemySetupMethod = AccessTools.Method(typeof(LevelGenerator), "EnemySetup", (Type[])null, (Type[])null); private static readonly ModuleSetAllChecklistDelegate ModuleSetAllChecklistCall = CreateDelegate(ModuleSetAllChecklistMethod); private static readonly LevelGeneratorGenerateDoneDelegate LevelGeneratorGenerateDoneCall = CreateDelegate(LevelGeneratorGenerateDoneMethod); public static void SetEnvironmentFog(EnvironmentDirector director, Color color, float startDistance, float endDistance) { //IL_0006: 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_0028: Unknown result type (might be due to invalid IL or missing references) SetField(EnvironmentFogColorField, director, color); SetField(EnvironmentFogColorNewField, director, color); SetField(EnvironmentFogColorPreviousField, director, color); SetField(EnvironmentFogStartDistanceField, director, startDistance); SetField(EnvironmentFogStartDistanceNewField, director, startDistance); SetField(EnvironmentFogStartDistancePreviousField, director, startDistance); SetField(EnvironmentFogEndDistanceField, director, endDistance); SetField(EnvironmentFogEndDistanceNewField, director, endDistance); SetField(EnvironmentFogEndDistancePreviousField, director, endDistance); } public static void SetEnvironmentAmbient(EnvironmentDirector director, Color ambient, Color adaptation) { //IL_0006: 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_0028: 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_004a: 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) SetField(EnvironmentAmbientColorField, director, ambient); SetField(EnvironmentAmbientColorNewField, director, ambient); SetField(EnvironmentAmbientColorPreviousField, director, ambient); SetField(EnvironmentAmbientColorAdaptationField, director, adaptation); SetField(EnvironmentAmbientColorAdaptationNewField, director, adaptation); SetField(EnvironmentAmbientColorAdaptationPreviousField, director, adaptation); } public static void SetEnvironmentDarkAdaptation(EnvironmentDirector director, float value) { SetField(EnvironmentDarkAdaptationLerpField, director, value); } public static Camera GetEnvironmentMainCamera(EnvironmentDirector director) { return Get(EnvironmentMainCameraField, director); } public static void SetEnvironmentMainCamera(EnvironmentDirector director, Camera camera) { SetField(EnvironmentMainCameraField, director, camera); } public static void SetEnvironmentSetupDone(EnvironmentDirector director, bool value) { SetField(EnvironmentSetupDoneField, director, value); } public static void SetAllPlayersReady(LevelGenerator generator, bool value) { SetField(LevelGeneratorAllPlayersReadyField, generator, value); } public static bool GetAllPlayersReady(LevelGenerator generator) { return GetBool(LevelGeneratorAllPlayersReadyField, generator); } public static void SetLevelPrevious(RunManager manager, Level level) { SetField(RunManagerLevelPreviousField, manager, level); } public static void SetEnemyReady(LevelGenerator generator, bool value) { SetField(LevelGeneratorEnemyReadyField, generator, value); } public static void SetModulesSpawned(LevelGenerator generator, int value) { SetField(LevelGeneratorModulesSpawnedField, generator, value); } public static void SetPlayerSpawnedCount(LevelGenerator generator, int value) { SetField(LevelGeneratorPlayerSpawnedField, generator, value); } public static int GetPlayerSpawnedCount(LevelGenerator generator) { return GetInt(LevelGeneratorPlayerSpawnedField, generator); } public static bool GetIsDisabled(PlayerAvatar avatar) { return GetBool(PlayerAvatarIsDisabledField, avatar); } public static bool GetDeadSet(PlayerAvatar avatar) { return GetBool(PlayerAvatarDeadSetField, avatar); } public static bool GetValuableSetupComplete(ValuableDirector director) { return GetBool(ValuableDirectorSetupCompleteField, director); } public static string GetPlayerName(PlayerAvatar avatar) { return Get(PlayerAvatarPlayerNameField, avatar); } public static int GetActorNumber(PlayerAvatar avatar) { if ((Object)(object)avatar == (Object)null) { return -1; } PhotonView val = Get(PlayerAvatarPhotonViewField, avatar); if ((Object)(object)val != (Object)null && val.Owner != null) { return val.Owner.ActorNumber; } if (GetBool(PlayerAvatarIsLocalField, avatar)) { return 1; } return GetInt(PlayerAvatarSteamShortField, avatar); } public static PlayerTumble GetPlayerTumble(PlayerAvatar avatar) { return Get(PlayerAvatarTumbleField, avatar); } public static void ResetRoundExtraction(RoundDirector director) { SetField(RoundDirectorExtractionPointsField, director, 0); SetField(RoundDirectorExtractionPointsCompletedField, director, 0); Get>(RoundDirectorExtractionPointListField, director)?.Clear(); } public static void ConfigureStartRoomModule(Module module, int gridX, int gridY) { ModuleSetAllChecklistCall?.Invoke(module); SetField(ModuleSetupDoneField, module, true); SetField(ModuleStartRoomField, module, true); SetField(ModuleFirstField, module, true); SetField(ModuleGridXField, module, gridX); SetField(ModuleGridYField, module, gridY); } public static void MarkLevelPointInStartRoom(LevelPoint point, bool value) { SetField(LevelPointInStartRoomField, point, value); } public static void GenerateDone(LevelGenerator generator) { //IL_000d: 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) LevelGeneratorGenerateDoneCall?.Invoke(generator, default(PhotonMessageInfo)); } public static IEnumerator EnemySetup(LevelGenerator generator) { if (LevelGeneratorEnemySetupMethod == null) { return null; } return LevelGeneratorEnemySetupMethod.Invoke(generator, null) as IEnumerator; } public static void RegisterResourcePrefab(string resourcePath, GameObject prefab) { RunManager instance = RunManager.instance; if (!((Object)(object)instance == (Object)null) && !string.IsNullOrEmpty(resourcePath) && !((Object)(object)prefab == (Object)null)) { AddToPool(RunManagerSingleplayerPoolField?.GetValue(instance), resourcePath, prefab); object obj = RunManagerMultiplayerPoolField?.GetValue(instance); if (obj != null) { AddToPool(MultiplayerPoolResourceCacheField?.GetValue(obj), resourcePath, prefab); } } } private static void AddToPool(object poolObject, string resourcePath, GameObject prefab) { if (poolObject is IDictionary dictionary && !dictionary.Contains(resourcePath)) { dictionary.Add(resourcePath, prefab); } } public static void TeleportLocalPlayer(Vector3 position, Quaternion rotation) { //IL_0061: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_0094: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = (((Object)(object)PlayerController.instance != (Object)null) ? PlayerController.instance.playerAvatarScript : null); if ((Object)(object)val == (Object)null) { return; } if ((Object)(object)val.physGrabber != (Object)null) { val.physGrabber.ReleaseObject(-1, 0.1f); } PlayerTumble playerTumble = GetPlayerTumble(val); PhysGrabObject val2 = Get(PlayerTumblePhysGrabObjectField, playerTumble); if ((Object)(object)val2 != (Object)null) { val2.Teleport(position, rotation); } Rigidbody val3 = Get(PlayerAvatarRbField, val); if ((Object)(object)val3 != (Object)null) { val3.velocity = Vector3.zero; val3.angularVelocity = Vector3.zero; val3.position = position; val3.rotation = rotation; } ((Component)val).transform.SetPositionAndRotation(position, rotation); if ((Object)(object)val.playerTransform != (Object)null) { val.playerTransform.SetPositionAndRotation(position, rotation); } if ((Object)(object)val.playerAvatarVisuals != (Object)null) { ((Component)val.playerAvatarVisuals).transform.position = position; SetField(PlayerAvatarVisualPositionField, val.playerAvatarVisuals, position); } PlayerController instance = PlayerController.instance; if ((Object)(object)instance != (Object)null) { ((Component)instance).transform.SetPositionAndRotation(position, rotation); Rigidbody val4 = Get(PlayerControllerRbField, instance); if ((Object)(object)val4 != (Object)null) { val4.velocity = Vector3.zero; val4.angularVelocity = Vector3.zero; val4.position = position; val4.rotation = rotation; } SetField(PlayerControllerVelocityField, instance, Vector3.zero); SetField(PlayerControllerVelocityRelativeField, instance, Vector3.zero); SetField(PlayerControllerVelocityRelativeNewField, instance, Vector3.zero); SetField(PlayerControllerMoveForceTimerField, instance, 0f); PlayerControllerInputDisableMethod?.Invoke(instance, new object[1] { 0.25f }); } } private static T Get(FieldInfo field, object instance) where T : class { if (field == null || instance == null) { return null; } return field.GetValue(instance) as T; } private static bool GetBool(FieldInfo field, object instance) { if (field == null || instance == null) { return false; } object value = field.GetValue(instance); bool flag = default(bool); int num; if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } private static int GetInt(FieldInfo field, object instance) { if (field == null || instance == null) { return 0; } object value = field.GetValue(instance); if (value is int) { return (int)value; } return 0; } private static void SetField(FieldInfo field, object instance, object value) { if (!(field == null) && instance != null) { field.SetValue(instance, value); } } private static TDelegate CreateDelegate(MethodInfo method) where TDelegate : Delegate { if (method == null) { return null; } return AccessTools.MethodDelegate(method, (object)null, true); } } internal static class AmongUsAssets { private const string BundleFileName = "empress_among_us_level.empress"; private const string LevelPrefabName = "EmpressAmongUsLevel"; public static GameObject LevelPrefab { get; private set; } public static void Load() { if ((Object)(object)LevelPrefab != (Object)null) { return; } string text = Path.Combine(EmpressAmongUsPlugin.PluginDirectory, "bundles", "empress_among_us_level.empress"); if (!File.Exists(text)) { EmpressAmongUsPlugin.Log.LogError((object)("Missing Empress Among Us bundle: " + text)); return; } AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { EmpressAmongUsPlugin.Log.LogError((object)("Could not load Empress Among Us bundle: " + text)); return; } LevelPrefab = val.LoadAsset("EmpressAmongUsLevel"); if ((Object)(object)LevelPrefab == (Object)null) { EmpressAmongUsPlugin.Log.LogError((object)"Could not find prefab EmpressAmongUsLevel in empress_among_us_level.empress."); } } } internal static class AmongUsAudio { public static AudioClip DoorOpen { get; private set; } public static AudioClip VentMove { get; private set; } public static AudioClip Emergency { get; private set; } public static AudioClip Report { get; private set; } public static AudioClip TaskComplete { get; private set; } public static AudioClip TaskBeep { get; private set; } public static IEnumerator LoadAll(string pluginDirectory) { string audioDirectory = Path.Combine(pluginDirectory, "audio"); if (Directory.Exists(audioDirectory)) { yield return Load(Path.Combine(audioDirectory, "door_open.ogg"), delegate(AudioClip clip) { DoorOpen = clip; }); yield return Load(Path.Combine(audioDirectory, "vent_move.ogg"), delegate(AudioClip clip) { VentMove = clip; }); yield return Load(Path.Combine(audioDirectory, "emergency.ogg"), delegate(AudioClip clip) { Emergency = clip; }); yield return Load(Path.Combine(audioDirectory, "report.ogg"), delegate(AudioClip clip) { Report = clip; }); yield return Load(Path.Combine(audioDirectory, "task_complete.ogg"), delegate(AudioClip clip) { TaskComplete = clip; }); yield return Load(Path.Combine(audioDirectory, "task_beep.ogg"), delegate(AudioClip clip) { TaskBeep = clip; }); } } private static IEnumerator Load(string filePath, Action assign) { if (!File.Exists(filePath)) { yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip("file://" + filePath, (AudioType)14); DownloadHandlerAudioClip val = (DownloadHandlerAudioClip)request.downloadHandler; val.streamAudio = false; val.compressed = false; yield return request.SendWebRequest(); if ((int)request.result == 1) { AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content != (Object)null) { ((Object)content).name = Path.GetFileNameWithoutExtension(filePath); assign(content); } } } } public sealed class AmongUsDoor : MonoBehaviour { private const float OpenRange = 3.8f; private const float CloseRange = 5.6f; private const float SlideSpeed = 6f; private const float DoorVolume = 0.09f; internal static readonly List AllColliders = new List(); private Vector3 _closedLocal; private Vector3 _openLocal; private float _openAmount; private Collider[] _colliders; private AudioSource _audio; private bool _wasOpen; private bool _isOpen; private float _enemyCheckTimer; private float _enemyNearestCached = 999f; 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) //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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) _closedLocal = ((Component)this).transform.localPosition; float num = 2.6f; Renderer component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { Bounds bounds = component.bounds; num = Mathf.Max(1.8f, ((Bounds)(ref bounds)).size.y * 0.95f); } _openLocal = _closedLocal + Vector3.up * num; _colliders = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < _colliders.Length; i++) { if ((Object)(object)_colliders[i] != (Object)null && !AllColliders.Contains(_colliders[i])) { AllColliders.Add(_colliders[i]); } } _audio = ((Component)this).gameObject.AddComponent(); _audio.spatialBlend = 1f; _audio.minDistance = 2f; _audio.maxDistance = 22f; _audio.volume = 0.09f; _audio.playOnAwake = false; } private void Update() { //IL_00c2: 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_00d3: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(NearestPlayer(), NearestEnemy()); if (!_isOpen && num < 3.8f) { _isOpen = true; } else if (_isOpen && num > 5.6f) { _isOpen = false; } if (_isOpen && !_wasOpen && (Object)(object)_audio != (Object)null && (Object)(object)AmongUsAudio.DoorOpen != (Object)null) { _audio.PlayOneShot(AmongUsAudio.DoorOpen); } _wasOpen = _isOpen; float num2 = (_isOpen ? 1f : 0f); _openAmount = Mathf.MoveTowards(_openAmount, num2, 6f * Time.deltaTime); ((Component)this).transform.localPosition = Vector3.Lerp(_closedLocal, _openLocal, _openAmount); bool flag = _openAmount > 0.55f; for (int i = 0; i < _colliders.Length; i++) { if ((Object)(object)_colliders[i] != (Object)null && _colliders[i].enabled == flag) { _colliders[i].enabled = !flag; } } } private float NearestPlayer() { //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_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_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) Vector3 position = ((Component)this).transform.position; float num = 999f; List list = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.PlayerList : null); if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { if (!((Object)(object)list[i] == (Object)null)) { float num2 = Vector3.Distance(((Component)list[i]).transform.position, position); if (num2 < num) { num = num2; } } } return num; } if (!((Object)(object)PlayerAvatar.instance != (Object)null)) { return 999f; } return Vector3.Distance(((Component)PlayerAvatar.instance).transform.position, position); } private float NearestEnemy() { //IL_0042: 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_0086: Unknown result type (might be due to invalid IL or missing references) _enemyCheckTimer -= Time.deltaTime; if (_enemyCheckTimer > 0f) { return _enemyNearestCached; } _enemyCheckTimer = 0.25f; _enemyNearestCached = 999f; Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 5.6f, -1, (QueryTriggerInteraction)2); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && (Object)(object)((Component)array[i]).GetComponentInParent() != (Object)null) { float num = Vector3.Distance(((Component)array[i]).transform.position, ((Component)this).transform.position); if (num < _enemyNearestCached) { _enemyNearestCached = num; } } } return _enemyNearestCached; } private void OnDestroy() { if (_colliders != null) { for (int i = 0; i < _colliders.Length; i++) { AllColliders.Remove(_colliders[i]); } } } } public sealed class AmongUsEmergencyButton : MonoBehaviour { private const float InteractionDistance = 3f; private bool _armed; private Text _prompt; private void Start() { BuildPrompt(); } private void Update() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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) AmongUsGame instance = AmongUsGame.Instance; if ((Object)(object)_prompt == (Object)null || (Object)(object)instance == (Object)null || !Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { return; } if (instance.Phase != GamePhase.Roaming) { _prompt.text = ""; return; } if (!AmongUsGame.IsAlive(AmongUsGame.LocalAvatar())) { _prompt.text = ""; return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerAvatar.instance).transform.position) > 3f) { _armed = false; _prompt.text = ""; return; } float num = instance.MeetingCooldownUntil - Time.time; if (num > 0f) { _prompt.text = "Button charging " + Mathf.CeilToInt(num) + "s"; ((Graphic)_prompt).color = new Color(0.8f, 0.6f, 0.4f, 0.9f); _armed = false; return; } _prompt.text = "[E] Emergency Meeting"; ((Graphic)_prompt).color = new Color(0.95f, 0.3f, 0.3f, 0.95f); bool flag = Input.GetKeyDown((KeyCode)101) || ((Object)(object)InputManager.instance != (Object)null && InputManager.instance.KeyDown((InputKey)2)); if (!_armed) { if (!flag) { _armed = true; } } else if (flag) { _prompt.text = ""; instance.RequestMeeting(AmongUsGame.LocalActor(), report: false); } } 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_00b5: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) 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("AmongUsEmergencyPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _prompt.font = font; ((Graphic)_prompt).color = new Color(0.95f, 0.3f, 0.3f, 0.95f); _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 24; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.2f, 0.24f); component.anchorMax = new Vector2(0.8f, 0.3f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = ""; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } } } internal enum GamePhase { Idle, Roaming, Meeting, Over } internal sealed class AmongUsGame : MonoBehaviour { private readonly HashSet _imposterActors = new HashSet(); private readonly Dictionary> _crewTasks = new Dictionary>(); private readonly Dictionary _roleData = new Dictionary(); private readonly HashSet _completed = new HashSet(); private readonly HashSet _localTeammates = new HashSet(); private readonly HashSet _localTasksDone = new HashSet(); private readonly List _bodies = new List(); private readonly Dictionary _wasAlive = new Dictionary(); private float _bodyScanTimer; private AmongUsHud _hud; private AmongUsMeeting _meeting; private bool _roundActive; private bool _roleReceived; private bool _rolesAssigned; private float _voteEndTime; private bool _tallying; private readonly Dictionary _votesByActor = new Dictionary(); public static AmongUsGame Instance { get; private set; } internal GamePhase Phase { get; private set; } internal bool LocalIsImposter { get; private set; } internal int TasksCompleted { get; private set; } internal int TasksTotal { get; private set; } internal float MeetingCooldownUntil { get; private set; } internal List LocalTasks { get; } = new List(); public static AmongUsGame EnsureHost() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return Instance; } GameObject val = new GameObject("Empress Among Us Game"); val.transform.parent = null; ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)val); Instance = val.AddComponent(); return Instance; } private void Awake() { Instance = this; _hud = ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); } internal void StartRound() { EmpressAmongUsPlugin.EnsurePhotonHooked(); Phase = GamePhase.Roaming; _roundActive = true; _roleReceived = false; _rolesAssigned = false; LocalIsImposter = false; _imposterActors.Clear(); _crewTasks.Clear(); _roleData.Clear(); _completed.Clear(); _localTeammates.Clear(); _localTasksDone.Clear(); LocalTasks.Clear(); _bodies.Clear(); _wasAlive.Clear(); TasksCompleted = 0; TasksTotal = 1; MeetingCooldownUntil = Time.time + 15f; if (SemiFunc.IsMasterClientOrSingleplayer()) { ((MonoBehaviour)this).StartCoroutine(AssignRolesRoutine()); } else { ((MonoBehaviour)this).StartCoroutine(RoleWatchdogRoutine()); } } private IEnumerator AssignRolesRoutine() { yield return (object)new WaitForSeconds(2.5f); List list = AllPlayers(); int num = Mathf.Max(1, AmongUsTasks.StationCount); int count = Mathf.Clamp(EmpressAmongUsPlugin.Settings.TasksPerCrew.Value, 1, num); int num2 = Mathf.Clamp(EmpressAmongUsPlugin.Settings.ImposterCount.Value, 1, 2); if (list.Count < 2) { num2 = 0; } else if (list.Count < 4) { num2 = Mathf.Min(num2, 1); } List list2 = list.Select(ActorOf).ToList(); List list3 = new List(); List list4 = new List(list2); for (int i = 0; i < num2; i++) { if (list4.Count <= 0) { break; } int index = Random.Range(0, list4.Count); list3.Add(list4[index]); _imposterActors.Add(list4[index]); list4.RemoveAt(index); } TasksTotal = 0; _roleData.Clear(); foreach (int actor in list2) { bool flag = _imposterActors.Contains(actor); List list5 = PickStations(num, count); if (!flag) { _crewTasks[actor] = list5; TasksTotal += list5.Count; } int[] array = (flag ? list3.Where((int a) => a != actor).ToArray() : new int[0]); object[] value = new object[4] { flag, array, list5.ToArray(), 0 }; _roleData[actor] = value; } if (TasksTotal < 1) { TasksTotal = 1; } _rolesAssigned = true; for (int repeat = 0; repeat < 2; repeat++) { foreach (KeyValuePair roleDatum in _roleData) { EmpressAmongUsPlugin.RaiseToActor(181, roleDatum.Value, roleDatum.Key); } EmpressAmongUsPlugin.RaiseToAll(187, new object[2] { TasksCompleted, TasksTotal }); yield return (object)new WaitForSeconds(2.5f); } } private IEnumerator RoleWatchdogRoutine() { for (int attempt = 0; attempt < 8; attempt++) { yield return (object)new WaitForSeconds(3f); if (_roleReceived || Phase != GamePhase.Roaming) { break; } EmpressAmongUsPlugin.RaiseToMaster(189, new object[1] { LocalActor() }); } } private static List PickStations(int stationCount, int count) { List list = Enumerable.Range(0, stationCount).ToList(); List list2 = new List(); for (int i = 0; i < count; i++) { if (list.Count <= 0) { break; } int index = Random.Range(0, list.Count); list2.Add(list[index]); list.RemoveAt(index); } return list2; } internal void EndRound() { Phase = GamePhase.Idle; _roundActive = false; _imposterActors.Clear(); _crewTasks.Clear(); if ((Object)(object)_meeting != (Object)null) { Object.Destroy((Object)(object)((Component)_meeting).gameObject); _meeting = null; } } private void Update() { if (Phase == GamePhase.Roaming) { ScanDeaths(); } if (Phase == GamePhase.Meeting && _tallying && SemiFunc.IsMasterClientOrSingleplayer() && Time.time >= _voteEndTime) { FinishMeeting(); } } private void ScanDeaths() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) _bodyScanTimer -= Time.deltaTime; if (_bodyScanTimer > 0f) { return; } _bodyScanTimer = 0.25f; List list = AllPlayers(); for (int i = 0; i < list.Count; i++) { int key = ActorOf(list[i]); bool flag = IsAlive(list[i]); bool value; bool num = !_wasAlive.TryGetValue(key, out value) || value; _wasAlive[key] = flag; if (num && !flag) { Vector3 position = ((Component)list[i]).transform.position; if (!NearestBody(position, 2f).HasValue) { _bodies.Add(position); } } } } internal Vector3? NearestBody(Vector3 position, float range) { //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_0030: Unknown result type (might be due to invalid IL or missing references) Vector3? result = null; float num = range; for (int i = 0; i < _bodies.Count; i++) { float num2 = Vector3.Distance(_bodies[i], position); if (num2 < num) { num = num2; result = _bodies[i]; } } return result; } internal void ReceiveRole(object[] data) { //IL_010c: 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_0111: 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_014b: 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_0156: Unknown result type (might be due to invalid IL or missing references) bool roleReceived = _roleReceived; _roleReceived = true; LocalIsImposter = (bool)data[0]; int[] obj = (data[1] as int[]) ?? new int[0]; int[] collection = (data[2] as int[]) ?? new int[0]; _localTeammates.Clear(); int[] array = obj; foreach (int item in array) { _localTeammates.Add(item); } LocalTasks.Clear(); LocalTasks.AddRange(collection); _localTasksDone.Clear(); AmongUsKill.SetLocalImposter(LocalIsImposter, !roleReceived); if ((Object)(object)_hud != (Object)null) { _hud.SetRole(LocalIsImposter); } if (!roleReceived) { string text = (LocalIsImposter ? "IMPOSTER" : "CREWMATE"); Color val = (LocalIsImposter ? new Color(0.95f, 0.2f, 0.2f) : new Color(0.5f, 0.8f, 1f)); string obj2 = (LocalIsImposter ? "Kill the crew. Fake tasks. Hold TAB to see the sabotage list." : "Finish your tasks. Hold TAB to see them."); SemiFunc.UIBigMessage("YOU ARE " + text, LocalIsImposter ? "{!}" : "{-}", 50f, val, Color.white); SemiFunc.UIFocusText(obj2, val, Color.white, 6f); } } internal void ReceiveGameBegin(object[] data) { if (SemiFunc.IsMasterClientOrSingleplayer() && _rolesAssigned) { int num = (int)data[0]; if (_roleData.TryGetValue(num, out var value)) { EmpressAmongUsPlugin.RaiseToActor(181, value, num); } } } internal bool IsTeammate(int actor) { return _localTeammates.Contains(actor); } internal bool IsLocalTaskDone(int stationId) { return _localTasksDone.Contains(stationId); } internal bool CanDoTask(int stationId) { if (LocalTasks.Contains(stationId)) { return !_localTasksDone.Contains(stationId); } return false; } internal void CompleteLocalTask(int stationId) { if (_localTasksDone.Add(stationId)) { EmpressAmongUsPlugin.RaiseToMaster(186, new object[2] { LocalActor(), stationId }); } } internal void ReceiveTaskDone(object[] data) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } int key = (int)data[0]; int item = (int)data[1]; if (_crewTasks.TryGetValue(key, out var value) && value.Contains(item)) { string item2 = key + ":" + item; if (_completed.Add(item2)) { TasksCompleted = _completed.Count; EmpressAmongUsPlugin.RaiseToAll(187, new object[2] { TasksCompleted, TasksTotal }); WinCheckTasks(); } } } internal void ReceiveProgress(object[] data) { TasksCompleted = (int)data[0]; TasksTotal = (int)data[1]; if ((Object)(object)_hud != (Object)null) { _hud.SetProgress(TasksCompleted, TasksTotal); } } internal void RequestKill(int victimActor) { EmpressAmongUsPlugin.RaiseToMaster(182, new object[2] { LocalActor(), victimActor }); } internal void ReceiveKill(object[] data) { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } int num = (int)data[0]; int num2 = (int)data[1]; EmpressAmongUsPlugin.Log.LogInfo((object)("Among Us kill request killer=" + num + " victim=" + num2 + " imposters=[" + string.Join(",", _imposterActors) + "]")); if (!_imposterActors.Contains(num) || _imposterActors.Contains(num2)) { SemiFunc.UIFocusText("Kill blocked: role mismatch (killer " + num + ")", new Color(1f, 0.6f, 0.3f), Color.white, 3f); return; } PlayerAvatar val = AvatarByActor(num); PlayerAvatar val2 = AvatarByActor(num2); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || !IsAlive(val) || !IsAlive(val2)) { SemiFunc.UIFocusText("Kill blocked: target not found or already dead", new Color(1f, 0.6f, 0.3f), Color.white, 3f); return; } float num3 = Vector3.Distance(((Component)val).transform.position, ((Component)val2).transform.position); if (num3 > 8f) { SemiFunc.UIFocusText("Kill blocked: too far (" + num3.ToString("F1") + "m)", new Color(1f, 0.6f, 0.3f), Color.white, 3f); return; } val2.PlayerDeath(-1); ((MonoBehaviour)this).StartCoroutine(WinCheckDeathsDelayed()); } internal void RequestMeeting(int callerActor, bool report) { EmpressAmongUsPlugin.RaiseToMaster(183, new object[3] { callerActor, 0, report ? 1 : 0 }); } internal void ReceiveMeetingStart(object[] data) { int num = (int)data[0]; int num2 = (int)data[1]; int num3 = ((data.Length > 2) ? ((int)data[2]) : 0); if (num2 == 0) { if (SemiFunc.IsMasterClientOrSingleplayer() && Phase == GamePhase.Roaming && (num3 != 0 || !(Time.time < MeetingCooldownUntil))) { EmpressAmongUsPlugin.RaiseToAll(183, new object[3] { num, 1, num3 }); } } else { OpenMeeting(num, num3 == 1); } } private void OpenMeeting(int callerActor, bool report) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) if (Phase != GamePhase.Meeting) { Phase = GamePhase.Meeting; _tallying = false; _bodies.Clear(); AudioClip val = (report ? AmongUsAudio.Report : AmongUsAudio.Emergency); if ((Object)(object)val != (Object)null) { Vector3 val2 = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : AmongUsRuntime.CafeteriaTable); AudioSource.PlayClipAtPoint(val, val2, 0.2f); } Vector3 cafeteriaTable = AmongUsRuntime.CafeteriaTable; PlayerAvatar val3 = LocalAvatar(); if ((Object)(object)val3 != (Object)null && IsAlive(val3)) { float num = (float)LocalActor() * 0.9f; Vector3 val4 = cafeteriaTable + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * 3.4f; Vector3 val5 = cafeteriaTable - val4; val5.y = 0f; Quaternion rotation = ((((Vector3)(ref val5)).sqrMagnitude > 0.01f) ? Quaternion.LookRotation(((Vector3)(ref val5)).normalized) : Quaternion.identity); AmongUsAccess.TeleportLocalPlayer(val4 + Vector3.up * 0.6f, rotation); } if ((Object)(object)_meeting == (Object)null) { GameObject val6 = new GameObject("Empress Among Us Meeting"); val6.transform.SetParent(((Component)this).transform, false); _meeting = val6.AddComponent(); } _meeting.Open(callerActor, report); if (SemiFunc.IsMasterClientOrSingleplayer()) { _voteEndTime = Time.time + 20f + 30f; _tallying = true; } } } internal void CastVote(int targetActor) { EmpressAmongUsPlugin.RaiseToMaster(184, new object[2] { LocalActor(), targetActor }); } internal void ReceiveVote(object[] data) { if (SemiFunc.IsMasterClientOrSingleplayer() && Phase == GamePhase.Meeting) { int num = (int)data[0]; int value = (int)data[1]; PlayerAvatar val = AvatarByActor(num); if (!((Object)(object)val == (Object)null) && IsAlive(val)) { _votesByActor[num] = value; } } } private void FinishMeeting() { _tallying = false; Dictionary dictionary = new Dictionary(); foreach (KeyValuePair item in _votesByActor) { if (item.Value >= 0) { dictionary.TryGetValue(item.Value, out var value); dictionary[item.Value] = value + 1; } } int num = -1; int num2 = 0; bool flag = false; foreach (KeyValuePair item2 in dictionary) { if (item2.Value > num2) { num2 = item2.Value; num = item2.Key; flag = false; } else if (item2.Value == num2) { flag = true; } } if (flag || num2 == 0) { num = -1; } _votesByActor.Clear(); bool flag2 = num >= 0 && _imposterActors.Contains(num); EmpressAmongUsPlugin.RaiseToAll(185, new object[2] { num, flag2 }); } internal void ReceiveMeetingEnd(object[] data) { int num = (int)data[0]; bool wasImposter = (bool)data[1]; if ((Object)(object)_meeting != (Object)null) { _meeting.ShowResult(num, wasImposter); } if (SemiFunc.IsMasterClientOrSingleplayer() && num >= 0) { PlayerAvatar val = AvatarByActor(num); if ((Object)(object)val != (Object)null && IsAlive(val)) { val.PlayerDeath(-1); } } ((MonoBehaviour)this).StartCoroutine(CloseMeetingRoutine()); } private IEnumerator CloseMeetingRoutine() { yield return (object)new WaitForSeconds(5f); if ((Object)(object)_meeting != (Object)null) { Object.Destroy((Object)(object)((Component)_meeting).gameObject); _meeting = null; } if (Phase != GamePhase.Over) { Phase = GamePhase.Roaming; MeetingCooldownUntil = Time.time + 30f; yield return null; WinCheckDeaths(); } } private IEnumerator WinCheckDeathsDelayed() { yield return (object)new WaitForSeconds(0.4f); WinCheckDeaths(); } private void WinCheckTasks() { if (SemiFunc.IsMasterClientOrSingleplayer() && Phase != GamePhase.Over && _roundActive && TasksTotal > 0 && TasksCompleted >= TasksTotal) { DeclareOver(crewWon: true, 1); } } private void WinCheckDeaths() { if (!SemiFunc.IsMasterClientOrSingleplayer() || Phase == GamePhase.Over || !_roundActive) { return; } int num = 0; int num2 = 0; List list = AllPlayers(); for (int i = 0; i < list.Count; i++) { if (IsAlive(list[i])) { if (_imposterActors.Contains(ActorOf(list[i]))) { num++; } else { num2++; } } } if (num == 0) { DeclareOver(crewWon: true, 0); } else if (num >= num2) { DeclareOver(crewWon: false, 2); } } private void DeclareOver(bool crewWon, int reason) { Phase = GamePhase.Over; EmpressAmongUsPlugin.RaiseToAll(188, new object[2] { crewWon, reason }); } internal void ReceiveGameOver(object[] data) { //IL_0061: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) bool num = (bool)data[0]; int num2 = (int)data[1]; Phase = GamePhase.Over; _roundActive = false; string text = ((!num) ? "IMPOSTER WINS" : ((num2 == 1) ? "CREW WINS - ALL TASKS DONE" : "CREW WINS - IMPOSTER EJECTED")); Color val = (num ? new Color(0.4f, 0.9f, 1f) : new Color(0.95f, 0.2f, 0.2f)); SemiFunc.UIBigMessage(text, "{!}", 60f, val, Color.white); SemiFunc.UIFocusText(text, val, Color.white, 8f); ((MonoBehaviour)this).StartCoroutine(EndRoundRoutine()); } private IEnumerator EndRoundRoutine() { yield return (object)new WaitForSeconds(8f); EndRound(); if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)RunManager.instance != (Object)null && EmpressAmongUsPlugin.IsAmongUsLevel(RunManager.instance.levelCurrent)) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } internal static List AllPlayers() { if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null) { return new List(GameDirector.instance.PlayerList); } return new List(); } internal static bool IsAlive(PlayerAvatar avatar) { if ((Object)(object)avatar != (Object)null && !AmongUsAccess.GetDeadSet(avatar)) { return !AmongUsAccess.GetIsDisabled(avatar); } return false; } internal static PlayerAvatar LocalAvatar() { if (!((Object)(object)PlayerController.instance != (Object)null)) { return null; } return PlayerController.instance.playerAvatarScript; } internal static int LocalActor() { if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null) { return PhotonNetwork.LocalPlayer.ActorNumber; } return ActorOf(LocalAvatar()); } internal static int ActorOf(PlayerAvatar avatar) { return AmongUsAccess.GetActorNumber(avatar); } internal static PlayerAvatar AvatarByActor(int actor) { List list = AllPlayers(); for (int i = 0; i < list.Count; i++) { if (ActorOf(list[i]) == actor) { return list[i]; } } return null; } internal bool ActorIsImposter(int actor) { return _imposterActors.Contains(actor); } } internal sealed class AmongUsHud : MonoBehaviour { private Canvas _canvas; private Image _barBackground; private Image _barFill; private Text _barText; private Text _roleText; private Image _taskListPanel; private Text _taskListText; private int _completed; private int _total = 1; private bool _isImposter; private bool _built; private void Update() { if (!_built) { Build(); } if (!((Object)(object)_canvas == (Object)null)) { AmongUsGame instance = AmongUsGame.Instance; bool flag = (Object)(object)instance != (Object)null && (instance.Phase == GamePhase.Roaming || instance.Phase == GamePhase.Meeting); if (((Behaviour)_canvas).enabled != flag) { ((Behaviour)_canvas).enabled = flag; } bool flag2 = flag && instance.Phase == GamePhase.Roaming && SemiFunc.InputHold((InputKey)8); if ((Object)(object)_taskListPanel != (Object)null && ((Component)_taskListPanel).gameObject.activeSelf != flag2) { ((Component)_taskListPanel).gameObject.SetActive(flag2); } if (flag2) { RefreshTaskList(instance); } } } private void RefreshTaskList(AmongUsGame game) { if ((Object)(object)_taskListText == (Object)null) { return; } if (game.LocalIsImposter) { _taskListText.text = "SABOTAGE LIST\n\nFake these to blend in:\n"; for (int i = 0; i < game.LocalTasks.Count; i++) { Text taskListText = _taskListText; taskListText.text = taskListText.text + "- " + AmongUsTasks.StationName(game.LocalTasks[i]) + "\n"; } return; } _taskListText.text = "YOUR TASKS\n\n"; for (int j = 0; j < game.LocalTasks.Count; j++) { int num = game.LocalTasks[j]; bool flag = game.IsLocalTaskDone(num); Text taskListText2 = _taskListText; taskListText2.text = taskListText2.text + (flag ? "[x] " : "[ ] ") + AmongUsTasks.StationName(num) + "\n"; } } private void Build() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_00a9: 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_00be: Expected O, but got Unknown //IL_00f6: 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_0126: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Expected O, but got Unknown //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); GameObject val = new GameObject("Empress Among Us HUD"); val.transform.SetParent(((Component)this).transform, false); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 800; val.AddComponent().uiScaleMode = (ScaleMode)1; val.GetComponent().referenceResolution = new Vector2(1920f, 1080f); GameObject val2 = new GameObject("TaskBarBg"); val2.transform.SetParent(val.transform, false); _barBackground = val2.AddComponent(); ((Graphic)_barBackground).color = new Color(0f, 0f, 0f, 0.55f); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.3f, 0.94f); component.anchorMax = new Vector2(0.7f, 0.975f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; GameObject val3 = new GameObject("TaskBarFill"); val3.transform.SetParent(val2.transform, false); _barFill = val3.AddComponent(); ((Graphic)_barFill).color = new Color(0.35f, 0.85f, 1f, 0.9f); RectTransform component2 = val3.GetComponent(); component2.anchorMin = new Vector2(0f, 0f); component2.anchorMax = new Vector2(0f, 1f); offsetMin = (component2.offsetMax = Vector2.zero); component2.offsetMin = offsetMin; GameObject val4 = new GameObject("TaskBarText"); val4.transform.SetParent(val2.transform, false); _barText = val4.AddComponent(); _barText.font = font; _barText.alignment = (TextAnchor)4; ((Graphic)_barText).color = Color.white; _barText.fontSize = 20; RectTransform component3 = val4.GetComponent(); component3.anchorMin = Vector2.zero; component3.anchorMax = Vector2.one; offsetMin = (component3.offsetMax = Vector2.zero); component3.offsetMin = offsetMin; GameObject val5 = new GameObject("RoleText"); val5.transform.SetParent(val.transform, false); _roleText = val5.AddComponent(); _roleText.font = font; _roleText.alignment = (TextAnchor)4; _roleText.fontSize = 22; ((Graphic)_roleText).color = new Color(0.5f, 0.8f, 1f); RectTransform component4 = val5.GetComponent(); component4.anchorMin = new Vector2(0.3f, 0.905f); component4.anchorMax = new Vector2(0.7f, 0.94f); offsetMin = (component4.offsetMax = Vector2.zero); component4.offsetMin = offsetMin; GameObject val6 = new GameObject("TaskListPanel"); val6.transform.SetParent(val.transform, false); _taskListPanel = val6.AddComponent(); ((Graphic)_taskListPanel).color = new Color(0.02f, 0.05f, 0.1f, 0.85f); RectTransform component5 = val6.GetComponent(); component5.anchorMin = new Vector2(0.02f, 0.35f); component5.anchorMax = new Vector2(0.28f, 0.85f); offsetMin = (component5.offsetMax = Vector2.zero); component5.offsetMin = offsetMin; GameObject val7 = new GameObject("TaskListText"); val7.transform.SetParent(val6.transform, false); _taskListText = val7.AddComponent(); _taskListText.font = font; _taskListText.fontSize = 22; _taskListText.alignment = (TextAnchor)0; ((Graphic)_taskListText).color = new Color(0.85f, 0.95f, 1f); RectTransform component6 = val7.GetComponent(); component6.anchorMin = new Vector2(0.06f, 0.04f); component6.anchorMax = new Vector2(0.96f, 0.96f); offsetMin = (component6.offsetMax = Vector2.zero); component6.offsetMin = offsetMin; val6.SetActive(false); _built = true; SetProgress(_completed, _total); SetRole(_isImposter); } internal void SetProgress(int completed, int total) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) _completed = completed; _total = Mathf.Max(1, total); if (_built) { float num = Mathf.Clamp01((float)_completed / (float)_total); ((Graphic)_barFill).rectTransform.anchorMax = new Vector2(num, 1f); _barText.text = "TASKS " + _completed + " / " + _total; } } internal void SetRole(bool isImposter) { //IL_0058: 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_009a: 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) _isImposter = isImposter; if (_built) { _roleText.text = (isImposter ? "IMPOSTER" : "CREWMATE"); ((Graphic)_roleText).color = (isImposter ? new Color(0.95f, 0.3f, 0.3f) : new Color(0.5f, 0.8f, 1f)); ((Graphic)_barFill).color = (isImposter ? new Color(0.95f, 0.4f, 0.4f, 0.9f) : new Color(0.35f, 0.85f, 1f, 0.9f)); } } } internal sealed class AmongUsKill : MonoBehaviour { private const float KillRange = 2.8f; private const float KillCooldown = 25f; private static bool _localImposter; private float _cooldownUntil; private Text _prompt; internal static AmongUsKill Instance { get; private set; } public static void SetLocalImposter(bool imposter, bool resetCooldown) { _localImposter = imposter; if ((Object)(object)Instance != (Object)null && resetCooldown) { Instance._cooldownUntil = Time.time + 10f; } } private void Awake() { Instance = this; } private void Update() { //IL_00d2: 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_011f: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_prompt == (Object)null) { BuildPrompt(); if ((Object)(object)_prompt == (Object)null) { return; } } AmongUsGame instance = AmongUsGame.Instance; if (!_localImposter || (Object)(object)instance == (Object)null || instance.Phase != GamePhase.Roaming) { _prompt.text = ""; return; } PlayerAvatar val = AmongUsGame.LocalAvatar(); if (!AmongUsGame.IsAlive(val)) { _prompt.text = ""; return; } float num = _cooldownUntil - Time.time; PlayerAvatar val2 = FindTarget(val); if (num > 0f) { _prompt.text = "Kill ready in " + Mathf.CeilToInt(num) + "s"; ((Graphic)_prompt).color = new Color(0.8f, 0.5f, 0.5f, 0.85f); return; } if ((Object)(object)val2 != (Object)null) { ((Graphic)_prompt).color = new Color(0.95f, 0.3f, 0.3f, 0.95f); _prompt.text = "[" + ((object)EmpressAmongUsPlugin.Settings.KillKey.Value/*cast due to .constrained prefix*/).ToString() + "] Kill " + AmongUsAccess.GetPlayerName(val2); } else { _prompt.text = ""; } if (Input.GetKeyDown(EmpressAmongUsPlugin.Settings.KillKey.Value)) { if ((Object)(object)val2 != (Object)null) { DoKill(val, val2); } else { SemiFunc.UIFocusText("No crewmate in kill range.", new Color(0.9f, 0.6f, 0.4f), Color.white, 2f); } } } private void DoKill(PlayerAvatar killer, PlayerAvatar target) { //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) _cooldownUntil = Time.time + 25f; SemiFunc.UIFocusText("You attacked " + AmongUsAccess.GetPlayerName(target), new Color(0.95f, 0.3f, 0.3f), Color.white, 2f); EmpressAmongUsPlugin.Log.LogInfo((object)("Among Us kill sent: me=" + AmongUsGame.LocalActor() + " target=" + AmongUsGame.ActorOf(target))); ((MonoBehaviour)this).StartCoroutine(LungeRoutine(killer, target)); AmongUsGame.Instance.RequestKill(AmongUsGame.ActorOf(target)); } private IEnumerator LungeRoutine(PlayerAvatar killer, PlayerAvatar target) { Vector3 start = ((Component)killer).transform.position; Vector3 position = ((Component)target).transform.position; Vector3 val = ((Component)target).transform.position - start; Vector3 destination = position - ((Vector3)(ref val)).normalized * 0.9f; destination.y = start.y; float timer = 0f; while (timer < 0.18f) { timer += Time.deltaTime; Vector3 val2 = Vector3.Lerp(start, destination, timer / 0.18f); val = ((Component)target).transform.position - val2; AmongUsAccess.TeleportLocalPlayer(val2, Quaternion.LookRotation(((Vector3)(ref val)).normalized + Vector3.forward * 0.001f)); yield return null; } } private PlayerAvatar FindTarget(PlayerAvatar local) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = 2.8f; List list = AmongUsGame.AllPlayers(); int num2 = AmongUsGame.ActorOf(local); for (int i = 0; i < list.Count; i++) { PlayerAvatar val = list[i]; if ((Object)(object)val == (Object)(object)local || !AmongUsGame.IsAlive(val)) { continue; } int num3 = AmongUsGame.ActorOf(val); if (num3 != num2 && !AmongUsGame.Instance.ActorIsImposter(num3) && !AmongUsGame.Instance.IsTeammate(num3)) { float num4 = Vector3.Distance(((Component)local).transform.position, ((Component)val).transform.position); if (num4 < num) { num = num4; result = val; } } } return result; } 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_00ce: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) 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("AmongUsKillPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _prompt.font = font; _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 26; ((Graphic)_prompt).color = new Color(0.95f, 0.3f, 0.3f, 0.95f); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.3f, 0.34f); component.anchorMax = new Vector2(0.7f, 0.4f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = ""; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } } } internal static class AmongUsLevelRegistry { private static readonly FieldRef LevelContentLevelRef = AccessTools.FieldRefAccess("_level"); private static readonly FieldRef> LevelContentStartRoomsRef = AccessTools.FieldRefAccess>("_startRooms"); private static readonly FieldRef> LevelContentModulesNormal1Ref = AccessTools.FieldRefAccess>("_modulesNormal1"); private static readonly FieldRef> LevelContentModulesNormal2Ref = AccessTools.FieldRefAccess>("_modulesNormal2"); private static readonly FieldRef> LevelContentModulesNormal3Ref = AccessTools.FieldRefAccess>("_modulesNormal3"); private static readonly FieldRef> LevelContentModulesPassage1Ref = AccessTools.FieldRefAccess>("_modulesPassage1"); private static readonly FieldRef> LevelContentModulesPassage2Ref = AccessTools.FieldRefAccess>("_modulesPassage2"); private static readonly FieldRef> LevelContentModulesPassage3Ref = AccessTools.FieldRefAccess>("_modulesPassage3"); private static readonly FieldRef> LevelContentModulesDeadEnd1Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd1"); private static readonly FieldRef> LevelContentModulesDeadEnd2Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd2"); private static readonly FieldRef> LevelContentModulesDeadEnd3Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd3"); private static readonly FieldRef> LevelContentModulesExtraction1Ref = AccessTools.FieldRefAccess>("_modulesExtraction1"); private static readonly FieldRef> LevelContentModulesExtraction2Ref = AccessTools.FieldRefAccess>("_modulesExtraction2"); private static readonly FieldRef> LevelContentModulesExtraction3Ref = AccessTools.FieldRefAccess>("_modulesExtraction3"); private static readonly FieldRef LevelContentConnectObjectRef = AccessTools.FieldRefAccess("_connectObject"); private static readonly FieldRef LevelContentBlockObjectRef = AccessTools.FieldRefAccess("_blockObject"); public static Level RegisterLevel() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) Level val = ScriptableObject.CreateInstance(); ((Object)val).name = "Level - Empress Among Us"; val.NarrativeName = "Empress - The Skeld"; LevelValuables val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "Valuables - Empress Among Us"; val2.tiny = new List(); val2.small = new List(); val2.medium = new List(); val2.big = new List(); val2.wide = new List(); val2.tall = new List(); val2.veryTall = new List(); SetLevelField(val, "ModuleAmount", 0); SetLevelField(val, "PassageMaxAmount", 0); SetLevelField(val, "HasEnemies", false); SetLevelField(val, "ValuablePresets", new List { val2 }); SetLevelField(val, "AmbiencePresets", new List()); SetLevelField(val, "FogColor", (object)new Color(0.008f, 0.012f, 0.028f)); SetLevelField(val, "FogStartDistance", 45f); SetLevelField(val, "FogEndDistance", 320f); SetLevelField(val, "AmbientColor", (object)new Color(0.44f, 0.46f, 0.52f)); SetLevelField(val, "AmbientColorAdaptation", (object)new Color(0.2f, 0.22f, 0.3f)); SetLevelField(val, "ColorTemperature", 0f); SetLevelField(val, "ColorFilter", (object)new Color(0.94f, 0.96f, 1f, 1f)); SetLevelField(val, "BloomIntensity", 0.5f); SetLevelField(val, "BloomThreshold", 1.1f); SetLevelField(val, "VignetteColor", (object)new Color(0.02f, 0.03f, 0.08f, 1f)); SetLevelField(val, "VignetteIntensity", 0.24f); SetLevelField(val, "VignetteSmoothness", 0.72f); SetLevelField(val, "DiscordIcon", "level"); EnsureLevelFieldInstance(val, "LoadingGraphic01"); EnsureLevelFieldInstance(val, "LoadingGraphic02"); EnsureLevelFieldInstance(val, "LoadingGraphic03"); EnsureLevelFieldInstance(val, "ConnectObject"); EnsureLevelFieldInstance(val, "BlockObject"); LevelContent val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "Empress Among Us Content"; LevelContentLevelRef.Invoke(val3) = val; LevelContentStartRoomsRef.Invoke(val3) = new List(); LevelContentModulesNormal1Ref.Invoke(val3) = new List(); LevelContentModulesNormal2Ref.Invoke(val3) = new List(); LevelContentModulesNormal3Ref.Invoke(val3) = new List(); LevelContentModulesPassage1Ref.Invoke(val3) = new List(); LevelContentModulesPassage2Ref.Invoke(val3) = new List(); LevelContentModulesPassage3Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd1Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd2Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd3Ref.Invoke(val3) = new List(); LevelContentModulesExtraction1Ref.Invoke(val3) = new List(); LevelContentModulesExtraction2Ref.Invoke(val3) = new List(); LevelContentModulesExtraction3Ref.Invoke(val3) = new List(); LevelContentConnectObjectRef.Invoke(val3) = null; LevelContentBlockObjectRef.Invoke(val3) = null; Levels.RegisterLevel(val3); return val; } private static void SetLevelField(Level level, string fieldName, object value) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && value != null && fieldInfo.FieldType.IsInstanceOfType(value)) { fieldInfo.SetValue(level, value); } } private static void EnsureLevelFieldInstance(Level level, string fieldName) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && fieldInfo.FieldType.IsClass && !(fieldInfo.FieldType == typeof(string)) && fieldInfo.GetValue(level) == null) { object uninitializedObject = FormatterServices.GetUninitializedObject(fieldInfo.FieldType); fieldInfo.SetValue(level, uninitializedObject); } } } internal sealed class AmongUsMeeting : MonoBehaviour { internal const float DiscussionSeconds = 20f; internal const float VoteSeconds = 30f; private Canvas _canvas; private Text _header; private Text _timerText; private Text _footer; private readonly List _boxes = new List(); private readonly List _rows = new List(); private readonly List _rowActors = new List(); private float _openTime; private bool _votePhase; private bool _voted; private int _myVote = -2; private bool _resultShown; private CursorLockMode _prevLock; private bool _prevCursorVisible; private bool _report; internal void Open(int callerActor, bool report) { //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) _openTime = Time.time; _votePhase = false; _voted = false; _myVote = -2; _resultShown = false; _report = report; _prevLock = Cursor.lockState; _prevCursorVisible = Cursor.visible; Build(callerActor); } private void Update() { if ((Object)(object)_canvas == (Object)null) { return; } if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.InputDisable(0.1f); } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; if (!_resultShown) { float num = Time.time - _openTime; if (!_votePhase && num >= 20f) { _votePhase = true; } if (!_votePhase) { _timerText.text = "DISCUSS " + Mathf.CeilToInt(20f - num); _footer.text = "Talk it out. Voting opens soon."; } else { float num2 = 50f - num; _timerText.text = "VOTE " + Mathf.CeilToInt(Mathf.Max(0f, num2)); HandleVoteInput(); } RefreshRows(); } } private void HandleVoteInput() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) bool flag = AmongUsGame.IsAlive(AmongUsGame.LocalAvatar()) && !_voted; _footer.text = (_voted ? "Vote locked in." : (flag ? "Click a crewmate to vote - click SKIP to pass" : "Dead players cannot vote.")); if (!flag) { return; } Vector2 val = Vector2.op_Implicit(Input.mousePosition); int num = -3; for (int i = 0; i < _boxes.Count; i++) { if (RectTransformUtility.RectangleContainsScreenPoint(((Graphic)_boxes[i]).rectTransform, val, (Camera)null)) { num = i; } } if (Input.GetMouseButtonDown(0) && num != -3) { if (num == _boxes.Count - 1) { CastAndLock(-1); } else if (AmongUsGame.IsAlive(AmongUsGame.AvatarByActor(_rowActors[num]))) { CastAndLock(_rowActors[num]); } } } private void CastAndLock(int targetActor) { _voted = true; _myVote = targetActor; AmongUsGame.Instance.CastVote(targetActor); } internal void ShowResult(int ejectedActor, bool wasImposter) { //IL_003f: 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_00aa: Unknown result type (might be due to invalid IL or missing references) _resultShown = true; if (!((Object)(object)_header == (Object)null)) { if (ejectedActor < 0) { _header.text = "NO ONE WAS EJECTED"; ((Graphic)_header).color = new Color(0.8f, 0.8f, 0.8f); _footer.text = "The vote was tied or skipped."; } else { PlayerAvatar val = AmongUsGame.AvatarByActor(ejectedActor); string text = (((Object)(object)val != (Object)null) ? AmongUsAccess.GetPlayerName(val) : "A player"); _header.text = text + " WAS EJECTED"; ((Graphic)_header).color = (wasImposter ? new Color(0.4f, 0.9f, 1f) : new Color(0.95f, 0.4f, 0.4f)); _footer.text = (wasImposter ? (text + " was an Imposter.") : (text + " was not an Imposter.")); } _timerText.text = ""; } } private void Build(int callerActor) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); GameObject val = new GameObject("Empress Among Us Meeting Canvas"); val.transform.SetParent(((Component)this).transform, false); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 1200; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); ((Object)MakeImage(val.transform, new Color(0f, 0f, 0f, 0.82f), Vector2.zero, Vector2.one)).name = "Dim"; _header = MakeText(val.transform, font, 40, new Vector2(0.2f, 0.87f), new Vector2(0.8f, 0.96f)); _header.text = (_report ? "DEAD BODY REPORTED" : "EMERGENCY MEETING"); ((Graphic)_header).color = (_report ? new Color(0.95f, 0.3f, 0.3f) : new Color(0.95f, 0.85f, 0.2f)); _timerText = MakeText(val.transform, font, 30, new Vector2(0.2f, 0.81f), new Vector2(0.8f, 0.87f)); ((Graphic)_timerText).color = Color.white; _footer = MakeText(val.transform, font, 22, new Vector2(0.2f, 0.06f), new Vector2(0.8f, 0.12f)); ((Graphic)_footer).color = new Color(0.85f, 0.9f, 1f); List list = (from p in AmongUsGame.AllPlayers() where (Object)(object)p != (Object)null select p).OrderBy(AmongUsGame.ActorOf).ToList(); int num = 2; int num2 = Mathf.CeilToInt((float)(list.Count + 1) / (float)num); float boxHeight = 0.66f / (float)Mathf.Max(1, num2); for (int num3 = 0; num3 < list.Count; num3++) { _rowActors.Add(AmongUsGame.ActorOf(list[num3])); AddBox(val.transform, font, num3, num3, num, num2, boxHeight); } AddBox(val.transform, font, list.Count, -1, num, num2, boxHeight); RefreshRows(); } private void AddBox(Transform parent, Font font, int slot, int rowIndex, int columns, int rowsPerColumn, float boxHeight) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) int num = slot / rowsPerColumn; int num2 = slot % rowsPerColumn; float num3 = 0.16f + (float)num * 0.36f; float num4 = num3 + 0.32f; float num5 = 0.78f - (float)num2 * boxHeight; float num6 = num5 - boxHeight * 0.82f; Image val = MakeImage(parent, new Color(0.1f, 0.12f, 0.18f, 0.9f), new Vector2(num3, num6), new Vector2(num4, num5)); _boxes.Add(val); Text val2 = MakeText(((Component)val).transform, font, 24, new Vector2(0.04f, 0f), new Vector2(0.96f, 1f)); val2.alignment = (TextAnchor)3; if (rowIndex >= 0) { _rows.Add(val2); } else { val2.text = "SKIP VOTE"; } } private void RefreshRows() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_007c: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(Input.mousePosition); for (int i = 0; i < _rows.Count; i++) { PlayerAvatar val2 = AmongUsGame.AvatarByActor(_rowActors[i]); string text = (((Object)(object)val2 != (Object)null) ? AmongUsAccess.GetPlayerName(val2) : "Unknown"); if (!AmongUsGame.IsAlive(val2)) { _rows[i].text = text + " (DEAD)"; ((Graphic)_rows[i]).color = new Color(0.5f, 0.5f, 0.5f); ((Graphic)_boxes[i]).color = new Color(0.06f, 0.06f, 0.08f, 0.85f); } else { _rows[i].text = text; ((Graphic)_rows[i]).color = Color.white; bool flag = _votePhase && !_voted && RectTransformUtility.RectangleContainsScreenPoint(((Graphic)_boxes[i]).rectTransform, val, (Camera)null); bool flag2 = _myVote == _rowActors[i]; ((Graphic)_boxes[i]).color = (flag2 ? new Color(0.4f, 0.6f, 0.3f, 0.95f) : (flag ? new Color(0.25f, 0.35f, 0.5f, 0.95f) : new Color(0.1f, 0.12f, 0.18f, 0.9f))); } } int num = _boxes.Count - 1; if (num >= 0) { bool flag3 = _votePhase && !_voted && RectTransformUtility.RectangleContainsScreenPoint(((Graphic)_boxes[num]).rectTransform, val, (Camera)null); ((Graphic)_boxes[num]).color = ((_myVote == -1) ? new Color(0.4f, 0.6f, 0.3f, 0.95f) : (flag3 ? new Color(0.25f, 0.35f, 0.5f, 0.95f) : new Color(0.12f, 0.12f, 0.14f, 0.9f))); } } private void OnDestroy() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Cursor.lockState = _prevLock; Cursor.visible = _prevCursorVisible; } private static Image MakeImage(Transform parent, Color color, Vector2 anchorMin, Vector2 anchorMax) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002b: 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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Box"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = color; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; return val2; } private static Text MakeText(Transform parent, Font font, int size, Vector2 anchorMin, Vector2 anchorMax) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); Text val2 = val.AddComponent(); val2.font = font; val2.fontSize = size; val2.alignment = (TextAnchor)4; ((Graphic)val2).color = Color.white; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; return val2; } } internal sealed class AmongUsMiniGame : MonoBehaviour { internal const int TypeCount = 4; private static readonly KeyCode[] NumberKeys; private int _type; private bool _imposter; private Action _onFinished; private Canvas _canvas; private Text _header; private Text _body; private Image _barBackground; private Image _barFill; private Image _marker; private Image _target; private float _holdProgress; private string _code = ""; private string _entered = ""; private float _markerPos; private int _timingHits; private float _mashValue; private bool _finished; private AudioSource _audio; internal void Begin(int type, bool imposter, Action onFinished) { _type = Mathf.Clamp(type, 0, 3); _imposter = imposter; _onFinished = onFinished; if (_type == 1) { _code = string.Concat(from _ in Enumerable.Range(0, 4) select Random.Range(1, 7).ToString()); } Build(); _audio = ((Component)this).gameObject.AddComponent(); _audio.spatialBlend = 0f; _audio.volume = 0.4f; _audio.playOnAwake = false; if ((Object)(object)AmongUsAudio.TaskBeep != (Object)null) { _audio.PlayOneShot(AmongUsAudio.TaskBeep); } } private void Update() { if (_finished) { return; } if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.InputDisable(0.1f); } if (Input.GetKeyDown((KeyCode)27)) { Finish(success: false); return; } switch (_type) { case 0: UpdateHold(); break; case 1: UpdateSequence(); break; case 2: UpdateTiming(); break; default: UpdateMash(); break; } } private void UpdateHold() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) _header.text = Title("DOWNLOAD DATA"); _body.text = "Hold [SPACE] to transfer - [Esc] Leave"; _holdProgress += (Input.GetKey((KeyCode)32) ? (Time.deltaTime / 3.5f) : ((0f - Time.deltaTime) * 0.4f)); _holdProgress = Mathf.Clamp01(_holdProgress); ((Graphic)_barFill).rectTransform.anchorMax = new Vector2(_holdProgress, 1f); if (_holdProgress >= 1f) { Finish(success: true); } } private void UpdateSequence() { _header.text = Title("ENTER CODE"); _body.text = "Code: " + _code + "\nYou: " + _entered + "\n[Esc] Leave"; for (int i = 0; i < NumberKeys.Length; i++) { if (Input.GetKeyDown(NumberKeys[i])) { _entered += i; if (!_code.StartsWith(_entered)) { _entered = ""; } else if (_entered.Length >= _code.Length) { Finish(success: true); } break; } } } private void UpdateTiming() { //IL_0072: 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) _header.text = Title("ALIGN ENGINE"); _body.text = "Press [SPACE] in the green zone (" + _timingHits + "/3) - [Esc] Leave"; _markerPos = Mathf.PingPong(Time.time * 0.6f, 1f); ((Graphic)_marker).rectTransform.anchorMin = new Vector2(_markerPos - 0.01f, 0f); ((Graphic)_marker).rectTransform.anchorMax = new Vector2(_markerPos + 0.01f, 1f); if (!Input.GetKeyDown((KeyCode)32)) { return; } if (_markerPos > 0.42f && _markerPos < 0.58f) { _timingHits++; if (_timingHits >= 3) { Finish(success: true); } } else { _timingHits = 0; } } private void UpdateMash() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) _header.text = Title("PRIME SHIELDS"); _body.text = "Mash [SPACE] to charge - [Esc] Leave"; _mashValue -= Time.deltaTime * 0.35f; if (Input.GetKeyDown((KeyCode)32)) { _mashValue += 0.08f; } _mashValue = Mathf.Clamp01(_mashValue); ((Graphic)_barFill).rectTransform.anchorMax = new Vector2(_mashValue, 1f); if (_mashValue >= 1f) { Finish(success: true); } } private string Title(string name) { if (!_imposter) { return name; } return name + " (faking)"; } private void Finish(bool success) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!_finished) { _finished = true; if ((Object)(object)_canvas != (Object)null) { ((Behaviour)_canvas).enabled = false; } if (success && !_imposter && (Object)(object)_audio != (Object)null && (Object)(object)AmongUsAudio.TaskComplete != (Object)null) { AudioSource.PlayClipAtPoint(AmongUsAudio.TaskComplete, ((Component)this).transform.position, 0.5f); } _onFinished?.Invoke(success, _imposter); } } private void Build() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_00a4: 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_00b9: Expected O, but got Unknown //IL_00e5: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0146: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); GameObject val = new GameObject("MiniGame Canvas"); val.transform.SetParent(((Component)this).transform, false); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 1100; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); GameObject val2 = new GameObject("Panel"); val2.transform.SetParent(val.transform, false); ((Graphic)val2.AddComponent()).color = new Color(0.02f, 0.05f, 0.1f, 0.92f); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.28f, 0.32f); component.anchorMax = new Vector2(0.72f, 0.68f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _header = MakeText(val2.transform, font, 32, new Vector2(0.05f, 0.72f), new Vector2(0.95f, 0.95f)); ((Graphic)_header).color = new Color(0.7f, 0.95f, 1f); _body = MakeText(val2.transform, font, 24, new Vector2(0.05f, 0.24f), new Vector2(0.95f, 0.68f)); ((Graphic)_body).color = Color.white; _barBackground = MakeImage(val2.transform, new Color(0f, 0f, 0f, 0.6f), new Vector2(0.08f, 0.08f), new Vector2(0.92f, 0.18f)); if (_type == 2) { _target = MakeImage(((Component)_barBackground).transform, new Color(0.3f, 0.9f, 0.4f, 0.8f), new Vector2(0.42f, 0f), new Vector2(0.58f, 1f)); _marker = MakeImage(((Component)_barBackground).transform, new Color(1f, 1f, 1f, 0.95f), new Vector2(0f, 0f), new Vector2(0.02f, 1f)); return; } _barFill = MakeImage(((Component)_barBackground).transform, new Color(0.35f, 0.85f, 1f, 0.95f), new Vector2(0f, 0f), new Vector2((_type == 1) ? 1f : 0f, 1f)); if (_type == 1) { ((Graphic)_barFill).color = new Color(0.35f, 0.85f, 1f, 0.2f); } } private static Image MakeImage(Transform parent, Color color, Vector2 anchorMin, Vector2 anchorMax) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002b: 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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Image"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = color; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; return val2; } private static Text MakeText(Transform parent, Font font, int size, Vector2 anchorMin, Vector2 anchorMax) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); Text val2 = val.AddComponent(); val2.font = font; val2.fontSize = size; val2.alignment = (TextAnchor)4; ((Graphic)val2).color = Color.white; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; return val2; } static AmongUsMiniGame() { KeyCode[] array = new KeyCode[10]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); NumberKeys = (KeyCode[])(object)array; } } [HarmonyPatch(typeof(RunManager), "SetRunLevel")] internal static class AmongUsPatchSetRunLevel { private static void Postfix(RunManager __instance) { if (EmpressAmongUsPlugin.Settings != null && EmpressAmongUsPlugin.Settings.ForceLevel.Value && !((Object)(object)EmpressAmongUsPlugin.AmongUsLevel == (Object)null)) { __instance.levelCurrent = EmpressAmongUsPlugin.AmongUsLevel; } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] internal static class AmongUsPatchGenerate { private static bool Prefix(LevelGenerator __instance, ref IEnumerator __result) { if (!EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = AmongUsRuntime.EnsureHost().GenerateLevel(__instance); return false; } } [HarmonyPatch(typeof(LevelPoint), "NavMeshCheck")] internal static class AmongUsPatchNavMeshCheck { private static bool Prefix(ref IEnumerator __result) { if (!EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = AmongUsRuntime.EmptyCoroutine(); return false; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] internal static class AmongUsPatchEnvironmentSetup { private static bool Prefix(EnvironmentDirector __instance) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00b9: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance)) { return true; } Level level = LevelGenerator.Instance.Level; if (!Object.op_Implicit((Object)(object)level) || !EmpressAmongUsPlugin.IsAmongUsLevel(level)) { return true; } Color fogColor = level.FogColor; Color ambientColor = level.AmbientColor; AmongUsAccess.SetEnvironmentFog(__instance, fogColor, level.FogStartDistance, level.FogEndDistance); AmongUsAccess.SetEnvironmentAmbient(__instance, ambientColor, level.AmbientColorAdaptation); RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)1; RenderSettings.fogColor = fogColor; RenderSettings.fogStartDistance = level.FogStartDistance; RenderSettings.fogEndDistance = level.FogEndDistance; RenderSettings.ambientLight = ambientColor; RenderSettings.ambientMode = (AmbientMode)3; Camera val = AmongUsAccess.GetEnvironmentMainCamera(__instance); if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; AmongUsAccess.SetEnvironmentMainCamera(__instance, val); } if (Object.op_Implicit((Object)(object)val)) { val.clearFlags = (CameraClearFlags)2; val.backgroundColor = fogColor; val.farClipPlane = 800f; } AmongUsAccess.SetEnvironmentDarkAdaptation(__instance, 0.18f); AmongUsAccess.SetEnvironmentSetupDone(__instance, value: true); return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class AmongUsPatchLoadingUi { private static void Postfix(LoadingUI __instance) { //IL_0054: 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) if (EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { if ((Object)(object)__instance.levelNumberText != (Object)null) { ((TMP_Text)__instance.levelNumberText).text = "SUS"; ((Graphic)__instance.levelNumberText).color = new Color(0.9f, 0.12f, 0.14f); ((Component)__instance.levelNumberText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNumberText).transform.SetAsLastSibling(); } if ((Object)(object)__instance.levelNameText != (Object)null) { ((TMP_Text)__instance.levelNameText).text = "Empress - The Skeld"; ((Graphic)__instance.levelNameText).color = new Color(0.75f, 0.85f, 1f); ((Component)__instance.levelNameText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNameText).transform.SetAsLastSibling(); ApplyHint(__instance); } } } private static void ApplyHint(LoadingUI loadingUI) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) if ((Object)(object)loadingUI == (Object)null || (Object)(object)loadingUI.levelNameText == (Object)null) { return; } Transform parent = ((TMP_Text)loadingUI.levelNameText).transform.parent; if (!((Object)(object)parent == (Object)null)) { Transform val = parent.Find("Empress Among Us Loading Hint"); TextMeshProUGUI val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 == (Object)null) { val2 = Object.Instantiate(loadingUI.levelNameText, parent); ((Object)val2).name = "Empress Among Us Loading Hint"; } ((TMP_Text)val2).text = "Finish your tasks. Find the imposter."; ((Graphic)val2).color = new Color(0.85f, 0.9f, 1f); ((TMP_Text)val2).fontSize = Mathf.Max(15f, ((TMP_Text)loadingUI.levelNameText).fontSize * 0.45f); ((TMP_Text)val2).enableAutoSizing = true; ((TMP_Text)val2).fontSizeMin = 12f; ((TMP_Text)val2).fontSizeMax = ((TMP_Text)val2).fontSize; ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((Component)val2).gameObject.SetActive(true); RectTransform rectTransform = ((TMP_Text)val2).rectTransform; RectTransform rectTransform2 = ((TMP_Text)loadingUI.levelNameText).rectTransform; rectTransform.anchorMin = rectTransform2.anchorMin; rectTransform.anchorMax = rectTransform2.anchorMax; rectTransform.pivot = rectTransform2.pivot; rectTransform.anchoredPosition = rectTransform2.anchoredPosition + new Vector2(0f, -72f); rectTransform.sizeDelta = new Vector2(Mathf.Max(rectTransform2.sizeDelta.x, 760f), 90f); ((TMP_Text)val2).transform.SetAsLastSibling(); } } } [HarmonyPatch(typeof(MapToolController), "Update")] internal static class AmongUsPatchMapTool { private static bool Prefix() { return !EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null); } } [HarmonyPatch(typeof(ItemManager), "TurnOffIconLights")] internal static class AmongUsPatchIconLights { private static bool Prefix(ItemManager __instance, ref IEnumerator __result) { if (!EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = SafeTurnOffIconLights(__instance); return false; } private static IEnumerator SafeTurnOffIconLights(ItemManager itemManager) { if (!((Object)(object)itemManager.itemIconLights == (Object)null)) { while ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.2f); } itemManager.itemIconLights.SetActive(false); } } } internal sealed class AmongUsReport : MonoBehaviour { private const float ReportRange = 2.8f; private Text _prompt; private bool _hasBody; private bool _armed; private float _headScanTimer; private bool _headNearCached; private void Update() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_prompt == (Object)null) { BuildPrompt(); if ((Object)(object)_prompt == (Object)null) { return; } } AmongUsGame instance = AmongUsGame.Instance; if ((Object)(object)instance == (Object)null || instance.Phase != GamePhase.Roaming) { _prompt.text = ""; return; } PlayerAvatar val = AmongUsGame.LocalAvatar(); if (!AmongUsGame.IsAlive(val)) { _prompt.text = ""; return; } _hasBody = instance.NearestBody(((Component)val).transform.position, 2.8f).HasValue || HeadNear(((Component)val).transform.position); if (!_hasBody) { _armed = true; _prompt.text = ""; return; } ((Graphic)_prompt).color = new Color(0.95f, 0.35f, 0.35f, 0.95f); _prompt.text = "[R] Report Body"; bool keyDown = Input.GetKeyDown((KeyCode)114); if (!_armed) { if (!Input.GetKey((KeyCode)114)) { _armed = true; } } else if (keyDown) { _prompt.text = ""; instance.RequestMeeting(AmongUsGame.LocalActor(), report: true); } } private bool HeadNear(Vector3 position) { //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) _headScanTimer -= Time.deltaTime; if (_headScanTimer > 0f) { return _headNearCached; } _headScanTimer = 0.3f; _headNearCached = false; PlayerDeathHead[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && Vector3.Distance(((Component)array[i]).transform.position, position) <= 2.8f) { _headNearCached = true; break; } } return _headNearCached; } 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_00b5: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) 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("AmongUsReportPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _prompt.font = font; ((Graphic)_prompt).color = new Color(0.95f, 0.35f, 0.35f, 0.95f); _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 26; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.3f, 0.44f); component.anchorMax = new Vector2(0.7f, 0.5f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = ""; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } } } internal sealed class AmongUsRuntime : MonoBehaviour { private static readonly Vector3[] SkeldRooms = (Vector3[])(object)new Vector3[16] { new Vector3(26.8f, 0f, -15f), new Vector3(15f, 0f, 4.5f), new Vector3(13f, 0f, 24f), new Vector3(-4.5f, 0f, 9f), new Vector3(-29f, 0f, -1f), new Vector3(-29f, 0f, 13f), new Vector3(-2.5f, 0f, -20f), new Vector3(-5f, 0f, 38f), new Vector3(3.8f, 0f, 11.5f), new Vector3(3.3f, 0f, 0.9f), new Vector3(57f, 0f, 8f), new Vector3(64f, 0f, 14f), new Vector3(53f, 0f, 14f), new Vector3(86f, 0f, -0.9f), new Vector3(86f, 0f, 18f), new Vector3(54f, 0f, 22f) }; private static readonly Vector3 ButtonPosition = new Vector3(26.8f, 1.3f, -12f); internal static Vector3 CafeteriaTable = new Vector3(26.8f, 0.15f, -12f); private Transform _root; private Transform _moduleRoot; private Transform _levelInstance; private Vector3 _respawnPosition; private Quaternion _respawnRotation; private List _musicSources = new List(); private int _sceneHandle = -1; private bool _active; public static AmongUsRuntime Instance { get; private set; } public static AmongUsRuntime EnsureHost() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return Instance; } GameObject val = new GameObject("Empress Among Us Runtime"); val.transform.parent = null; ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)val); Instance = val.AddComponent(); return Instance; } public static IEnumerator EmptyCoroutine() { yield break; } private void Awake() { Instance = this; } private void Update() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) HandleSceneTransition(); if (!_active) { return; } if (!EmpressAmongUsPlugin.IsAmongUsLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { Deactivate(); return; } if (Input.GetKeyDown(EmpressAmongUsPlugin.Settings.CaptureSpawnKey.Value)) { CaptureSpawnHere(); } UpdateMusic(); CheckLocalVoidRespawn(); } public IEnumerator GenerateLevel(LevelGenerator generator) { EmpressAmongUsPlugin.EnsurePhotonHooked(); AmongUsAssets.Load(); yield return (object)new WaitForSeconds(0.2f); if (!SemiFunc.IsMultiplayer()) { AmongUsAccess.SetAllPlayersReady(generator, value: true); } while (!AmongUsAccess.GetAllPlayersReady(generator)) { generator.State = (LevelState)1; yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(0.2f); generator.Level = RunManager.instance.levelCurrent; AmongUsAccess.SetLevelPrevious(RunManager.instance, generator.Level); generator.Generated = false; AmongUsAccess.SetEnemyReady(generator, value: true); AmongUsAccess.SetModulesSpawned(generator, 0); AmongUsAccess.SetPlayerSpawnedCount(generator, 0); generator.LevelPathPoints = new List(); generator.LevelPathTruck = null; if ((Object)(object)RoundDirector.instance != (Object)null) { AmongUsAccess.ResetRoundExtraction(RoundDirector.instance); } generator.State = (LevelState)3; BuildLevel(generator); AmongUsRuntime amongUsRuntime = this; Scene activeScene = SceneManager.GetActiveScene(); amongUsRuntime._sceneHandle = ((Scene)(ref activeScene)).handle; yield return (object)new WaitForSeconds(0.2f); if (Object.op_Implicit((Object)(object)EnvironmentDirector.Instance)) { EnvironmentDirector.Instance.Setup(); } if (Object.op_Implicit((Object)(object)PostProcessing.Instance)) { PostProcessing.Instance.Setup(); } if (Object.op_Implicit((Object)(object)LevelMusic.instance)) { LevelMusic.instance.Setup(); } if (Object.op_Implicit((Object)(object)ConstantMusic.instance)) { ConstantMusic.instance.Setup(); } if (SemiFunc.IsMasterClientOrSingleplayer()) { while ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList.Count == 0) { generator.State = (LevelState)12; yield return (object)new WaitForSeconds(0.1f); } generator.PlayerSpawn(); yield return null; while (AmongUsAccess.GetPlayerSpawnedCount(generator) < GameDirector.instance.PlayerList.Count) { generator.State = (LevelState)13; yield return (object)new WaitForSeconds(0.1f); } if (SemiFunc.IsMultiplayer()) { generator.PhotonView.RPC("GenerateDone", (RpcTarget)3, Array.Empty()); } else { AmongUsAccess.GenerateDone(generator); } } else { while (!generator.Generated) { yield return (object)new WaitForSeconds(0.1f); } } yield return (object)new WaitForSeconds(0.5f); Activate(); } private void BuildLevel(LevelGenerator generator) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generator.LevelParent != (Object)null) { for (int num = generator.LevelParent.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)generator.LevelParent.transform.GetChild(num)).gameObject); } } GameObject val = new GameObject("Empress Among Us Root"); val.transform.SetParent(generator.LevelParent.transform, false); _root = val.transform; GameObject val2 = new GameObject("Empress Among Us Module"); val2.transform.SetParent(val.transform, false); _moduleRoot = val2.transform; val2.AddComponent().ObservedComponents = new List(); AmongUsAccess.ConfigureStartRoomModule(val2.AddComponent(), 0, 0); val2.AddComponent(); GameObject levelPrefab = AmongUsAssets.LevelPrefab; if ((Object)(object)levelPrefab != (Object)null) { bool activeSelf = levelPrefab.activeSelf; levelPrefab.SetActive(false); GameObject val3 = Object.Instantiate(levelPrefab, val2.transform, false); levelPrefab.SetActive(activeSelf); ((Object)val3).name = "Empress Among Us Level"; _levelInstance = val3.transform; DisableSunLights(_levelInstance); PrepareAnimators(_levelInstance); SetupDoors(_levelInstance); val3.SetActive(true); CollectGameTaskMarkers(_levelInstance); } _respawnPosition = EmpressAmongUsPlugin.Settings.SpawnPosition; _respawnRotation = EmpressAmongUsPlugin.Settings.SpawnRotation; if (EmpressAmongUsPlugin.Settings.SpawnY.Value <= -9000f) { Transform val4 = FindInLevel("EmpressAmongUsSpawn"); if ((Object)(object)val4 != (Object)null) { _respawnPosition = val4.position; _respawnRotation = Quaternion.Euler(0f, val4.eulerAngles.y, 0f); } else { _respawnPosition = new Vector3(26.8f, 0.15f, -15.5f); _respawnRotation = Quaternion.identity; } } RoomVolume roomVolume = BuildRoomVolume(val2); ConfigureMusic(); BuildSpawnPoints(val2.transform, roomVolume, generator); BuildEmergencyButton(val2.transform); AmongUsTasks.Setup(val2.transform); if ((Object)(object)_levelInstance != (Object)null) { SetupVents(_levelInstance); } } private RoomVolume BuildRoomVolume(GameObject moduleObject) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Among Us Room Volume"); val.transform.SetParent(moduleObject.transform, false); RoomVolume val2 = val.AddComponent(); val2.Truck = true; BoxCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.center = new Vector3(28f, 4f, 9f); obj.size = new Vector3(200f, 60f, 140f); return val2; } private void ConfigureMusic() { _musicSources = new List(); if ((Object)(object)_levelInstance == (Object)null) { return; } AudioSource[] componentsInChildren = ((Component)_levelInstance).GetComponentsInChildren(true); foreach (AudioSource val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.clip == (Object)null)) { string name = ((Object)val.clip).name; if (name.StartsWith("MX_") || name.IndexOf("music", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("song", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("lobby", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("menu", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("theme", StringComparison.OrdinalIgnoreCase) >= 0) { val.playOnAwake = false; val.volume = 0f; val.Stop(); } else { val.volume = Mathf.Min((val.volume <= 0.01f) ? 0.4f : val.volume, 0.5f); _musicSources.Add(val); } } } } private void BuildSpawnPoints(Transform parent, RoomVolume roomVolume, LevelGenerator generator) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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) Vector3 val = _respawnRotation * Vector3.right; Vector3 val2 = _respawnRotation * Vector3.forward; Vector3[] array = (Vector3[])(object)new Vector3[6] { Vector3.zero, val * 1.3f, -val * 1.3f, -val2 * 1.3f, val * 1.3f - val2 * 1.3f, -val * 1.3f - val2 * 1.3f }; for (int i = 0; i < array.Length; i++) { GameObject val3 = new GameObject("Empress Among Us Spawn"); val3.transform.SetParent(parent, false); val3.transform.position = _respawnPosition + array[i] + Vector3.up * 0.15f; val3.transform.rotation = _respawnRotation; val3.AddComponent(); } LevelPoint val4 = CreateLevelPoint(parent, roomVolume, generator, _respawnPosition, truck: true); LevelPoint val5 = val4; for (int j = 0; j < SkeldRooms.Length; j++) { LevelPoint val6 = CreateLevelPoint(parent, roomVolume, generator, SkeldRooms[j] + Vector3.up * 0.5f, truck: false); val6.ConnectedPoints = new List { val5 }; val5.ConnectedPoints.Add(val6); val5 = val6; } generator.LevelPathTruck = val4; } private static LevelPoint CreateLevelPoint(Transform parent, RoomVolume roomVolume, LevelGenerator generator, Vector3 position, bool truck) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Among Us Level Point"); int num = LayerMask.NameToLayer("Other"); if (num >= 0) { val.layer = num; } val.transform.SetParent(parent, false); val.transform.position = position; SphereCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.radius = 0.35f; LevelPoint val2 = val.AddComponent(); val2.ConnectedPoints = new List(); val2.Room = roomVolume; val2.Truck = truck; val2.ModuleConnect = false; AmongUsAccess.MarkLevelPointInStartRoom(val2, value: true); if (generator.LevelPathPoints == null) { generator.LevelPathPoints = new List(); } generator.LevelPathPoints.Add(val2); return val2; } private void BuildEmergencyButton(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Among Us Emergency Button"); val.transform.SetParent(parent, false); val.transform.position = ButtonPosition; val.AddComponent(); } private void DisableSunLights(Transform levelRoot) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 Light[] componentsInChildren = ((Component)levelRoot).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if ((int)componentsInChildren[i].type == 1) { ((Behaviour)componentsInChildren[i]).enabled = false; } else { componentsInChildren[i].intensity = Mathf.Min(componentsInChildren[i].intensity, 2.2f); } } } private void PrepareAnimators(Transform levelRoot) { Animator[] componentsInChildren = ((Component)levelRoot).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].cullingMode = (AnimatorCullingMode)0; } } private void CollectGameTaskMarkers(Transform levelRoot) { AmongUsTaskMarker.GameMarkers.Clear(); Transform[] componentsInChildren = ((Component)levelRoot).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if ((Object)(object)val == (Object)null) { continue; } string name = ((Object)val).name; if (name.StartsWith("SM_Arrow_Minigame") || name.StartsWith("FloorMarker") || name.StartsWith("AS_Arrow_Minigame") || name.StartsWith("SM_UI_TrackerArrow")) { Renderer[] componentsInChildren2 = ((Component)val).GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].enabled = false; } AmongUsTaskMarker.GameMarkers.Add(((Component)val).gameObject); } } } private void SetupDoors(Transform levelRoot) { int num = 0; Transform[] componentsInChildren = ((Component)levelRoot).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { string name = ((Object)val).name; if ((name.StartsWith("SM_Door_L") || name.StartsWith("SM_Door_M") || name.StartsWith("SM_Door_R") || name.StartsWith("SM_BlastDoor")) && !((Object)(object)((Component)val).GetComponent() == (Object)null) && (Object)(object)((Component)val).GetComponent() == (Object)null) { ((Component)val).gameObject.AddComponent(); num++; } } EmpressAmongUsPlugin.DebugLog("Empress Among Us set up " + num + " sliding doors."); } private void SetupVents(Transform levelRoot) { Dictionary> dictionary = new Dictionary>(); Transform[] componentsInChildren = ((Component)levelRoot).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (!((Object)val).name.StartsWith("Vent ") && !((Object)val).name.StartsWith("Vent_")) { continue; } Transform val2 = FindVentGroup(val); if (!((Object)(object)val2 == (Object)null)) { AmongUsVent amongUsVent = ((Component)val).gameObject.GetComponent(); if ((Object)(object)amongUsVent == (Object)null) { amongUsVent = ((Component)val).gameObject.AddComponent(); } if (!dictionary.TryGetValue(val2, out var value)) { value = (dictionary[val2] = new List()); } value.Add(amongUsVent); } } int num = 0; foreach (KeyValuePair> item in dictionary) { for (int j = 0; j < item.Value.Count; j++) { item.Value[j].Configure(item.Value, j); } num += item.Value.Count; } EmpressAmongUsPlugin.DebugLog("Empress Among Us wired " + num + " vents into " + dictionary.Count + " groups."); } private static Transform FindVentGroup(Transform node) { Transform parent = node.parent; while ((Object)(object)parent != (Object)null) { if (((Object)parent).name.StartsWith("VentGroup")) { return parent; } parent = parent.parent; } return node.parent; } private void CaptureSpawnHere() { //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_0021: 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_004b: 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_008d: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = LocalAvatar(); if (IsPlayable(val)) { Vector3 position = ((Component)val).transform.position; float y = ((Component)val).transform.eulerAngles.y; EmpressAmongUsPlugin.Settings.SpawnX.Value = position.x; EmpressAmongUsPlugin.Settings.SpawnY.Value = position.y; EmpressAmongUsPlugin.Settings.SpawnZ.Value = position.z; EmpressAmongUsPlugin.Settings.SpawnYaw.Value = ((y > 180f) ? (y - 360f) : y); _respawnPosition = position; _respawnRotation = Quaternion.Euler(0f, y, 0f); SemiFunc.UIFocusText("Spawn set: " + position.x.ToString("F0") + ", " + position.y.ToString("F0") + ", " + position.z.ToString("F0"), new Color(0.6f, 1f, 0.6f), Color.white, 2.5f); } } private void Activate() { _active = true; UpdateMusic(); for (int i = 0; i < _musicSources.Count; i++) { AudioSource val = _musicSources[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.clip != (Object)null && !val.isPlaying) { val.Play(); } } AmongUsGame.EnsureHost().StartRound(); } private void Deactivate() { _active = false; for (int i = 0; i < _musicSources.Count; i++) { if ((Object)(object)_musicSources[i] != (Object)null && _musicSources[i].isPlaying) { _musicSources[i].Stop(); } } _musicSources.Clear(); _root = null; _moduleRoot = null; _levelInstance = null; if ((Object)(object)AmongUsGame.Instance != (Object)null) { AmongUsGame.Instance.EndRound(); } } private void HandleSceneTransition() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (_active) { Scene activeScene = SceneManager.GetActiveScene(); int handle = ((Scene)(ref activeScene)).handle; if (_sceneHandle != -1 && handle != _sceneHandle) { Deactivate(); } } } private void UpdateMusic() { float volume = ((EmpressAmongUsPlugin.Settings != null) ? EmpressAmongUsPlugin.Settings.MasterVolume.Value : 0.35f); for (int i = 0; i < _musicSources.Count; i++) { if ((Object)(object)_musicSources[i] != (Object)null) { _musicSources[i].volume = volume; } } } private void CheckLocalVoidRespawn() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = LocalAvatar(); if (IsPlayable(val)) { float num = ((EmpressAmongUsPlugin.Settings != null) ? EmpressAmongUsPlugin.Settings.VoidY.Value : (-60f)); if (((Component)val).transform.position.y < num) { RespawnLocal(force: true); } } } private void RespawnLocal(bool force) { //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_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_001b: 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) AmongUsAccess.TeleportLocalPlayer(_respawnPosition + Vector3.up * 0.8f, _respawnRotation); SemiFunc.UIFocusText("Back to the cafeteria.", new Color(0.72f, 0.88f, 1f), Color.white, 1.8f); } private Transform FindInLevel(string name) { if ((Object)(object)_levelInstance == (Object)null) { return null; } Transform[] componentsInChildren = ((Component)_levelInstance).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)componentsInChildren[i]).name == name) { return componentsInChildren[i]; } } return null; } private static PlayerAvatar LocalAvatar() { if (!((Object)(object)PlayerController.instance != (Object)null)) { return null; } return PlayerController.instance.playerAvatarScript; } private static bool IsPlayable(PlayerAvatar avatar) { if ((Object)(object)avatar != (Object)null && !AmongUsAccess.GetIsDisabled(avatar)) { return !AmongUsAccess.GetDeadSet(avatar); } return false; } private static float ToFloat(object value) { if (value is float) { return (float)value; } if (value is double num) { return (float)num; } if (value is int num2) { return num2; } return 0f; } } internal sealed class AmongUsTaskMarker : MonoBehaviour { internal static readonly List GameMarkers = new List(); private int _stationId; private readonly List _renderers = new List(); private bool _shown = true; internal void Configure(int stationId, Vector3 worldPosition) { //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) _stationId = stationId; for (int i = 0; i < GameMarkers.Count; i++) { GameObject val = GameMarkers[i]; if (!((Object)(object)val == (Object)null) && Vector3.Distance(val.transform.position, worldPosition) < 5f) { _renderers.AddRange(val.GetComponentsInChildren(true)); } } SetVisible(visible: false); } private void Update() { AmongUsGame instance = AmongUsGame.Instance; bool visible = (Object)(object)instance != (Object)null && instance.Phase == GamePhase.Roaming && !instance.LocalIsImposter && instance.LocalTasks.Contains(_stationId) && !instance.IsLocalTaskDone(_stationId) && AmongUsGame.IsAlive(AmongUsGame.LocalAvatar()); SetVisible(visible); } private void SetVisible(bool visible) { if (_shown == visible) { return; } _shown = visible; for (int i = 0; i < _renderers.Count; i++) { if ((Object)(object)_renderers[i] != (Object)null) { _renderers[i].enabled = visible; } } } } internal static class AmongUsTasks { private static readonly Vector3[] StationSpots = (Vector3[])(object)new Vector3[14] { new Vector3(8.8f, 0f, 23.9f), new Vector3(14.9f, 0f, 11.6f), new Vector3(11.5f, 0f, -21.2f), new Vector3(17f, 0f, 38.5f), new Vector3(44.1f, 0f, 15.6f), new Vector3(47.1f, 0f, 8.9f), new Vector3(-33.7f, 0f, 6.2f), new Vector3(-31.7f, 0f, 1.8f), new Vector3(-0.4f, 0f, 38.1f), new Vector3(92.6f, 0f, 8.5f), new Vector3(34.7f, 0f, 43.9f), new Vector3(80.8f, 0f, -6.9f), new Vector3(86f, 0f, 2f), new Vector3(9f, 0f, -16.7f) }; private static readonly string[] StationNames = new string[14] { "Swipe Card (Admin)", "Upload Files (Admin)", "Download Files (Cafeteria)", "Divert Power (Comms)", "Calibrate Distributor (Electrical)", "Submit Scan (MedBay)", "Chart Course (Navigation)", "Stabilize Steering (Navigation)", "Repair Shields (Shields)", "Start Reactor (Reactor)", "Fuel Engines (Storage)", "Align Engine (Upper Engine)", "Unlock Manifolds (Reactor)", "Empty Garbage (Cafeteria)" }; internal static int StationCount { get; private set; } internal static string StationName(int index) { if (index < 0 || index >= StationNames.Length) { return "Task " + index; } return StationNames[index]; } internal static void Setup(Transform parent) { //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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(EmpressAmongUsPlugin.Settings.TaskStations.Value, 3, StationSpots.Length); StationCount = 0; RaycastHit val2 = default(RaycastHit); for (int i = 0; i < num; i++) { Vector3 val = StationSpots[i]; if (Physics.Raycast(val + Vector3.up * 3f, Vector3.down, ref val2, 8f, -1, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point; } GameObject val3 = new GameObject("Empress Among Us Task " + i); val3.transform.SetParent(parent, false); val3.transform.position = val + Vector3.up * 0.2f; AmongUsTaskStation amongUsTaskStation = val3.AddComponent(); amongUsTaskStation.StationId = i; amongUsTaskStation.MiniGameType = i % 4; StationCount++; } } } internal sealed class AmongUsTaskStation : MonoBehaviour { private const float InteractionDistance = 2.4f; public int StationId; public int MiniGameType; private Text _prompt; private bool _armed; private AmongUsMiniGame _active; private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) BuildPrompt(); GameObject val = new GameObject("Empress Among Us Task Marker " + StationId); val.transform.SetParent(((Component)this).transform, false); val.AddComponent().Configure(StationId, ((Component)this).transform.position); } private void Update() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_019a: 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) AmongUsGame instance = AmongUsGame.Instance; if ((Object)(object)_prompt == (Object)null || (Object)(object)instance == (Object)null || instance.Phase != GamePhase.Roaming || !Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { if ((Object)(object)_prompt != (Object)null) { _prompt.text = ""; } return; } if ((Object)(object)_active != (Object)null) { if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.InputDisable(0.1f); } return; } PlayerAvatar val = AmongUsGame.LocalAvatar(); if (!AmongUsGame.IsAlive(val)) { _prompt.text = ""; return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) > 2.4f) { _armed = false; _prompt.text = ""; return; } bool localIsImposter = instance.LocalIsImposter; if (!localIsImposter && !instance.LocalTasks.Contains(StationId)) { _prompt.text = "Not your task"; ((Graphic)_prompt).color = new Color(0.6f, 0.6f, 0.6f, 0.8f); return; } if (!localIsImposter && instance.IsLocalTaskDone(StationId)) { _prompt.text = AmongUsTasks.StationName(StationId) + " - Done"; ((Graphic)_prompt).color = new Color(0.5f, 0.9f, 0.6f, 0.9f); return; } ((Graphic)_prompt).color = (localIsImposter ? new Color(0.9f, 0.5f, 0.5f, 0.9f) : new Color(0.7f, 0.95f, 1f, 0.95f)); _prompt.text = "[E] " + (localIsImposter ? "Fake: " : "") + AmongUsTasks.StationName(StationId); bool flag = Input.GetKeyDown((KeyCode)101) || ((Object)(object)InputManager.instance != (Object)null && InputManager.instance.KeyDown((InputKey)2)); if (!_armed) { if (!flag) { _armed = true; } } else if (flag) { OpenMiniGame(localIsImposter); } } private void OpenMiniGame(bool imposter) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown _armed = false; GameObject val = new GameObject("Empress Among Us MiniGame"); val.transform.SetParent(((Component)this).transform, false); _active = val.AddComponent(); _active.Begin(MiniGameType, imposter, OnMiniGameFinished); } private void OnMiniGameFinished(bool success, bool imposter) { if ((Object)(object)_active != (Object)null) { Object.Destroy((Object)(object)((Component)_active).gameObject); _active = null; } if (success && !imposter) { AmongUsGame.Instance.CompleteLocalTask(StationId); } } 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_00ce: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) 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("AmongUsTaskPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Font f) => ((Object)f).name == "Arial")) ?? Resources.FindObjectsOfTypeAll().FirstOrDefault() ?? Font.CreateDynamicFontFromOSFont("Arial", 16); _prompt.font = font; _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 22; ((Graphic)_prompt).color = new Color(0.7f, 0.95f, 1f, 0.95f); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.3f, 0.28f); component.anchorMax = new Vector2(0.7f, 0.33f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = ""; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } if ((Object)(object)_active != (Object)null) { Object.Destroy((Object)(object)((Component)_active).gameObject); } } } public sealed class AmongUsVent : MonoBehaviour { private const float InteractionDistance = 2.6f; private const float VentVolume = 0.2f; private const float Cooldown = 1.2f; private readonly List _group = new List(); private int _indexInGroup; private AudioSource _audio; private Text _prompt; private bool _armed; private static float _globalCooldownUntil; public void Configure(List group, int index) { _group.Clear(); _group.AddRange(group); _indexInGroup = index; } private void Start() { _audio = ((Component)this).gameObject.AddComponent(); _audio.spatialBlend = 1f; _audio.minDistance = 2f; _audio.maxDistance = 20f; _audio.volume = 0.2f; _audio.playOnAwake = false; BuildPrompt(); } private void Update() { //IL_008a: 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) AmongUsGame instance = AmongUsGame.Instance; if (_group.Count < 2 || !Object.op_Implicit((Object)(object)PlayerAvatar.instance) || (Object)(object)instance == (Object)null || !instance.LocalIsImposter || instance.Phase != GamePhase.Roaming) { if ((Object)(object)_prompt != (Object)null) { _prompt.text = ""; } return; } if (!AmongUsGame.IsAlive(AmongUsGame.LocalAvatar())) { if ((Object)(object)_prompt != (Object)null) { _prompt.text = ""; } return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerAvatar.instance).transform.position) > 2.6f) { _armed = false; if (Object.op_Implicit((Object)(object)_prompt)) { _prompt.text = ""; } return; } if (Object.op_Implicit((Object)(object)_prompt)) { _prompt.text = "[V] Vent"; } bool key = Input.GetKey((KeyCode)118); if (!_armed) { if (!key) { _armed = true; } } else if (Input.GetKeyDown((KeyCode)118) && Time.time >= _globalCooldownUntil) { TravelToNext(); } } private void TravelToNext() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) _globalCooldownUntil = Time.time + 1.2f; _armed = false; AmongUsVent amongUsVent = null; for (int i = 1; i < _group.Count; i++) { AmongUsVent amongUsVent2 = _group[(_indexInGroup + i) % _group.Count]; if ((Object)(object)amongUsVent2 != (Object)null && (Object)(object)amongUsVent2 != (Object)(object)this) { amongUsVent = amongUsVent2; break; } } if (!((Object)(object)amongUsVent == (Object)null)) { if ((Object)(object)_audio != (Object)null && (Object)(object)AmongUsAudio.VentMove != (Object)null) { _audio.PlayOneShot(AmongUsAudio.VentMove); } Vector3 val = FindExit(((Component)amongUsVent).transform.position); Vector3 val2 = val - ((Component)amongUsVent).transform.position; val2.y = 0f; Quaternion rotation = ((((Vector3)(ref val2)).sqrMagnitude > 0.05f) ? Quaternion.LookRotation(((Vector3)(ref val2)).normalized) : Quaternion.identity); AmongUsAccess.TeleportLocalPlayer(val, rotation); if ((Object)(object)amongUsVent._audio != (Object)null && (Object)(object)AmongUsAudio.VentMove != (Object)null) { amongUsVent._audio.PlayOneShot(AmongUsAudio.VentMove); } } } private static Vector3 FindExit(Vector3 ventPosition) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_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_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_00d2: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) Vector3[] obj = new Vector3[8] { Vector3.forward, Vector3.back, Vector3.left, Vector3.right, default(Vector3), default(Vector3), default(Vector3), default(Vector3) }; Vector3 val = new Vector3(1f, 0f, 1f); obj[4] = ((Vector3)(ref val)).normalized; val = new Vector3(-1f, 0f, 1f); obj[5] = ((Vector3)(ref val)).normalized; val = new Vector3(1f, 0f, -1f); obj[6] = ((Vector3)(ref val)).normalized; val = new Vector3(-1f, 0f, -1f); obj[7] = ((Vector3)(ref val)).normalized; Vector3[] array = (Vector3[])(object)obj; RaycastHit val3 = default(RaycastHit); foreach (Vector3 val2 in array) { if (Physics.Raycast(ventPosition + val2 * 1.6f + Vector3.up * 1f, Vector3.down, ref val3, 4f, -1, (QueryTriggerInteraction)1) && !Physics.CheckSphere(((RaycastHit)(ref val3)).point + Vector3.up * 1f, 0.35f, -1, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val3)).point + Vector3.up * 0.4f; } } return ventPosition + Vector3.up * 0.9f; } 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_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("AmongUsVentPrompt"); val2.transform.SetParent(val, false); _prompt = val2.AddComponent(); Font font = ((Resources.FindObjectsOfTypeAll().Length != 0) ? Resources.FindObjectsOfTypeAll()[0] : Font.CreateDynamicFontFromOSFont("Arial", 16)); _prompt.font = font; ((Graphic)_prompt).color = new Color(0.85f, 0.95f, 1f, 0.95f); _prompt.alignment = (TextAnchor)4; _prompt.fontSize = 22; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.35f, 0.4f); component.anchorMax = new Vector2(0.65f, 0.46f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; _prompt.text = ""; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)_prompt)) { Object.Destroy((Object)(object)((Component)_prompt).gameObject); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.empress.repo.amongus", "Empress Among Us", "1.0.0")] public sealed class EmpressAmongUsPlugin : BaseUnityPlugin { public const string PluginGuid = "com.empress.repo.amongus"; public const string PluginName = "Empress Among Us"; public const string PluginVersion = "1.0.0"; public const string LevelName = "Level - Empress Among Us"; public const string DisplayName = "Empress - The Skeld"; internal const byte MeetingEventCode = 179; internal const byte RoleAssignCode = 181; internal const byte KillCode = 182; internal const byte MeetingStartCode = 183; internal const byte VoteCode = 184; internal const byte MeetingEndCode = 185; internal const byte TaskDoneCode = 186; internal const byte ProgressCode = 187; internal const byte GameOverCode = 188; internal const byte GameBeginCode = 189; private static bool _photonHooked; private Harmony _harmony; internal static EmpressAmongUsPlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static AmongUsSettings Settings { get; private set; } internal static Level AmongUsLevel { get; private set; } internal static string PluginDirectory { get; private set; } private void Awake() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Settings = new AmongUsSettings(((BaseUnityPlugin)this).Config); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); AmongUsAssets.Load(); AmongUsLevel = AmongUsLevelRegistry.RegisterLevel(); _harmony = new Harmony("com.empress.repo.amongus"); _harmony.PatchAll(typeof(EmpressAmongUsPlugin).Assembly); AmongUsRuntime amongUsRuntime = AmongUsRuntime.EnsureHost(); AmongUsGame.EnsureHost(); ((MonoBehaviour)amongUsRuntime).StartCoroutine(AmongUsAudio.LoadAll(PluginDirectory)); } private void OnDestroy() { RemovePhotonHook(); } internal static bool IsAmongUsLevel(Level level) { if ((Object)(object)level != (Object)null) { return ((Object)level).name == "Level - Empress Among Us"; } return false; } internal static void EnsurePhotonHooked() { if (!_photonHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; networkingClient.EventReceived += OnPhotonEvent; _photonHooked = true; } } } internal static void RemovePhotonHook() { if (_photonHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; } _photonHooked = false; } } private static void OnPhotonEvent(EventData ev) { AmongUsGame instance = AmongUsGame.Instance; if (!((Object)(object)instance == (Object)null) && ev.CustomData is object[] data) { switch (ev.Code) { case 181: instance.ReceiveRole(data); break; case 182: instance.ReceiveKill(data); break; case 183: instance.ReceiveMeetingStart(data); break; case 184: instance.ReceiveVote(data); break; case 185: instance.ReceiveMeetingEnd(data); break; case 186: instance.ReceiveTaskDone(data); break; case 187: instance.ReceiveProgress(data); break; case 188: instance.ReceiveGameOver(data); break; case 189: instance.ReceiveGameBegin(data); break; } } } internal static void DebugLog(string message) { if (Settings != null && Settings.DebugLogs.Value) { Log.LogInfo((object)message); } } internal static void RaiseToAll(byte code, object[] data) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (!PhotonNetwork.InRoom) { RouteLocal(code, data); return; } RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)1 }; PhotonNetwork.RaiseEvent(code, (object)data, val, SendOptions.SendReliable); } internal static void RaiseToMaster(byte code, object[] data) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (!PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient) { RouteLocal(code, data); return; } RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; PhotonNetwork.RaiseEvent(code, (object)data, val, SendOptions.SendReliable); } internal static void RaiseToActor(byte code, object[] data, int actorNumber) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (!PhotonNetwork.InRoom || (PhotonNetwork.LocalPlayer != null && PhotonNetwork.LocalPlayer.ActorNumber == actorNumber)) { RouteLocal(code, data); return; } RaiseEventOptions val = new RaiseEventOptions(); val.TargetActors = new int[1] { actorNumber }; RaiseEventOptions val2 = val; PhotonNetwork.RaiseEvent(code, (object)data, val2, SendOptions.SendReliable); } private static void RouteLocal(byte code, object[] data) { AmongUsGame instance = AmongUsGame.Instance; if (!((Object)(object)instance == (Object)null)) { switch (code) { case 181: instance.ReceiveRole(data); break; case 182: instance.ReceiveKill(data); break; case 183: instance.ReceiveMeetingStart(data); break; case 184: instance.ReceiveVote(data); break; case 185: instance.ReceiveMeetingEnd(data); break; case 186: instance.ReceiveTaskDone(data); break; case 187: instance.ReceiveProgress(data); break; case 188: instance.ReceiveGameOver(data); break; case 189: instance.ReceiveGameBegin(data); break; } } } } internal sealed class AmongUsSettings { public readonly ConfigEntry ForceLevel; public readonly ConfigEntry MasterVolume; public readonly ConfigEntry VoidY; public readonly ConfigEntry FinishRadius; public readonly ConfigEntry FinishRewardMin; public readonly ConfigEntry FinishRewardMax; public readonly ConfigEntry DebugLogs; public readonly ConfigEntry SpawnX; public readonly ConfigEntry SpawnY; public readonly ConfigEntry SpawnZ; public readonly ConfigEntry SpawnYaw; public readonly ConfigEntry CaptureSpawnKey; public readonly ConfigEntry KillKey; public readonly ConfigEntry TaskStations; public readonly ConfigEntry TasksPerCrew; public readonly ConfigEntry ImposterCount; public Vector3 SpawnPosition => new Vector3(SpawnX.Value, SpawnY.Value, SpawnZ.Value); public Quaternion SpawnRotation => Quaternion.Euler(0f, SpawnYaw.Value, 0f); public AmongUsSettings(ConfigFile config) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Expected O, but got Unknown //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown DebugLogs = config.Bind("Debug", "DebugLogs", false, "Logs verbose Empress Among Us diagnostics. Off by default."); ForceLevel = config.Bind("Debug", "ForceLevel", false, "Forces every real run level to load Empress - The Skeld. Useful for testing."); MasterVolume = config.Bind("Audio", "MasterVolume", 0.2f, new ConfigDescription("Volume of the Skeld ambience.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); VoidY = config.Bind("Level", "VoidY", -60f, new ConfigDescription("Players below this Y position are returned to the spawn.", (AcceptableValueBase)(object)new AcceptableValueRange(-250f, 50f), Array.Empty())); FinishRadius = config.Bind("Level", "FinishRadius", 3.5f, new ConfigDescription("Distance from the emergency button needed to end the level.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 35f), Array.Empty())); FinishRewardMin = config.Bind("Reward", "FinishRewardMin", 30, new ConfigDescription("Minimum money in thousands awarded when the emergency button is reached.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 500), Array.Empty())); FinishRewardMax = config.Bind("Reward", "FinishRewardMax", 75, new ConfigDescription("Maximum money in thousands awarded when the emergency button is reached.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 500), Array.Empty())); SpawnX = config.Bind("Spawn", "SpawnX", 0f, "World X where players spawn. Stand where you want the start and press the capture key to set this."); SpawnY = config.Bind("Spawn", "SpawnY", -9999f, "World Y of the spawn point. Leave at -9999 to use the level's built in spawn."); SpawnZ = config.Bind("Spawn", "SpawnZ", 0f, "World Z of the spawn point."); SpawnYaw = config.Bind("Spawn", "SpawnYaw", 0f, new ConfigDescription("Facing of the spawn in degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(-180f, 180f), Array.Empty())); CaptureSpawnKey = config.Bind("Spawn", "CaptureSpawnKey", (KeyCode)289, "Press while standing in the level to set the spawn and respawn to your current position."); KillKey = config.Bind("Gameplay", "KillKey", (KeyCode)102, "Imposter kill key. Press near a crewmate to kill them."); TaskStations = config.Bind("Gameplay", "TaskStations", 5, new ConfigDescription("How many task stations spawn in the ship. Host only.", (AcceptableValueBase)(object)new AcceptableValueRange(3, 10), Array.Empty())); TasksPerCrew = config.Bind("Gameplay", "TasksPerCrew", 3, new ConfigDescription("How many tasks each crewmate is assigned. Host only.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 6), Array.Empty())); ImposterCount = config.Bind("Gameplay", "ImposterCount", 1, new ConfigDescription("How many imposters. Host only. Needs enough players.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 2), Array.Empty())); } } }