using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.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("EmpressHollow")] [assembly: AssemblyTitle("EmpressHollow")] [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.Hollow { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.empress.repo.hollow", "Empress Hollow", "1.0.0")] public sealed class EmpressHollowPlugin : BaseUnityPlugin { public const string PluginGuid = "com.empress.repo.hollow"; public const string PluginName = "Empress Hollow"; public const string PluginVersion = "1.0.0"; public const string LevelName = "Level - Empress Hollow"; public const string DisplayName = "Empress - The Hollow"; internal const byte StalkerSyncEventCode = 184; internal const byte GrabEventCode = 185; internal const byte ObserveEventCode = 186; internal const byte AmbientEventCode = 187; internal const byte NoteEventCode = 188; internal const byte CompletionEventCode = 189; private static bool _photonHooked; private Harmony _harmony; internal static EmpressHollowPlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static HollowSettings Settings { get; private set; } internal static Level HollowLevel { 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 HollowSettings(((BaseUnityPlugin)this).Config); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); HollowLevel = HollowLevelRegistry.RegisterLevel(); HollowAudio.Initialize(); _harmony = new Harmony("com.empress.repo.hollow"); _harmony.PatchAll(typeof(EmpressHollowPlugin).Assembly); HollowRuntime.EnsureHost(); ((MonoBehaviour)this).StartCoroutine(HollowAudio.LoadExternal()); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Empress Hollow v1.0.0 loaded. Level registered: Level - Empress Hollow"); } private void OnDestroy() { RemovePhotonHook(); } internal static bool IsHollowLevel(Level level) { if ((Object)(object)level != (Object)null) { return ((Object)level).name == "Level - Empress Hollow"; } 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) { if (ev.CustomData is object[] data) { Dispatch(ev.Code, data); } } private static void Dispatch(byte code, object[] data) { HollowRuntime instance = HollowRuntime.Instance; if (!((Object)(object)instance == (Object)null) && data != null) { switch (code) { case 184: instance.ReceiveStalkerSync(data); break; case 185: instance.ReceiveGrab(data); break; case 186: instance.ReceiveObserve(data); break; case 187: instance.ReceiveAmbient(data); break; case 188: instance.ReceiveNote(data); break; case 189: instance.ReceiveCompletion(data); break; } } } internal static void DebugLog(string message) { if (Settings != null && Settings.DebugLogs.Value) { Log.LogInfo((object)message); } } internal static void RaiseToOthers(byte code, object[] data, bool reliable = true) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0027: 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) EnsurePhotonHooked(); if (PhotonNetwork.InRoom) { RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent(code, (object)data, val, reliable ? SendOptions.SendReliable : SendOptions.SendUnreliable); } } internal static void RaiseToMaster(byte code, object[] data) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (PhotonNetwork.InRoom) { RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; PhotonNetwork.RaiseEvent(code, (object)data, val, SendOptions.SendUnreliable); } } 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) { Dispatch(code, data); return; } RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)1 }; PhotonNetwork.RaiseEvent(code, (object)data, val, SendOptions.SendReliable); } } internal sealed class HollowSettings { public readonly ConfigEntry ForceLevel; public readonly ConfigEntry TreeCount; public readonly ConfigEntry ForestRadius; public readonly ConfigEntry StalkerSpeed; public readonly ConfigEntry GrabRange; public readonly ConfigEntry MasterVolume; public readonly ConfigEntry DebugLogs; public HollowSettings(ConfigFile config) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown DebugLogs = config.Bind("Debug", "DebugLogs", false, "Logs verbose Empress Hollow diagnostics. Off by default."); ForceLevel = config.Bind("Debug", "ForceLevel", false, "Forces every real run level to load Empress - The Hollow. Useful for testing."); TreeCount = config.Bind("Forest", "TreeCount", 240, new ConfigDescription("How many trees fill the forest. Lower this if your machine struggles.", (AcceptableValueBase)(object)new AcceptableValueRange(40, 600), Array.Empty())); ForestRadius = config.Bind("Forest", "ForestRadius", 95f, new ConfigDescription("Radius of the forest in meters.", (AcceptableValueBase)(object)new AcceptableValueRange(40f, 200f), Array.Empty())); StalkerSpeed = config.Bind("Stalker", "Speed", 3.4f, new ConfigDescription("How fast the Stalker closes in while nobody is looking.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 8f), Array.Empty())); GrabRange = config.Bind("Stalker", "GrabRange", 2.6f, new ConfigDescription("Distance at which the Stalker can reach out and grab a player.", (AcceptableValueBase)(object)new AcceptableValueRange(1.5f, 5f), Array.Empty())); MasterVolume = config.Bind("Audio", "MasterVolume", 0.85f, new ConfigDescription("Volume of the forest ambience and Stalker sounds.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); } } internal static class HollowAccess { 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 PlayerAvatarTumbleField = AccessTools.Field(typeof(PlayerAvatar), "tumble"); 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 RoundDirectorHaulGoalField = AccessTools.Field(typeof(RoundDirector), "haulGoal"); private static readonly FieldInfo RoundDirectorHaulGoalMaxField = AccessTools.Field(typeof(RoundDirector), "haulGoalMax"); private static readonly FieldInfo RoundDirectorExtractionPointActiveField = AccessTools.Field(typeof(RoundDirector), "extractionPointActive"); private static readonly FieldInfo RoundDirectorAllExtractionCompletedField = AccessTools.Field(typeof(RoundDirector), "allExtractionPointsCompleted"); private static readonly FieldInfo ValuableDirectorTargetAmountField = AccessTools.Field(typeof(ValuableDirector), "valuableTargetAmount"); private static readonly FieldInfo ValuableDirectorTotalMaxValueField = AccessTools.Field(typeof(ValuableDirector), "totalMaxValue"); private static readonly FieldInfo LevelValuablesTinyField = AccessTools.Field(typeof(LevelValuables), "tiny"); private static readonly FieldInfo LevelValuablesSmallField = AccessTools.Field(typeof(LevelValuables), "small"); private static readonly FieldInfo LevelValuablesMediumField = AccessTools.Field(typeof(LevelValuables), "medium"); private static readonly FieldInfo LevelValuablesBigField = AccessTools.Field(typeof(LevelValuables), "big"); private static readonly FieldInfo LevelValuablesWideField = AccessTools.Field(typeof(LevelValuables), "wide"); private static readonly FieldInfo LevelValuablesTallField = AccessTools.Field(typeof(LevelValuables), "tall"); private static readonly FieldInfo LevelValuablesVeryTallField = AccessTools.Field(typeof(LevelValuables), "veryTall"); private static readonly FieldInfo LevelValuablePresetsField = AccessTools.Field(typeof(Level), "ValuablePresets"); 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 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 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 PlayerTumble GetPlayerTumble(PlayerAvatar avatar) { return Get(PlayerAvatarTumbleField, avatar); } public static int GetValuableTargetAmount(ValuableDirector director) { return GetInt(ValuableDirectorTargetAmountField, director); } public static float GetValuableTotalMaxValue(ValuableDirector director) { if (ValuableDirectorTotalMaxValueField == null || (Object)(object)director == (Object)null) { return 0f; } object value = ValuableDirectorTotalMaxValueField.GetValue(director); if (value is float) { return (float)value; } return 0f; } public static int GetHaulGoal(RoundDirector director) { return GetInt(RoundDirectorHaulGoalField, director); } public static int GetHaulGoalMax(RoundDirector director) { return GetInt(RoundDirectorHaulGoalMaxField, director); } public static void SetHaulGoal(RoundDirector director, int value) { SetField(RoundDirectorHaulGoalField, director, value); } public static bool GetExtractionPointActive(RoundDirector director) { return GetBool(RoundDirectorExtractionPointActiveField, director); } public static bool GetAllExtractionPointsCompleted(RoundDirector director) { return GetBool(RoundDirectorAllExtractionCompletedField, director); } public static void ResetRoundExtraction(RoundDirector director) { SetField(RoundDirectorExtractionPointsField, director, 0); SetField(RoundDirectorExtractionPointsCompletedField, director, 0); Get>(RoundDirectorExtractionPointListField, director)?.Clear(); } public static List GetValuablePresets(Level level) { return Get>(LevelValuablePresetsField, level); } public static List GetValuableList(LevelValuables valuables, Type type) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected I4, but got Unknown return Get>((int)type switch { 0 => LevelValuablesTinyField, 1 => LevelValuablesSmallField, 2 => LevelValuablesMediumField, 3 => LevelValuablesBigField, 4 => LevelValuablesWideField, 5 => LevelValuablesTallField, _ => LevelValuablesVeryTallField, }, valuables); } public static void SetValuablePresets(Level level, List presets) { SetField(LevelValuablePresetsField, level, presets); } public static bool PresetHasContent(LevelValuables preset) { if ((Object)(object)preset == (Object)null) { return false; } if (CountList(LevelValuablesTinyField, preset) <= 0 && CountList(LevelValuablesSmallField, preset) <= 0 && CountList(LevelValuablesMediumField, preset) <= 0 && CountList(LevelValuablesBigField, preset) <= 0 && CountList(LevelValuablesWideField, preset) <= 0 && CountList(LevelValuablesTallField, preset) <= 0) { return CountList(LevelValuablesVeryTallField, preset) > 0; } return true; } 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)); } private static int CountList(FieldInfo field, object instance) { if (!(((field != null && instance != null) ? field.GetValue(instance) : null) is ICollection collection)) { return 0; } return collection.Count; } 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 HollowAudio { private const int SampleRate = 44100; private static AudioClip _wind; private static AudioClip _static; private static AudioClip _grab; private static AudioClip _sink; private static AudioClip _creak; private static AudioClip _heartbeat; private static AudioClip _whisper; private static AudioClip _stalkerMove; private static AudioClip _complete; private static bool _initialized; public static AudioClip WindClip => _wind; public static AudioClip StaticClip => _static; public static AudioClip StalkerMoveClip => _stalkerMove; public static void Initialize() { if (!_initialized) { _initialized = true; _wind = BuildWind(); _static = BuildStatic(); _grab = BuildGrab(); _sink = BuildSink(); _creak = BuildCreak(); _heartbeat = BuildHeartbeat(); _whisper = BuildWhisper(); } } public static IEnumerator LoadExternal() { yield return LoadClip("hollow_wind.ogg", delegate(AudioClip clip) { _wind = clip; }); yield return LoadClip("hollow_static.ogg", delegate(AudioClip clip) { _static = clip; }); yield return LoadClip("hollow_stalker_move.ogg", delegate(AudioClip clip) { _stalkerMove = clip; }); yield return LoadClip("hollow_stalker_grab.ogg", delegate(AudioClip clip) { _grab = clip; }); yield return LoadClip("hollow_stalker_sink.ogg", delegate(AudioClip clip) { _sink = clip; }); yield return LoadClip("hollow_creak.ogg", delegate(AudioClip clip) { _creak = clip; }); yield return LoadClip("hollow_heartbeat.ogg", delegate(AudioClip clip) { _heartbeat = clip; }); yield return LoadClip("hollow_whisper.ogg", delegate(AudioClip clip) { _whisper = clip; }); yield return LoadClip("hollow_complete.ogg", delegate(AudioClip clip) { _complete = clip; }); HollowRuntime.Instance?.RefreshAudioClips(); } public static void PlayGrab(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_grab, position, 1f, 0.95f, 1.05f); } public static void PlaySink(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_sink, position, 0.85f, 0.9f, 1.05f); } public static void PlayCreak(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_creak, position, Random.Range(0.42f, 0.68f), 0.7f, 1.08f, 0.18f, 55f); } public static void PlayHeartbeat(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_heartbeat, position, 0.7f); } public static void PlayWhisper(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_whisper, position, Random.Range(0.3f, 0.52f), 0.76f, 1.22f, 0.22f, 46f); } public static void PlayComplete(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Play(_complete, position, 1f, 1f, 1f); } private static IEnumerator LoadClip(string fileName, Action assign) { string text = Path.Combine(EmpressHollowPlugin.PluginDirectory, fileName); if (!File.Exists(text)) { yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(new Uri(text).AbsoluteUri, (AudioType)14); try { yield return request.SendWebRequest(); if ((int)request.result != 1) { EmpressHollowPlugin.Log.LogWarning((object)("Empress Hollow could not load " + fileName + ": " + request.error)); yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content != (Object)null) { ((Object)content).name = "Empress Hollow " + Path.GetFileNameWithoutExtension(fileName); assign(content); } } finally { ((IDisposable)request)?.Dispose(); } } private static void Play(AudioClip clip, Vector3 position, float volume, float pitchMin = 0.97f, float pitchMax = 1.03f, float startVariation = 0f, float maxDistance = 38f) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown if ((Object)(object)clip == (Object)null) { return; } float num = ((EmpressHollowPlugin.Settings != null) ? EmpressHollowPlugin.Settings.MasterVolume.Value : 0.85f); if (!(num <= 0f)) { GameObject val = new GameObject("Empress Hollow Audio"); val.transform.position = position; AudioSource val2 = val.AddComponent(); val2.clip = clip; val2.volume = Mathf.Clamp01(volume * num); val2.pitch = Random.Range(pitchMin, pitchMax); val2.spatialBlend = 1f; val2.rolloffMode = (AudioRolloffMode)1; val2.minDistance = 2.5f; val2.maxDistance = maxDistance; val2.dopplerLevel = 0f; ApplyRepoMixer(val2); if (startVariation > 0f && clip.length > 0.25f) { val2.time = Random.Range(0f, Mathf.Min(clip.length * startVariation, clip.length - 0.2f)); } val2.Play(); Object.Destroy((Object)val, (clip.length - val2.time) / Mathf.Max(0.5f, val2.pitch) + 0.2f); } } public static void ApplyRepoMixer(AudioSource source) { if ((Object)(object)source != (Object)null && (Object)(object)AudioManager.instance != (Object)null) { source.outputAudioMixerGroup = AudioManager.instance.SoundMasterGroup; } } private static AudioClip MakeClip(string name, float[] data) { AudioClip obj = AudioClip.Create(name, data.Length, 1, 44100, false); obj.SetData(data, 0); return obj; } private static AudioClip BuildWind() { int num = 220500; int num2 = 17640; float[] array = new float[num + num2]; float num3 = 0f; float num4 = 0f; for (int i = 0; i < array.Length; i++) { float num5 = (float)i / 44100f; float num6 = Random.value * 2f - 1f; num3 = num3 * 0.96f + num6 * 0.04f; num4 = num4 * 0.9f + num3 * 0.1f; float num7 = 0.5f + 0.5f * Mathf.PerlinNoise(num5 * 0.3f, 0f); array[i] = num4 * num7 * 0.5f; } float[] array2 = new float[num]; Array.Copy(array, array2, num); for (int j = 0; j < num2; j++) { float num8 = (float)j / (float)num2; array2[j] = array2[j] * num8 + array[num + j] * (1f - num8); } return MakeClip("EmpressHollowWind", array2); } private static AudioClip BuildStatic() { int num = 88200; int num2 = 8820; float[] array = new float[num + num2]; for (int i = 0; i < array.Length; i++) { float num3 = (float)i / 44100f; float num4 = Random.value * 2f - 1f; float num5 = Mathf.Sin(MathF.PI * 6000f * num3) * 0.1f; float num6 = 0.6f + 0.4f * Mathf.PerlinNoise(num3 * 30f, 0f); array[i] = (num4 * 0.5f + num5) * num6 * 0.4f; } float[] array2 = new float[num]; Array.Copy(array, array2, num); for (int j = 0; j < num2; j++) { float num7 = (float)j / (float)num2; array2[j] = array2[j] * num7 + array[num + j] * (1f - num7); } return MakeClip("EmpressHollowStatic", array2); } private static AudioClip BuildGrab() { int num = 48510; float[] array = new float[num]; float num2 = 0f; float num3 = Random.Range(0f, 30f); for (int i = 0; i < num; i++) { float num4 = (float)i / 44100f; float num5 = num4 / 1.1f; float num6 = 60f + 240f * Mathf.Exp((0f - num5) * 4f); num2 += MathF.PI * 2f * num6 / 44100f; float num7 = (Random.value * 2f - 1f) * Mathf.Exp((0f - num4) / 0.05f); float num8 = (Mathf.PerlinNoise(num3, num4 * 30f) - 0.5f) * (1f - num5) * 1.4f; float num9 = Mathf.Sin(num2) * 0.5f; float num10 = ((num5 < 0.08f) ? (num5 / 0.08f) : Mathf.Exp((0f - (num5 - 0.08f)) * 3f)); array[i] = Mathf.Clamp((num7 * 0.6f + num8 + num9) * num10, -1f, 1f) * 0.85f; } return MakeClip("EmpressHollowGrab", array); } private static AudioClip BuildSink() { int num = 70560; float[] array = new float[num]; float num2 = Random.Range(0f, 25f); for (int i = 0; i < num; i++) { float num3 = (float)i / 44100f; float num4 = num3 / 1.6f; float num5 = 90f * Mathf.Exp((0f - num4) * 1.5f) + 22f; float num6 = Mathf.Sin(MathF.PI * 2f * num5 * num3); float num7 = (Mathf.PerlinNoise(num2, num3 * 45f) - 0.5f) * 0.8f; float num8 = Mathf.Sin(num4 * MathF.PI); array[i] = Mathf.Clamp((num6 * 0.5f + num7) * num8, -1f, 1f) * 0.6f; } return MakeClip("EmpressHollowSink", array); } private static AudioClip BuildCreak() { int num = 61740; float[] array = new float[num]; float num2 = 0f; float num3 = Random.Range(0f, 40f); for (int i = 0; i < num; i++) { float num4 = (float)i / 44100f; float num5 = num4 / 1.4f; float num6 = 110f + 60f * Mathf.Sin(num5 * 6f) + 30f * Mathf.PerlinNoise(num3, num4 * 4f); num2 += MathF.PI * 2f * num6 / 44100f; float num7 = Mathf.Sign(Mathf.Sin(num2)) * 0.3f + Mathf.Sin(num2) * 0.4f; float num8 = ((Mathf.PerlinNoise(num3 + 3f, num4 * 18f) > 0.55f) ? 1f : 0.3f); float num9 = Mathf.Sin(num5 * MathF.PI); array[i] = Mathf.Clamp(num7 * num8 * num9, -1f, 1f) * 0.4f; } return MakeClip("EmpressHollowCreak", array); } private static AudioClip BuildHeartbeat() { int num = 48510; float[] array = new float[num]; for (int i = 0; i < num; i++) { float num2 = (float)i / 44100f; float num3 = Mathf.Sin(MathF.PI * 110f * num2) * Mathf.Exp(0f - Mathf.Pow((num2 - 0.08f) / 0.05f, 2f)); float num4 = Mathf.Sin(MathF.PI * 100f * num2) * Mathf.Exp(0f - Mathf.Pow((num2 - 0.34f) / 0.06f, 2f)); array[i] = Mathf.Clamp(num3 + num4 * 0.8f, -1f, 1f) * 0.7f; } return MakeClip("EmpressHollowHeartbeat", array); } private static AudioClip BuildWhisper() { int num = 70560; float[] array = new float[num]; float num2 = Random.Range(0f, 50f); float num3 = 0f; for (int i = 0; i < num; i++) { float num4 = (float)i / 44100f; float num5 = num4 / 1.6f; float num6 = Random.value * 2f - 1f; num3 = num3 * 0.82f + num6 * 0.18f; float num7 = 1f + 0.6f * Mathf.Sin(MathF.PI * 9f * num4 + num2); float num8 = Mathf.Clamp01(Mathf.PerlinNoise(num2 + 9f, num4 * 6f) * 1.6f - 0.3f); float num9 = Mathf.Sin(num5 * MathF.PI); array[i] = Mathf.Clamp(num3 * num7 * num8 * num9, -1f, 1f) * 0.5f; } return MakeClip("EmpressHollowWhisper", array); } } internal sealed class HollowMap { public Transform Root; public Vector3 Center; public float Radius; public Vector3 PlayerStart; public readonly List SpawnPositions = new List(); public readonly List Waypoints = new List(); public readonly List NotePositions = new List(); public readonly List TreePositions = new List(); public Vector3 StalkerStart; public float Amplitude; public float ClearingRadius; public float SeedOffset; public float GroundHeight(float x, float z) { float num = (Mathf.PerlinNoise((x + SeedOffset) * 0.021f, (z + SeedOffset) * 0.021f) - 0.5f) * Amplitude; num += (Mathf.PerlinNoise((x + SeedOffset) * 0.07f, (z + SeedOffset) * 0.07f) - 0.5f) * Amplitude * 0.35f; float num2 = Mathf.Sqrt(x * x + z * z); float num3 = Mathf.SmoothStep(0f, 1f, (num2 - ClearingRadius) / Mathf.Max(1f, ClearingRadius * 0.85f)); return Mathf.Lerp(0f, num, num3); } public Vector3 OnGround(float x, float z, float lift) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, GroundHeight(x, z) + lift, z); } } internal static class HollowForest { public static HollowMap Build(Transform parent, int seed) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) HollowMaterials.EnsureCreated(); Random random = new Random(seed); HollowMap hollowMap = new HollowMap { Root = parent, Center = Vector3.zero, Radius = EmpressHollowPlugin.Settings.ForestRadius.Value, Amplitude = 5.5f, ClearingRadius = 13f, SeedOffset = random.Next(0, 9000) }; BuildGround(parent, hollowMap); BuildBoundary(parent, hollowMap); BuildSky(parent, hollowMap, random); BuildLights(parent); BuildTrees(parent, hollowMap, random); BuildRocks(parent, hollowMap, random); BuildCabins(parent, hollowMap, random); HollowScenery.Build(parent, hollowMap, random); BuildClearingProps(parent, hollowMap, random); BuildPlacements(hollowMap, random); return hollowMap; } private static void BuildGround(Transform parent, HollowMap map) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) float num = map.Radius + 55f; int num2 = Mathf.Clamp(Mathf.RoundToInt(num * 2f / 2.6f), 32, 130); float num3 = num * 2f / (float)num2; HollowMesh hollowMesh = new HollowMesh(); int num4 = num2 + 1; for (int i = 0; i <= num2; i++) { for (int j = 0; j <= num2; j++) { float num5 = 0f - num + (float)j * num3; float num6 = 0f - num + (float)i * num3; float num7 = map.GroundHeight(num5, num6); hollowMesh.AddVertex(new Vector3(num5, num7, num6), Vector3.up, new Vector2(num5 * 0.04f, num6 * 0.04f)); } } for (int k = 0; k < num2; k++) { for (int l = 0; l < num2; l++) { int num8 = k * num4 + l; int num9 = num8 + num4; hollowMesh.AddQuad(0, num8, num9, num9 + 1, num8 + 1); } } GameObject val = new GameObject("Empress Hollow Ground"); val.transform.SetParent(parent, false); val.layer = LayerMask.NameToLayer("Default"); Mesh val2 = hollowMesh.ToMesh("Empress Hollow Ground Mesh"); val2.RecalculateNormals(); val.AddComponent().sharedMesh = val2; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.DirtMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; val.AddComponent().sharedMesh = val2; val.AddComponent().Type = (Type)10; } private static void BuildBoundary(Transform parent, HollowMap map) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Boundary"); val.transform.SetParent(parent, false); float radius = map.Radius; float num = MathF.PI * 2f * radius / 48f * 1.25f; Vector3 val2 = default(Vector3); for (int i = 0; i < 48; i++) { float num2 = (float)i / 48f * MathF.PI * 2f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); GameObject val3 = new GameObject("Boundary"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = val2 * radius; val3.transform.localRotation = Quaternion.LookRotation(val2, Vector3.up); val3.layer = LayerMask.NameToLayer("Default"); BoxCollider obj = val3.AddComponent(); obj.center = new Vector3(0f, 40f, 0f); obj.size = new Vector3(num, 120f, 3f); } } private static void BuildSky(Transform parent, HollowMap map, Random random) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Sky"); val.transform.SetParent(parent, false); Vector3 val2 = new Vector3(0.32f, 0.82f, -0.48f); Vector3 normalized = ((Vector3)(ref val2)).normalized; GameObject val3 = new GameObject("Empress Hollow Moon"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = normalized * 38f; HollowMesh hollowMesh = new HollowMesh(); hollowMesh.Blob(0, Vector3.zero, new Vector3(5.5f, 5.5f, 5.5f), 12, 8, 0f, 1); val3.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Moon Mesh"); MeshRenderer obj = val3.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.MoonMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; GameObject val4 = new GameObject("Empress Hollow Stars"); val4.transform.SetParent(val.transform, false); HollowMesh hollowMesh2 = new HollowMesh(); int num = 40; Vector3 val5 = default(Vector3); for (int i = 0; i < num; i++) { float num2 = (float)random.NextDouble() * MathF.PI * 2f; float num3 = Mathf.Lerp(0.15f, 0.75f, (float)random.NextDouble()) * MathF.PI * 0.5f; float num4 = 34f; ((Vector3)(ref val5))..ctor(Mathf.Sin(num3) * Mathf.Cos(num2), Mathf.Cos(num3), Mathf.Sin(num3) * Mathf.Sin(num2)); float num5 = 0.12f + (float)random.NextDouble() * 0.18f; hollowMesh2.Blob(0, val5 * num4, new Vector3(num5, num5, num5), 4, 3, 0f, random.Next()); } val4.AddComponent().sharedMesh = hollowMesh2.ToMesh("Empress Hollow Stars Mesh"); MeshRenderer obj2 = val4.AddComponent(); ((Renderer)obj2).sharedMaterial = HollowMaterials.StarMaterial; ((Renderer)obj2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj2).receiveShadows = false; val.AddComponent(); } private static void BuildLights(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_002c: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00eb: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Moonlight"); val.transform.SetParent(parent, false); val.transform.rotation = Quaternion.Euler(48f, 28f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)1; obj.color = new Color(0.55f, 0.66f, 0.92f); obj.intensity = 0.48f; obj.shadows = (LightShadows)2; obj.shadowStrength = 0.38f; obj.shadowBias = 0.045f; obj.shadowNormalBias = 0.35f; obj.shadowNearPlane = 0.2f; GameObject val2 = new GameObject("Empress Hollow Fill"); val2.transform.SetParent(parent, false); val2.transform.rotation = Quaternion.Euler(-26f, 210f, 0f); Light obj2 = val2.AddComponent(); obj2.type = (LightType)1; obj2.color = new Color(0.16f, 0.2f, 0.32f); obj2.intensity = 0.22f; obj2.shadows = (LightShadows)0; } private static void BuildTrees(Transform parent, HollowMap map, Random random) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown TreePrototype[] prototypes = HollowTree.CreatePrototypes(8, random); GameObject val = new GameObject("Empress Hollow Trees"); val.transform.SetParent(parent, false); int num = Mathf.Clamp(Mathf.RoundToInt((float)EmpressHollowPlugin.Settings.TreeCount.Value * 2.5f), 120, 900); int num2 = 0; int num3 = 0; int num4 = num * 12; while (num2 < num && num3 < num4) { num3++; float num5 = (float)random.NextDouble() * MathF.PI * 2f; float num6 = Mathf.Lerp(map.ClearingRadius + 1.5f, map.Radius - 4f, Mathf.Sqrt((float)random.NextDouble())); float x = Mathf.Cos(num5) * num6; float z = Mathf.Sin(num5) * num6; if (!NearReserved(map, x, z, 5f)) { float scale = 0.8f + (float)random.NextDouble() * 0.6f; CreateTree(val.transform, map, random, prototypes, x, z, scale, physical: true); num2++; } } int num7 = Mathf.Clamp(Mathf.RoundToInt((float)EmpressHollowPlugin.Settings.TreeCount.Value * 1.5f), 180, 600); for (int i = 0; i < num7; i++) { float num8 = (float)random.NextDouble() * MathF.PI * 2f; float num9 = Mathf.Lerp(map.Radius + 5f, map.Radius + 50f, Mathf.Sqrt((float)random.NextDouble())); float x2 = Mathf.Cos(num8) * num9; float z2 = Mathf.Sin(num8) * num9; float scale2 = 0.9f + (float)random.NextDouble() * 0.8f; CreateTree(val.transform, map, random, prototypes, x2, z2, scale2, physical: false); } StaticBatchingUtility.Combine(val); } private static void CreateTree(Transform parent, HollowMap map, Random random, TreePrototype[] prototypes, float x, float z, float scale, bool physical) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_010c: 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) TreePrototype treePrototype = prototypes[random.Next(prototypes.Length)]; GameObject val = new GameObject("Tree"); val.transform.SetParent(parent, false); val.transform.localPosition = map.OnGround(x, z, -0.2f); val.transform.localRotation = Quaternion.Euler(0f, (float)random.NextDouble() * 360f, 0f); val.transform.localScale = Vector3.one * scale; val.layer = LayerMask.NameToLayer("Default"); val.AddComponent().sharedMesh = treePrototype.Mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterials = treePrototype.Materials; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)(physical ? 1 : 0); ((Renderer)obj).receiveShadows = true; if (physical) { CapsuleCollider obj2 = val.AddComponent(); obj2.radius = Mathf.Max(0.25f, treePrototype.Radius * 0.9f); obj2.height = treePrototype.Height; obj2.center = new Vector3(0f, treePrototype.Height * 0.5f, 0f); map.TreePositions.Add(val.transform.localPosition); } } private static void BuildRocks(Transform parent, HollowMap map, Random random) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002d: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //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_016f: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Rocks"); val.transform.SetParent(parent, false); Mesh[] array = (Mesh[])(object)new Mesh[8]; for (int i = 0; i < array.Length; i++) { HollowMesh hollowMesh = new HollowMesh(); hollowMesh.Blob(0, Vector3.zero, new Vector3(1f, 0.72f, 1.08f), 12, 7, 0.22f, random.Next()); array[i] = hollowMesh.ToMesh("Empress Hollow Rock " + i); } int num = 46; Vector3 val2 = default(Vector3); for (int j = 0; j < num; j++) { float num2 = (float)random.NextDouble() * MathF.PI * 2f; float num3 = Mathf.Lerp(map.ClearingRadius + 2f, map.Radius, (float)random.NextDouble()); float x = Mathf.Cos(num2) * num3; float z = Mathf.Sin(num2) * num3; if (!NearReserved(map, x, z, 3f)) { float num4 = 0.5f + (float)random.NextDouble() * 1.8f; ((Vector3)(ref val2))..ctor(num4 * Range(random, 0.82f, 1.28f), num4 * Range(random, 0.72f, 1.08f), num4 * Range(random, 0.84f, 1.32f)); GameObject val3 = new GameObject("Rock"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = map.OnGround(x, z, val2.y * 0.48f); val3.transform.localRotation = Quaternion.Euler(Range(random, -9f, 9f), Range(random, 0f, 360f), Range(random, -9f, 9f)); val3.transform.localScale = val2; val3.layer = LayerMask.NameToLayer("Default"); Mesh sharedMesh = array[random.Next(array.Length)]; val3.AddComponent().sharedMesh = sharedMesh; MeshRenderer obj = val3.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.RockMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)obj).receiveShadows = true; MeshCollider obj2 = val3.AddComponent(); obj2.sharedMesh = sharedMesh; obj2.convex = true; } } } private static void BuildCabins(Transform parent, HollowMap map, Random random) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Cabins"); val.transform.SetParent(parent, false); int num = 3; for (int i = 0; i < num; i++) { float num2 = (float)random.NextDouble() * MathF.PI * 2f; float num3 = Mathf.Lerp(map.Radius * 0.4f, map.Radius * 0.85f, (float)random.NextDouble()); float num4 = Mathf.Cos(num2) * num3; float num5 = Mathf.Sin(num2) * num3; BuildCabin(val.transform, map, new Vector3(num4, 0f, num5), (float)random.NextDouble() * 360f, random); } } private static void BuildCabin(Transform parent, HollowMap map, Vector3 spot, float yaw, Random random) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //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_00f2: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0223: 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_024b: 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_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Cabin"); val.transform.SetParent(parent, false); val.layer = LayerMask.NameToLayer("Default"); float num = 6f + (float)random.NextDouble() * 3f; float num2 = 5f + (float)random.NextDouble() * 3f; float num3 = 3.4f; float num4 = 0.3f; Quaternion val2 = Quaternion.Euler(0f, yaw, 0f); float num5 = float.MaxValue; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { Vector3 val3 = val2 * new Vector3(num * 0.5f * (float)i, 0f, num2 * 0.5f * (float)j); num5 = Mathf.Min(num5, map.GroundHeight(spot.x + val3.x, spot.z + val3.z)); } } val.transform.localPosition = new Vector3(spot.x, num5 - 0.2f, spot.z); val.transform.localRotation = val2; HollowMesh hollowMesh = new HollowMesh(); hollowMesh.Box(0, new Vector3(0f, num3 * 0.5f, num2 * 0.5f), new Vector3(num, num3, num4), Quaternion.identity, 3f); hollowMesh.Box(0, new Vector3((0f - num) * 0.5f, num3 * 0.5f, 0f), new Vector3(num4, num3, num2), Quaternion.identity, 3f); hollowMesh.Box(0, new Vector3(num * 0.5f, num3 * 0.5f, 0f), new Vector3(num4, num3, num2), Quaternion.identity, 3f); hollowMesh.Box(0, new Vector3((0f - num) * 0.3f, num3 * 0.5f, (0f - num2) * 0.5f), new Vector3(num * 0.4f, num3, num4), Quaternion.identity, 3f); hollowMesh.Box(0, new Vector3(num * 0.32f, num3 * 0.5f, (0f - num2) * 0.5f), new Vector3(num * 0.36f, num3, num4), Quaternion.identity, 3f); hollowMesh.Box(1, new Vector3(0f, num3 + 0.25f, 0f), new Vector3(num + 0.6f, 0.5f, num2 + 0.6f), Quaternion.Euler(8f, 0f, 0f), 3f); GameObject val4 = new GameObject("Walls"); val4.transform.SetParent(val.transform, false); val4.layer = LayerMask.NameToLayer("Default"); Mesh sharedMesh = hollowMesh.ToMesh("Empress Hollow Cabin Mesh"); val4.AddComponent().sharedMesh = sharedMesh; MeshRenderer val5 = val4.AddComponent(); ((Renderer)val5).sharedMaterials = (Material[])(object)new Material[2] { HollowMaterials.PlankMaterial, HollowMaterials.PlankMaterial }; ((Renderer)val5).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)val5).receiveShadows = true; AddWallCollider(val.transform, new Vector3(0f, num3 * 0.5f, num2 * 0.5f), new Vector3(num, num3, num4)); AddWallCollider(val.transform, new Vector3((0f - num) * 0.5f, num3 * 0.5f, 0f), new Vector3(num4, num3, num2)); AddWallCollider(val.transform, new Vector3(num * 0.5f, num3 * 0.5f, 0f), new Vector3(num4, num3, num2)); } private static void AddWallCollider(Transform parent, Vector3 center, Vector3 size) { //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) //IL_0023: 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) GameObject val = new GameObject("Wall"); val.transform.SetParent(parent, false); val.transform.localPosition = center; val.layer = LayerMask.NameToLayer("Default"); val.AddComponent().size = size; } private static void BuildClearingProps(Transform parent, HollowMap map, Random random) { //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_002d: 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_0053: 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) GameObject val = new GameObject("Empress Hollow Stump"); val.transform.SetParent(parent, false); val.transform.localPosition = map.OnGround(3.4f, -2.6f, 0f); HollowMesh hollowMesh = new HollowMesh(); hollowMesh.Tube(0, Vector3.zero, new Vector3(0f, 0.9f, 0f), 0.6f, 0.5f, 8, 0f, 1f); val.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Stump Mesh"); MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.BarkMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)obj).receiveShadows = true; } private static void BuildPlacements(HollowMap map, Random random) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) map.PlayerStart = map.OnGround(0f, -4f, 1.3f); for (int i = 0; i < 6; i++) { float num = (float)i / 6f * MathF.PI * 2f; float num2 = 4f + (float)random.NextDouble() * 5f; map.SpawnPositions.Add(map.OnGround(Mathf.Cos(num) * num2, Mathf.Sin(num) * num2 - 2f, 1.3f)); } int num3 = 3; for (int j = 0; j < num3; j++) { float num4 = Mathf.Lerp(map.ClearingRadius + 8f, map.Radius - 6f, (float)j / (float)(num3 - 1)); int num5 = 8 + j * 4; for (int k = 0; k < num5; k++) { float num6 = (float)k / (float)num5 * MathF.PI * 2f + (float)j * 0.4f; float num7 = (float)random.NextDouble() * 6f - 3f; float x = Mathf.Cos(num6) * (num4 + num7); float z = Mathf.Sin(num6) * (num4 + num7); map.Waypoints.Add(map.OnGround(x, z, 0f)); } } float num8 = (float)random.NextDouble() * MathF.PI * 2f; float x2 = Mathf.Cos(num8) * map.Radius * 0.7f; float z2 = Mathf.Sin(num8) * map.Radius * 0.7f; map.StalkerStart = map.OnGround(x2, z2, 0f); int num9 = 8; for (int l = 0; l < num9; l++) { float num10 = (float)l / (float)num9 * MathF.PI * 2f + (float)random.NextDouble() * 0.5f; float num11 = Mathf.Lerp(map.ClearingRadius + 6f, map.Radius - 6f, (float)random.NextDouble()); float x3 = Mathf.Cos(num10) * num11; float z3 = Mathf.Sin(num10) * num11; map.NotePositions.Add(map.OnGround(x3, z3, 0f)); } } private static bool NearReserved(HollowMap map, float x, float z, float pad) { if (x * x + z * z < (map.ClearingRadius + pad) * (map.ClearingRadius + pad)) { return true; } return false; } private static float Range(Random random, float min, float max) { return min + (float)random.NextDouble() * (max - min); } } internal static class HollowNote { public static GameObject Create(Transform parent, Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Note"); val.transform.SetParent(parent, false); val.transform.localPosition = position; val.transform.localRotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); GameObject val2 = new GameObject("Post"); val2.transform.SetParent(val.transform, false); HollowMesh hollowMesh = new HollowMesh(); hollowMesh.Tube(0, Vector3.zero, new Vector3(0f, 1.2f, 0f), 0.05f, 0.04f, 5, 0f, 1f); val2.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Note Post"); MeshRenderer obj = val2.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.BarkDarkMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; GameObject obj2 = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)obj2.GetComponent()); ((Object)obj2).name = "Paper"; obj2.transform.SetParent(val.transform, false); obj2.transform.localPosition = new Vector3(0f, 1.15f, 0f); obj2.transform.localScale = new Vector3(0.4f, 0.52f, 0.04f); MeshRenderer component = obj2.GetComponent(); ((Renderer)component).sharedMaterial = HollowMaterials.NoteMaterial; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; GameObject val3 = new GameObject("Glow"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, 1.15f, 0f); Light obj3 = val3.AddComponent(); obj3.type = (LightType)2; obj3.color = new Color(1f, 0.92f, 0.7f); obj3.intensity = 1.6f; obj3.range = 6f; obj3.shadows = (LightShadows)0; return val; } } internal sealed class HollowSkyFollow : MonoBehaviour { private void LateUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if ((Object)(object)main != (Object)null) { ((Component)this).transform.position = ((Component)main).transform.position; } } } internal static class HollowLevelRegistry { 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 Hollow"; val.NarrativeName = "Empress - The Hollow"; LevelValuables val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "Valuables - Empress Hollow"; 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.045f, 0.055f, 0.08f)); SetLevelField(val, "FogStartDistance", 7f); SetLevelField(val, "FogEndDistance", 58f); SetLevelField(val, "AmbientColor", (object)new Color(0.17f, 0.2f, 0.27f)); SetLevelField(val, "AmbientColorAdaptation", (object)new Color(0.06f, 0.07f, 0.1f)); SetLevelField(val, "ColorTemperature", -8f); SetLevelField(val, "ColorFilter", (object)new Color(0.72f, 0.82f, 1f, 1f)); SetLevelField(val, "BloomIntensity", 1.1f); SetLevelField(val, "BloomThreshold", 0.95f); SetLevelField(val, "VignetteColor", (object)new Color(0f, 0f, 0f, 1f)); SetLevelField(val, "VignetteIntensity", 0.42f); SetLevelField(val, "VignetteSmoothness", 0.85f); 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 Hollow 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; } public static void BorrowValuablePool(Level targetLevel) { if ((Object)(object)targetLevel == (Object)null || (Object)(object)RunManager.instance == (Object)null) { return; } List valuablePresets = HollowAccess.GetValuablePresets(targetLevel); if (valuablePresets != null && PoolHasContent(valuablePresets)) { return; } List levels = RunManager.instance.levels; if (levels == null) { return; } for (int i = 0; i < levels.Count; i++) { Level val = levels[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)targetLevel)) { List valuablePresets2 = HollowAccess.GetValuablePresets(val); if (valuablePresets2 != null && PoolHasContent(valuablePresets2)) { HollowAccess.SetValuablePresets(targetLevel, new List(valuablePresets2)); break; } } } } private static bool PoolHasContent(List presets) { for (int i = 0; i < presets.Count; i++) { if (HollowAccess.PresetHasContent(presets[i])) { return true; } } return false; } public static List FindValuablePool() { List valuablePresets = HollowAccess.GetValuablePresets(EmpressHollowPlugin.HollowLevel); if (valuablePresets != null && PoolHasContent(valuablePresets)) { return valuablePresets; } List list = new List(); LevelValuables[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && HollowAccess.PresetHasContent(array[i]) && !list.Contains(array[i])) { list.Add(array[i]); } } return list; } public static PrefabRef FindExtractionPrefab() { Level[] array = Resources.FindObjectsOfTypeAll(); foreach (Level val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)EmpressHollowPlugin.HollowLevel)) { PrefabRef val2 = FirstValid(val.ModulesExtraction1) ?? FirstValid(val.ModulesExtraction2) ?? FirstValid(val.ModulesExtraction3); if (val2 != null) { return val2; } } } return null; } private static PrefabRef FirstValid(List refs) { if (refs == null) { return null; } for (int i = 0; i < refs.Count; i++) { if (refs[i] != null && refs[i].IsValid()) { return refs[i]; } } return null; } 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 HollowLoadingScreen : MonoBehaviour { private static readonly Color Cold = new Color(0.28f, 0.55f, 0.65f, 0.42f); private static readonly Color Pale = new Color(0.72f, 0.86f, 0.9f, 0.5f); private static readonly Color Bruise = new Color(0.38f, 0.12f, 0.2f, 0.38f); private static bool _active; private static float _muteUntil; private readonly List _bands = new List(); private GameObject _root; private RawImage _forest; private Image _vignette; private RectTransform _eyeRoot; private Image _leftEye; private Image _rightEye; private AudioSource _staticAudio; private float _time; private float _glitchTimer; private float _eyeTimer; private uint _state = 2654435769u; public static void Show(LoadingUI loadingUI) { if (!((Object)(object)loadingUI == (Object)null)) { HollowLoadingScreen hollowLoadingScreen = ((Component)loadingUI).GetComponent(); if ((Object)(object)hollowLoadingScreen == (Object)null) { hollowLoadingScreen = ((Component)loadingUI).gameObject.AddComponent(); } hollowLoadingScreen.ShowInternal(loadingUI); } } public static void Hide(LoadingUI loadingUI) { if (!((Object)(object)loadingUI == (Object)null)) { HollowLoadingScreen component = ((Component)loadingUI).GetComponent(); if ((Object)(object)component != (Object)null) { component.HideInternal(); } } } public static bool OwnsCurrentLoading() { if (_active || Time.realtimeSinceStartup < _muteUntil) { return true; } Level val = null; if (Object.op_Implicit((Object)(object)LevelGenerator.Instance)) { val = LevelGenerator.Instance.Level; } if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)RunManager.instance)) { val = RunManager.instance.levelCurrent; } return EmpressHollowPlugin.IsHollowLevel(val); } private void ShowInternal(LoadingUI loadingUI) { EnsureBuilt(((Component)loadingUI).transform); ClearGraphic(loadingUI.loadingGraphic01); ClearGraphic(loadingUI.loadingGraphic02); ClearGraphic(loadingUI.loadingGraphic03); _time = 0f; _glitchTimer = 0f; _eyeTimer = 0f; _active = true; _muteUntil = Time.realtimeSinceStartup + 18f; _root.SetActive(true); _root.transform.SetAsLastSibling(); BringToFront(((Object)(object)loadingUI.levelNumberText != (Object)null) ? ((TMP_Text)loadingUI.levelNumberText).transform : null); BringToFront(((Object)(object)loadingUI.levelNameText != (Object)null) ? ((TMP_Text)loadingUI.levelNameText).transform : null); BringToFront((Transform)(object)loadingUI.stuckTransform); StartStatic(); } private void HideInternal() { _active = false; _muteUntil = Time.realtimeSinceStartup + 1.5f; if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } if ((Object)(object)_staticAudio != (Object)null) { _staticAudio.Stop(); } } private void Update() { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null || !_root.activeSelf) { return; } if (!OwnsCurrentLoading()) { HideInternal(); return; } _time += Time.unscaledDeltaTime; _glitchTimer -= Time.unscaledDeltaTime; _eyeTimer -= Time.unscaledDeltaTime; if (_glitchTimer <= 0f) { Burst(); _glitchTimer = Mathf.Lerp(0.055f, 0.24f, Next01()); } if (_eyeTimer <= 0f) { MoveEyes(); _eyeTimer = Mathf.Lerp(0.3f, 1.4f, Next01()); } float num = 0.5f + Mathf.Sin(_time * 0.85f) * 0.5f; ((Graphic)_forest).color = Color.Lerp(new Color(0.82f, 0.86f, 0.9f, 1f), new Color(0.58f, 0.7f, 0.72f, 1f), num * 0.22f); ((Graphic)_forest).rectTransform.anchoredPosition = new Vector2(Mathf.Sin(_time * 0.7f) * 2f, Mathf.Sin(_time * 0.43f) * 1.5f); ((Graphic)_vignette).color = new Color(1f, 1f, 1f, 0.88f + num * 0.08f); float num2 = Mathf.Pow(Mathf.Clamp01(Mathf.Sin(_time * 2.1f + 0.7f)), 9f); Color color = default(Color); ((Color)(ref color))..ctor(0.75f, 0.93f, 1f, 0.18f + num2 * 0.82f); ((Graphic)_leftEye).color = color; ((Graphic)_rightEye).color = color; if ((Object)(object)_staticAudio != (Object)null) { if (!_staticAudio.isPlaying && (Object)(object)HollowAudio.StaticClip != (Object)null) { StartStatic(); } float num3 = ((EmpressHollowPlugin.Settings != null) ? EmpressHollowPlugin.Settings.MasterVolume.Value : 0.85f); _staticAudio.volume = num3 * Mathf.Lerp(0.025f, 0.085f, num2); } } private void Burst() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) int num = 2 + Mathf.FloorToInt(Next01() * (float)(_bands.Count - 1)); for (int i = 0; i < _bands.Count; i++) { RawImage val = _bands[i]; bool flag = i < num; ((Component)val).gameObject.SetActive(flag); if (flag) { float num2 = Mathf.Lerp(0.06f, 0.94f, Next01()); float num3 = Mathf.Lerp(6f, 58f, Next01() * Next01()); RectTransform rectTransform = ((Graphic)val).rectTransform; rectTransform.anchorMin = new Vector2(0f, num2); rectTransform.anchorMax = new Vector2(1f, num2); rectTransform.sizeDelta = new Vector2(0f, num3); rectTransform.anchoredPosition = new Vector2(Mathf.Lerp(-95f, 95f, Next01()), 0f); val.uvRect = new Rect(Mathf.Lerp(-0.08f, 0.08f, Next01()), Mathf.Clamp01(num2 - num3 / 2160f), 1f, Mathf.Max(0.008f, num3 / 1080f)); float num4 = Next01(); ((Graphic)val).color = ((num4 < 0.45f) ? Cold : ((num4 < 0.82f) ? Pale : Bruise)); } } } private void MoveEyes() { //IL_0010: 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_0064: 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) _eyeRoot.anchorMin = new Vector2(0.5f, 0.5f); _eyeRoot.anchorMax = new Vector2(0.5f, 0.5f); _eyeRoot.anchoredPosition = new Vector2(Mathf.Lerp(-430f, 430f, Next01()), Mathf.Lerp(-80f, 190f, Next01())); float num = Mathf.Lerp(0.55f, 1.2f, Next01()); ((Transform)_eyeRoot).localScale = new Vector3(num, num, 1f); } private void EnsureBuilt(Transform parent) { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root != (Object)null)) { Texture2D texture = CreateForestTexture(); _root = CreateObject("Empress Hollow Loading", parent); Stretch(_root.GetComponent()); GameObject val = CreateObject("Empress Hollow Loading Forest", _root.transform); Stretch(val.GetComponent()); _forest = val.AddComponent(); ((Graphic)_forest).raycastTarget = false; _forest.texture = (Texture)(object)texture; for (int i = 0; i < 14; i++) { RawImage val2 = CreateObject("Empress Hollow Loading Fracture", _root.transform).AddComponent(); ((Graphic)val2).raycastTarget = false; val2.texture = (Texture)(object)texture; ((Component)val2).gameObject.SetActive(false); _bands.Add(val2); } GameObject val3 = CreateObject("Empress Hollow Loading Eyes", _root.transform); _eyeRoot = val3.GetComponent(); _eyeRoot.sizeDelta = new Vector2(92f, 28f); Sprite sprite = CreateCircleSprite(64, 0.56f); _leftEye = CreateImage("Empress Hollow Loading Left Eye", val3.transform, Color.clear); _rightEye = CreateImage("Empress Hollow Loading Right Eye", val3.transform, Color.clear); _leftEye.sprite = sprite; _rightEye.sprite = sprite; SetEye(((Graphic)_leftEye).rectTransform, -23f); SetEye(((Graphic)_rightEye).rectTransform, 23f); GameObject val4 = CreateObject("Empress Hollow Loading Vignette", _root.transform); Stretch(val4.GetComponent()); _vignette = val4.AddComponent(); ((Graphic)_vignette).raycastTarget = false; _vignette.sprite = CreateVignetteSprite(); _staticAudio = _root.AddComponent(); _staticAudio.loop = true; _staticAudio.playOnAwake = false; _staticAudio.spatialBlend = 0f; HollowAudio.ApplyRepoMixer(_staticAudio); _root.SetActive(false); } } private void StartStatic() { if (!((Object)(object)_staticAudio == (Object)null) && !((Object)(object)HollowAudio.StaticClip == (Object)null)) { HollowAudio.ApplyRepoMixer(_staticAudio); if ((Object)(object)_staticAudio.clip != (Object)(object)HollowAudio.StaticClip) { _staticAudio.Stop(); _staticAudio.clip = HollowAudio.StaticClip; } if (!_staticAudio.isPlaying) { _staticAudio.Play(); } } } private void BringToFront(Transform target) { if (!((Object)(object)target == (Object)null) && !((Object)(object)_root == (Object)null)) { Transform parent = _root.transform.parent; Transform val = target; while ((Object)(object)val.parent != (Object)null && (Object)(object)val.parent != (Object)(object)parent) { val = val.parent; } if ((Object)(object)val.parent == (Object)(object)parent) { val.SetAsLastSibling(); } target.SetAsLastSibling(); } } private float Next01() { _state ^= _state << 13; _state ^= _state >> 17; _state ^= _state << 5; return (float)(_state & 0xFFFFFF) / 16777215f; } private static Texture2D CreateForestTexture() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //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_00f0: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) Color[] array = (Color[])(object)new Color[131072]; Random random = new Random(7349); for (int i = 0; i < 256; i++) { float num = (float)i / 255f; Color val = Color.Lerp(new Color(0.008f, 0.012f, 0.018f), new Color(0.04f, 0.07f, 0.085f), num); for (int j = 0; j < 512; j++) { float num2 = (float)((j * 37 + i * 71) & 0x1F) / 31f; array[i * 512 + j] = val * Mathf.Lerp(0.88f, 1.08f, num2); } } DrawMoon(array, 512, 256, 384, 194, 18); DrawForestLayer(array, 512, 256, random, 34, new Color(0.025f, 0.04f, 0.045f), 46, 188, 1, 4); DrawForestLayer(array, 512, 256, random, 24, new Color(0.006f, 0.009f, 0.011f), 72, 232, 3, 8); Texture2D val2 = new Texture2D(512, 256, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; val2.SetPixels(array); val2.Apply(false, true); return val2; } private static void DrawForestLayer(Color[] pixels, int width, int height, Random random, int count, Color color, int minHeight, int maxHeight, int minWidth, int maxWidth) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < count; i++) { int num = random.Next(-18, width + 18); int num2 = random.Next(minHeight, maxHeight); int num3 = random.Next(minWidth, maxWidth + 1); int num4 = random.Next(-9, 10); DrawLine(pixels, width, height, num, -8, num + num4, num2, num3, color); int num5 = random.Next(2, 6); for (int j = 0; j < num5; j++) { float num6 = Mathf.Lerp(0.38f, 0.88f, (float)random.NextDouble()); int num7 = Mathf.RoundToInt(Mathf.Lerp((float)num, (float)(num + num4), num6)); int num8 = Mathf.RoundToInt((float)num2 * num6); int num9 = ((random.Next(0, 2) != 0) ? 1 : (-1)); int num10 = random.Next(12, 42); DrawLine(pixels, width, height, num7, num8, num7 + num10 * num9, num8 + random.Next(5, 28), Mathf.Max(1, num3 / 3), color); } } } private static void DrawMoon(Color[] pixels, int width, int height, int cx, int cy, int radius) { //IL_0028: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) int num = radius * 4; for (int i = Mathf.Max(0, cy - num); i < Mathf.Min(height, cy + num); i++) { for (int j = Mathf.Max(0, cx - num); j < Mathf.Min(width, cx + num); j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), new Vector2((float)cx, (float)cy)); float num3 = Mathf.Clamp01(1f - num2 / (float)num); Color val = ((num2 <= (float)radius) ? new Color(0.55f, 0.68f, 0.72f) : new Color(0.16f, 0.23f, 0.26f)); pixels[i * width + j] = Color.Lerp(pixels[i * width + j], val, num3 * num3 * ((num2 <= (float)radius) ? 0.9f : 0.35f)); } } } private static void DrawLine(Color[] pixels, int width, int height, int x0, int y0, int x1, int y1, int radius, Color color) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Max(Mathf.Abs(x1 - x0), Mathf.Abs(y1 - y0)); for (int i = 0; i <= num; i++) { float num2 = ((num == 0) ? 0f : ((float)i / (float)num)); int num3 = Mathf.RoundToInt(Mathf.Lerp((float)x0, (float)x1, num2)); int num4 = Mathf.RoundToInt(Mathf.Lerp((float)y0, (float)y1, num2)); for (int j = num4 - radius; j <= num4 + radius; j++) { if (j < 0 || j >= height) { continue; } for (int k = num3 - radius; k <= num3 + radius; k++) { if (k >= 0 && k < width) { pixels[j * width + k] = color; } } } } } private static Sprite CreateCircleSprite(int size, float edge) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); Vector2 val2 = Vector2.one * (float)(size - 1) * 0.5f; float num = (float)size * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val2) / num; float num3 = 1f - Mathf.SmoothStep(edge, 1f, num2); val.SetPixel(j, i, new Color(1f, 1f, 1f, num3)); } } val.Apply(false, true); return Sprite.Create(val, new Rect(0f, 0f, (float)size, (float)size), new Vector2(0.5f, 0.5f), 100f); } private static Sprite CreateVignetteSprite() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0012: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0096: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(192, 192, (TextureFormat)4, false); Vector2 val2 = Vector2.one * 191f * 0.5f; float num = 96f; for (int i = 0; i < 192; i++) { for (int j = 0; j < 192; j++) { Vector2 val3 = new Vector2((float)j, (float)i) - val2; val3.x *= 0.72f; float num2 = ((Vector2)(ref val3)).magnitude / num; float num3 = Mathf.SmoothStep(0.32f, 1f, num2) * 0.94f; val.SetPixel(j, i, new Color(0f, 0f, 0f, num3)); } } val.Apply(false, true); return Sprite.Create(val, new Rect(0f, 0f, 192f, 192f), new Vector2(0.5f, 0.5f), 100f); } private static GameObject CreateObject(string name, Transform parent) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown GameObject val = new GameObject(name, new Type[2] { typeof(RectTransform), typeof(CanvasRenderer) }); val.transform.SetParent(parent, false); return val; } private static Image CreateImage(string name, Transform parent, Color color) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Image obj = CreateObject(name, parent).AddComponent(); ((Graphic)obj).raycastTarget = false; ((Graphic)obj).color = color; return obj; } private static void Stretch(RectTransform rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0037: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; rect.offsetMin = Vector2.zero; rect.offsetMax = Vector2.zero; rect.pivot = new Vector2(0.5f, 0.5f); } private static void SetEye(RectTransform rect, float x) { //IL_000b: 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_0035: 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_005b: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMax = new Vector2(0.5f, 0.5f); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchoredPosition = new Vector2(x, 0f); rect.sizeDelta = new Vector2(22f, 12f); } private static void ClearGraphic(Image image) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)image == (Object)null)) { image.sprite = null; ((Graphic)image).color = Color.clear; } } } internal static class HollowMaterials { private static int _seed = 9931; public static Material BarkMaterial { get; private set; } public static Material BarkDarkMaterial { get; private set; } public static Material FoliageMaterial { get; private set; } public static Material FoliageDeadMaterial { get; private set; } public static Material DirtMaterial { get; private set; } public static Material PathMaterial { get; private set; } public static Material RockMaterial { get; private set; } public static Material PlankMaterial { get; private set; } public static Material StoneMaterial { get; private set; } public static Material MoonMaterial { get; private set; } public static Material StarMaterial { get; private set; } public static Material EyeMaterial { get; private set; } public static Material NoteMaterial { get; private set; } public static Material MossMaterial { get; private set; } public static Material FernMaterial { get; private set; } public static Material FungusStemMaterial { get; private set; } public static Material FungusCapMaterial { get; private set; } public static void EnsureCreated() { //IL_001d: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0374: 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_03ba: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)BarkMaterial != (Object)null)) { BarkMaterial = Opaque(Bark(new Color(0.2f, 0.16f, 0.12f), new Color(0.1f, 0.08f, 0.06f)), 0f, 0.12f); BarkDarkMaterial = Opaque(Bark(new Color(0.11f, 0.1f, 0.1f), new Color(0.04f, 0.04f, 0.05f)), 0f, 0.16f); FoliageMaterial = Opaque(Foliage(new Color(0.09f, 0.16f, 0.09f), new Color(0.04f, 0.09f, 0.05f)), 0f, 0.06f); FoliageDeadMaterial = Opaque(Foliage(new Color(0.13f, 0.12f, 0.07f), new Color(0.06f, 0.05f, 0.03f)), 0f, 0.05f); DirtMaterial = Opaque(Dirt(new Color(0.24f, 0.15f, 0.08f), out var normal), 0f, 0.05f, normal, 0.85f); PathMaterial = Opaque(Dirt(new Color(0.2f, 0.17f, 0.13f), out var normal2), 0f, 0.08f, normal2, 0.65f); RockMaterial = Opaque(Rock(new Color(0.2f, 0.21f, 0.23f), out var normal3), 0.04f, 0.18f, normal3, 1.2f); PlankMaterial = Opaque(Planks(new Color(0.18f, 0.14f, 0.1f), new Color(0.1f, 0.08f, 0.06f)), 0f, 0.12f); StoneMaterial = Opaque(Rock(new Color(0.16f, 0.16f, 0.17f), out var normal4), 0.02f, 0.1f, normal4); MossMaterial = Opaque(Foliage(new Color(0.1f, 0.16f, 0.08f), new Color(0.035f, 0.065f, 0.03f)), 0f, 0.02f); FernMaterial = Opaque(Foliage(new Color(0.08f, 0.19f, 0.09f), new Color(0.025f, 0.07f, 0.03f)), 0f, 0.03f); FungusStemMaterial = OpaqueColor(new Color(0.42f, 0.38f, 0.3f), 0f, 0.08f); FungusCapMaterial = Opaque(Foliage(new Color(0.25f, 0.12f, 0.09f), new Color(0.08f, 0.035f, 0.025f)), 0f, 0.12f); MoonMaterial = Emissive(new Color(0.82f, 0.9f, 1f), 9f); StarMaterial = Emissive(new Color(0.78f, 0.85f, 1f), 6f); EyeMaterial = Emissive(new Color(0.85f, 0.95f, 1f), 5.5f); NoteMaterial = Emissive(new Color(1f, 0.94f, 0.78f), 3.2f); } } private static Shader SafeShader() { Shader val = Shader.Find("Standard"); if (!((Object)(object)val != (Object)null)) { return Shader.Find("Legacy Shaders/Diffuse"); } return val; } public static Material Opaque(Texture2D texture, float metallic, float gloss, Texture2D normal = null, float normalStrength = 1f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) Shader val = SafeShader(); if ((Object)(object)val == (Object)null) { return null; } Material val2 = new Material(val); val2.color = Color.white; val2.mainTexture = (Texture)(object)texture; if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", metallic); } if (val2.HasProperty("_Glossiness")) { val2.SetFloat("_Glossiness", gloss); } if ((Object)(object)normal != (Object)null && val2.HasProperty("_BumpMap")) { val2.SetTexture("_BumpMap", (Texture)(object)normal); val2.SetFloat("_BumpScale", normalStrength); val2.EnableKeyword("_NORMALMAP"); } val2.SetInt("_Cull", 0); val2.doubleSidedGI = true; return val2; } public static Material OpaqueColor(Color color, float metallic, float gloss) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) Shader val = SafeShader(); if ((Object)(object)val == (Object)null) { return null; } Material val2 = new Material(val); val2.color = color; if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", metallic); } if (val2.HasProperty("_Glossiness")) { val2.SetFloat("_Glossiness", gloss); } val2.SetInt("_Cull", 0); val2.doubleSidedGI = true; return val2; } public static Material Emissive(Color color, float strength) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0019: 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_0031: 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_00a4: 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) Shader val = SafeShader(); if ((Object)(object)val == (Object)null) { return null; } Material val2 = new Material(val); val2.color = new Color(color.r * 0.4f, color.g * 0.4f, color.b * 0.4f, 1f); if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", 0f); } if (val2.HasProperty("_Glossiness")) { val2.SetFloat("_Glossiness", 0.2f); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", color * strength); val2.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1; } val2.SetInt("_Cull", 0); val2.doubleSidedGI = true; return val2; } private static float Noise(int x, int y) { int num = x + y * 57 + _seed * 131; num = (num << 13) ^ num; return 1f - (float)((num * (num * num * 15731 + 789221) + 1376312589) & 0x7FFFFFFF) / 1.0737418E+09f; } private static Texture2D Bark(Color baseColor, Color shade) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) int num = 128; Texture2D val = NewTexture(num); Color[] array = (Color[])(object)new Color[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = Mathf.Abs(Mathf.Sin((float)j * 0.5f + Noise(j / 6, i / 18) * 2.2f)); float num3 = Noise(j, i / 8) * 0.18f; Color val2 = Color.Lerp(shade, baseColor, num2 * 0.7f + 0.3f + num3); array[i * num + j] = val2; } } val.SetPixels(array); val.Apply(); return val; } private static Texture2D Foliage(Color baseColor, Color shade) { //IL_004b: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) int num = 96; Texture2D val = NewTexture(num); Color[] array = (Color[])(object)new Color[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = Mathf.Clamp01(Noise(j / 5, i / 5) * 0.5f + 0.55f); float num3 = Noise(j, i) * 0.12f; Color val2 = Color.Lerp(shade, baseColor, num2 + num3); array[i * num + j] = val2; } } val.SetPixels(array); val.Apply(); return val; } private static Texture2D Dirt(Color baseColor, out Texture2D normal) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_019a: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) int num = 384; Texture2D val = NewTexture(num); Color[] array = (Color[])(object)new Color[num * num]; float[] array2 = new float[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float u = (float)j / (float)(num - 1); float v = (float)i / (float)(num - 1); float num2 = PeriodicNoise(u, v, 4, 19); float num3 = PeriodicNoise(u, v, 11, 47); float num4 = PeriodicNoise(u, v, 31, 83); float num5 = PeriodicNoise(u, v, 79, 131); float num6 = num2 * 0.42f + num3 * 0.3f + num4 * 0.2f + num5 * 0.08f; float num7 = Mathf.Abs(PeriodicNoise(u, v, 7, 211) - 0.5f) * 2f; float num8 = PeriodicNoise(u, v, 53, 317); Color val2 = baseColor * 0.42f; Color val3 = baseColor * 1.18f; Color val4 = Color.Lerp(val2, val3, Mathf.SmoothStep(0.08f, 0.92f, num6)); val4 = Color.Lerp(val4, new Color(0.08f, 0.11f, 0.055f), Mathf.Clamp01((0.18f - num7) * 2.8f) * 0.28f); if (num8 > 0.86f) { float num9 = Mathf.InverseLerp(0.86f, 1f, num8); val4 = Color.Lerp(val4, new Color(0.18f, 0.17f, 0.15f), num9 * 0.5f); num6 += num9 * 0.18f; } array2[i * num + j] = num6; array[i * num + j] = val4; } } val.SetPixels(array); val.Apply(); normal = HeightNormal(array2, num, 3.2f); return val; } private static Texture2D Rock(Color baseColor, out Texture2D normal) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) int num = 256; Texture2D val = NewTexture(num); Color[] array = (Color[])(object)new Color[num * num]; float[] array2 = new float[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float u = (float)j / (float)(num - 1); float v = (float)i / (float)(num - 1); float num2 = PeriodicNoise(u, v, 5, 401); float num3 = PeriodicNoise(u, v, 17, 509); float num4 = PeriodicNoise(u, v, 43, 613); float num5 = Mathf.Abs(PeriodicNoise(u, v, 9, 719) - 0.5f) * 2f; float num6 = Mathf.SmoothStep(0.025f, 0.12f, num5); float num7 = (num2 * 0.52f + num3 * 0.31f + num4 * 0.17f) * (0.72f + num6 * 0.28f); Color val2 = baseColor * Mathf.Lerp(0.48f, 1.18f, num7); val2 = Color.Lerp(val2 * 0.45f, val2, num6); array2[i * num + j] = num7; array[i * num + j] = val2; } } val.SetPixels(array); val.Apply(); normal = HeightNormal(array2, num, 4.5f); return val; } private static float PeriodicNoise(float u, float v, int cells, int seed) { float num = u * (float)cells; float num2 = v * (float)cells; int num3 = Mathf.FloorToInt(num); int num4 = Mathf.FloorToInt(num2); float num5 = num - (float)num3; float num6 = num2 - (float)num4; int x = (num3 + 1) % cells; int y = (num4 + 1) % cells; num3 %= cells; num4 %= cells; num5 = num5 * num5 * (3f - 2f * num5); num6 = num6 * num6 * (3f - 2f * num6); float num7 = GridNoise(num3, num4, seed); float num8 = GridNoise(x, num4, seed); float num9 = GridNoise(num3, y, seed); float num10 = GridNoise(x, y, seed); return Mathf.Lerp(Mathf.Lerp(num7, num8, num5), Mathf.Lerp(num9, num10, num5), num6); } private static float GridNoise(int x, int y, int seed) { int num = x * 374761393 + y * 668265263 + seed * 1442695041; int num2 = (num ^ (num >> 13)) * 1274126177; return (float)((num2 ^ (num2 >> 16)) & 0x7FFFFFFF) / 2.1474836E+09f; } private static Texture2D HeightNormal(float[] heights, int size, float strength) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, true, true) { wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1, anisoLevel = 4 }; Color[] array = (Color[])(object)new Color[size * size]; int num = size - 1; for (int i = 0; i < size; i++) { int num2 = ((i == 0) ? (num - 1) : (i - 1)); int num3 = ((i == num) ? 1 : (i + 1)); for (int j = 0; j < size; j++) { int num4 = ((j == 0) ? (num - 1) : (j - 1)); int num5 = ((j == num) ? 1 : (j + 1)); float num6 = heights[i * size + num4] - heights[i * size + num5]; float num7 = heights[num2 * size + j] - heights[num3 * size + j]; Vector3 val2 = new Vector3(num6 * strength, num7 * strength, 1f); Vector3 normalized = ((Vector3)(ref val2)).normalized; array[i * size + j] = new Color(normalized.x * 0.5f + 0.5f, normalized.y * 0.5f + 0.5f, normalized.z * 0.5f + 0.5f, 1f); } } val.SetPixels(array); val.Apply(); return val; } private static Texture2D Planks(Color baseColor, Color shade) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) int num = 128; Texture2D val = NewTexture(num); Color[] array = (Color[])(object)new Color[num * num]; int num2 = 22; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { bool num3 = i % num2 < 2; float num4 = Mathf.Abs(Mathf.Sin((float)j * 0.25f + (float)(i / num2) * 1.7f)) * 0.2f; Color val2 = (num3 ? (shade * 0.5f) : Color.Lerp(shade, baseColor, 0.6f + num4)); array[i * num + j] = val2; } } val.SetPixels(array); val.Apply(); return val; } private static Texture2D NewTexture(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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: Expected O, but got Unknown return new Texture2D(size, size, (TextureFormat)4, true) { wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1, anisoLevel = 4 }; } } internal sealed class HollowMesh { private readonly List _vertices = new List(); private readonly List _normals = new List(); private readonly List _uvs = new List(); private readonly List> _submeshes = new List>(); private List Submesh(int index) { while (_submeshes.Count <= index) { _submeshes.Add(new List()); } return _submeshes[index]; } public int AddVertex(Vector3 position, Vector3 normal, Vector2 uv) { //IL_0006: 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_001e: Unknown result type (might be due to invalid IL or missing references) _vertices.Add(position); _normals.Add(normal); _uvs.Add(uv); return _vertices.Count - 1; } public void AddTriangle(int submesh, int a, int b, int c) { List list = Submesh(submesh); list.Add(a); list.Add(b); list.Add(c); } public void AddQuad(int submesh, int a, int b, int c, int d) { AddTriangle(submesh, a, b, c); AddTriangle(submesh, a, c, d); } public void Tube(int submesh, Vector3 from, Vector3 to, float radiusFrom, float radiusTo, int sides, float uvV0, float uvV1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00d3: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude < 0.0001f)) { val /= magnitude; Vector3 val2 = ((Mathf.Abs(val.y) > 0.9f) ? Vector3.right : Vector3.up); Vector3 val3 = Vector3.Normalize(Vector3.Cross(val, val2)); Vector3 val4 = Vector3.Cross(val3, val); int count = _vertices.Count; for (int i = 0; i <= sides; i++) { float num = (float)i / (float)sides * MathF.PI * 2f; Vector3 val5 = val3 * Mathf.Cos(num) + val4 * Mathf.Sin(num); float num2 = (float)i / (float)sides; AddVertex(from + val5 * radiusFrom, val5, new Vector2(num2 * 2f, uvV0)); AddVertex(to + val5 * radiusTo, val5, new Vector2(num2 * 2f, uvV1)); } for (int j = 0; j < sides; j++) { int num3 = count + j * 2; AddQuad(submesh, num3, num3 + 1, num3 + 3, num3 + 2); } int a = AddVertex(from, -val, new Vector2(0.5f, 0.5f)); int a2 = AddVertex(to, val, new Vector2(0.5f, 0.5f)); for (int k = 0; k < sides; k++) { int num4 = count + k * 2; int num5 = count + (k + 1) * 2; AddTriangle(submesh, a, num4, num5); AddTriangle(submesh, a2, num5 + 1, num4 + 1); } } } public void Cone(int submesh, Vector3 baseCenter, float height, float radius, int sides, bool doubleSided = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_0096: 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_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_00b7: Unknown result type (might be due to invalid IL or missing references) int a = AddVertex(baseCenter + Vector3.up * height, Vector3.up, new Vector2(0.5f, 1f)); int count = _vertices.Count; Vector3 val = default(Vector3); for (int i = 0; i <= sides; i++) { float num = (float)i / (float)sides * MathF.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Vector3 val2 = val + Vector3.up * (radius / Mathf.Max(0.1f, height)); Vector3 normalized = ((Vector3)(ref val2)).normalized; AddVertex(baseCenter + val * radius, normalized, new Vector2((float)i / (float)sides * 2f, 0f)); } for (int j = 0; j < sides; j++) { int num2 = count + j; int num3 = count + j + 1; AddTriangle(submesh, a, num3, num2); if (doubleSided) { AddTriangle(submesh, a, num2, num3); } } } public void Blob(int submesh, Vector3 center, Vector3 scale, int longitude, int latitude, float jitter, int seed, bool doubleSided = false) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_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_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(seed); longitude = Mathf.Max(3, longitude); latitude = Mathf.Max(3, latitude); float num = 1f + ((float)random.NextDouble() - 0.5f) * jitter * 0.35f; float num2 = 1f + ((float)random.NextDouble() - 0.5f) * jitter * 0.35f; int a = AddVertex(center + Vector3.up * scale.y * num, Vector3.up, new Vector2(0.5f, 1f)); int count = _vertices.Count; float[,] array = new float[latitude - 1, longitude]; for (int i = 1; i < latitude; i++) { for (int j = 0; j < longitude; j++) { array[i - 1, j] = 1f + ((float)random.NextDouble() - 0.5f) * 2f * jitter; } } Vector3 val = default(Vector3); for (int k = 1; k < latitude; k++) { float num3 = (float)k / (float)latitude; float num4 = num3 * MathF.PI; float num5 = Mathf.Sin(num4); float num6 = Mathf.Cos(num4); for (int l = 0; l <= longitude; l++) { float num7 = (float)l / (float)longitude; float num8 = num7 * MathF.PI * 2f; ((Vector3)(ref val))..ctor(num5 * Mathf.Cos(num8), num6, num5 * Mathf.Sin(num8)); float num9 = array[k - 1, l % longitude]; Vector3 val2 = Vector3.Scale(val * num9, scale); Vector3 val3 = new Vector3(val.x / Mathf.Max(0.001f, scale.x), val.y / Mathf.Max(0.001f, scale.y), val.z / Mathf.Max(0.001f, scale.z)); Vector3 normalized = ((Vector3)(ref val3)).normalized; AddVertex(center + val2, normalized, new Vector2(num7 * 1.5f, num3 * 1.5f)); } } int num10 = longitude + 1; for (int m = 0; m < longitude; m++) { AddTriangle(submesh, a, count + m + 1, count + m); if (doubleSided) { AddTriangle(submesh, a, count + m, count + m + 1); } } for (int n = 0; n < latitude - 2; n++) { for (int num11 = 0; num11 < longitude; num11++) { int num12 = count + n * num10 + num11; int num13 = num12 + num10; AddQuad(submesh, num12, num12 + 1, num13 + 1, num13); if (doubleSided) { AddQuad(submesh, num12, num13, num13 + 1, num12 + 1); } } } int num14 = AddVertex(center + Vector3.down * scale.y * num2, Vector3.down, new Vector2(0.5f, 0f)); int num15 = count + (latitude - 2) * num10; for (int num16 = 0; num16 < longitude; num16++) { AddTriangle(submesh, num15 + num16, num15 + num16 + 1, num14); if (doubleSided) { AddTriangle(submesh, num15 + num16, num14, num15 + num16 + 1); } } } public void Box(int submesh, Vector3 center, Vector3 size, Quaternion rotation, float uvScale) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0129: 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: 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_0029: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Vector3 val = size * 0.5f; Vector3[] array = (Vector3[])(object)new Vector3[8]; int num = 0; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { for (int k = -1; k <= 1; k += 2) { array[num++] = center + rotation * Vector3.Scale(val, new Vector3((float)i, (float)j, (float)k)); } } } AddFace(submesh, array[4], array[6], array[7], array[5], uvScale); AddFace(submesh, array[1], array[3], array[2], array[0], uvScale); AddFace(submesh, array[6], array[2], array[3], array[7], uvScale); AddFace(submesh, array[0], array[4], array[5], array[1], uvScale); AddFace(submesh, array[5], array[7], array[3], array[1], uvScale); AddFace(submesh, array[0], array[2], array[6], array[4], uvScale); } private void AddFace(int submesh, Vector3 a, Vector3 b, Vector3 c, Vector3 d, float uvScale) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Vector3 normal = Vector3.Normalize(Vector3.Cross(b - a, c - a)); int a2 = AddVertex(a, normal, new Vector2(0f, 0f)); int b2 = AddVertex(b, normal, new Vector2(uvScale, 0f)); int c2 = AddVertex(c, normal, new Vector2(uvScale, uvScale)); int d2 = AddVertex(d, normal, new Vector2(0f, uvScale)); AddQuad(submesh, a2, b2, c2, d2); } public void InvertedDome(int submesh, float radius, int longitude, int latitude) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; Vector3 val = default(Vector3); for (int i = 0; i <= latitude; i++) { float num = (float)i / (float)latitude * MathF.PI; float num2 = Mathf.Sin(num); float num3 = Mathf.Cos(num); for (int j = 0; j <= longitude; j++) { float num4 = (float)j / (float)longitude; float num5 = num4 * MathF.PI * 2f; ((Vector3)(ref val))..ctor(num2 * Mathf.Cos(num5), num3, num2 * Mathf.Sin(num5)); AddVertex(val * radius, -val, new Vector2(num4 * 4f, Mathf.Clamp01(val.y))); } } int num6 = longitude + 1; for (int k = 0; k < latitude; k++) { for (int l = 0; l < longitude; l++) { int num7 = count + k * num6 + l; int num8 = num7 + num6; AddQuad(submesh, num7, num8, num8 + 1, num7 + 1); } } } public Mesh ToMesh(string name) { //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_000d: Expected O, but got Unknown Mesh val = new Mesh { name = name }; if (_vertices.Count > 65000) { val.indexFormat = (IndexFormat)1; } val.SetVertices(_vertices); val.SetNormals(_normals); val.SetUVs(0, _uvs); val.subMeshCount = Mathf.Max(1, _submeshes.Count); for (int i = 0; i < _submeshes.Count; i++) { val.SetTriangles(_submeshes[i], i); } val.RecalculateBounds(); return val; } } [HarmonyPatch(typeof(RunManager), "SetRunLevel")] internal static class HollowPatchSetRunLevel { private static void Postfix(RunManager __instance) { if (EmpressHollowPlugin.Settings != null && EmpressHollowPlugin.Settings.ForceLevel.Value && !((Object)(object)EmpressHollowPlugin.HollowLevel == (Object)null)) { __instance.levelCurrent = EmpressHollowPlugin.HollowLevel; } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] internal static class HollowPatchGenerate { private static bool Prefix(LevelGenerator __instance, ref IEnumerator __result) { if (!EmpressHollowPlugin.IsHollowLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = HollowRuntime.EnsureHost().GenerateLevel(__instance); return false; } } [HarmonyPatch(typeof(LevelPoint), "NavMeshCheck")] internal static class HollowPatchNavMeshCheck { private static bool Prefix(ref IEnumerator __result) { if (!EmpressHollowPlugin.IsHollowLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = HollowRuntime.EmptyCoroutine(); return false; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] internal static class HollowPatchEnvironmentSetup { private static bool Prefix(EnvironmentDirector __instance) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00a9: 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) if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance)) { return true; } Level level = LevelGenerator.Instance.Level; if (!Object.op_Implicit((Object)(object)level) || !EmpressHollowPlugin.IsHollowLevel(level)) { return true; } HollowRuntime instance = HollowRuntime.Instance; Color val = (((Object)(object)instance != (Object)null) ? instance.CurrentFogColor : level.FogColor); Color val2 = (((Object)(object)instance != (Object)null) ? instance.CurrentAmbientColor : level.AmbientColor); HollowAccess.SetEnvironmentFog(__instance, val, level.FogStartDistance, level.FogEndDistance); HollowAccess.SetEnvironmentAmbient(__instance, val2, level.AmbientColorAdaptation); RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)1; RenderSettings.fogColor = val; RenderSettings.fogStartDistance = level.FogStartDistance; RenderSettings.fogEndDistance = level.FogEndDistance; RenderSettings.ambientLight = val2; RenderSettings.ambientMode = (AmbientMode)3; Camera val3 = HollowAccess.GetEnvironmentMainCamera(__instance); if (!Object.op_Implicit((Object)(object)val3)) { val3 = Camera.main; HollowAccess.SetEnvironmentMainCamera(__instance, val3); } if (Object.op_Implicit((Object)(object)val3)) { val3.clearFlags = (CameraClearFlags)2; val3.backgroundColor = val; val3.farClipPlane = 2200f; } HollowAccess.SetEnvironmentDarkAdaptation(__instance, 0.5f); HollowAccess.SetEnvironmentSetupDone(__instance, value: true); return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class HollowPatchLoadingUi { private static void Postfix(LoadingUI __instance) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!EmpressHollowPlugin.IsHollowLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { HollowLoadingScreen.Hide(__instance); return; } HollowLoadingScreen.Show(__instance); if ((Object)(object)__instance.levelNumberText != (Object)null) { ((TMP_Text)__instance.levelNumberText).text = "THE WOODS"; ((Graphic)__instance.levelNumberText).color = new Color(0.6f, 0.72f, 0.85f); ((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 Hollow"; ((Graphic)__instance.levelNameText).color = new Color(0.78f, 0.86f, 0.98f); ((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 Hollow 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 Hollow Loading Hint"; } ((TMP_Text)val2).text = "One of the trees is not a tree. Keep your eyes on it."; ((Graphic)val2).color = new Color(0.55f, 0.62f, 0.74f); ((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(LoadingUI), "StopLoading")] internal static class HollowPatchLoadingUiStopLoading { private static void Prefix(LoadingUI __instance) { HollowLoadingScreen.Hide(__instance); } } [HarmonyPatch(typeof(LoadingUI), "PlayTurn")] internal static class HollowPatchLoadingUiPlayTurn { [HarmonyPriority(800)] private static bool Prefix() { return !HollowLoadingScreen.OwnsCurrentLoading(); } } [HarmonyPatch(typeof(LoadingUI), "PlayRevUp")] internal static class HollowPatchLoadingUiPlayRevUp { [HarmonyPriority(800)] private static bool Prefix() { return !HollowLoadingScreen.OwnsCurrentLoading(); } } [HarmonyPatch(typeof(LoadingUI), "PlayCrash")] internal static class HollowPatchLoadingUiPlayCrash { [HarmonyPriority(800)] private static bool Prefix() { return !HollowLoadingScreen.OwnsCurrentLoading(); } } [HarmonyPatch(typeof(LightManager), "HandleLightActivation")] internal static class HollowPatchLightManager { private static bool Prefix() { return !EmpressHollowPlugin.IsHollowLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null); } } [HarmonyPatch(typeof(ItemManager), "TurnOffIconLights")] internal static class HollowPatchIconLights { private static bool Prefix(ItemManager __instance, ref IEnumerator __result) { if (!EmpressHollowPlugin.IsHollowLevel(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) { yield break; } if (SemiFunc.RunIsShop() || SemiFunc.MenuLevel()) { itemManager.itemIconLights.SetActive(false); yield break; } while ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.2f); } itemManager.itemIconLights.SetActive(false); } } internal sealed class HollowRuntime : MonoBehaviour { private const float ObserveRange = 72f; private const float SyncInterval = 0.1f; private HollowMap _map; private HollowStalker _stalker; private Transform _root; private Transform _moduleRoot; private Transform _entityRoot; private AudioSource _wind; private AudioSource _static; private int _worldMask = -1; private int _sceneHandle = -1; private int _seed; private bool _active; private float _syncTimer; private float _observeSendTimer; private float _remoteObservedUntil; private float _heartbeatTimer; private float _ambientTimer; private float _noteCheckTimer; private int _notesCollected; private List _notes; private bool[] _noteCollected; private bool[] _noteRaised; private bool _completionStarted; public static HollowRuntime Instance { get; private set; } public Color CurrentFogColor { get; private set; } = new Color(0.045f, 0.055f, 0.08f); public Color CurrentAmbientColor { get; private set; } = new Color(0.17f, 0.2f, 0.27f); public static HollowRuntime 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 Hollow 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() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown Instance = this; GameObject val = new GameObject("Empress Hollow Wind"); val.transform.SetParent(((Component)this).transform, false); _wind = val.AddComponent(); _wind.clip = HollowAudio.WindClip; _wind.loop = true; _wind.playOnAwake = false; _wind.spatialBlend = 0f; _wind.volume = 0f; GameObject val2 = new GameObject("Empress Hollow Static"); val2.transform.SetParent(((Component)this).transform, false); _static = val2.AddComponent(); _static.clip = HollowAudio.StaticClip; _static.loop = true; _static.playOnAwake = false; _static.spatialBlend = 0f; _static.volume = 0f; } private void Update() { HandleSceneTransition(); if (!_active) { return; } if (!EmpressHollowPlugin.IsHollowLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { Deactivate(); return; } float deltaTime = Time.deltaTime; bool num = SemiFunc.IsMasterClientOrSingleplayer(); bool flag = ComputeLocalObservation(); UpdateLocalFeedback(deltaTime, flag); if (num) { bool observed = flag || Time.time < _remoteObservedUntil; if (!_completionStarted) { UpdateNotes(deltaTime); UpdateStalkerBrain(deltaTime, observed); UpdateStalkerSync(deltaTime); UpdateAmbient(deltaTime); } return; } if ((Object)(object)_stalker != (Object)null) { _stalker.ClientTick(deltaTime); } _observeSendTimer -= deltaTime; if (flag && _observeSendTimer <= 0f) { _observeSendTimer = 0.15f; EmpressHollowPlugin.RaiseToMaster(186, new object[1] { 1 }); } } public IEnumerator GenerateLevel(LevelGenerator generator) { EmpressHollowPlugin.EnsurePhotonHooked(); yield return (object)new WaitForSeconds(0.2f); if (!SemiFunc.IsMultiplayer()) { HollowAccess.SetAllPlayersReady(generator, value: true); } while (!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; HollowAccess.SetLevelPrevious(RunManager.instance, generator.Level); generator.Generated = false; HollowAccess.SetEnemyReady(generator, value: true); HollowAccess.SetModulesSpawned(generator, 0); HollowAccess.SetPlayerSpawnedCount(generator, 0); generator.LevelPathPoints = new List(); generator.LevelPathTruck = null; generator.State = (LevelState)3; _seed = ComputeSeed(); BuildLevel(generator); HollowRuntime hollowRuntime = this; Scene activeScene = SceneManager.GetActiveScene(); hollowRuntime._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()) { generator.NavMeshSetup(); yield return null; 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 (HollowAccess.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 { HollowAccess.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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_012c: 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_0159: Expected O, but got Unknown 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 Hollow Root"); val.transform.SetParent(generator.LevelParent.transform, false); _root = val.transform; GameObject val2 = new GameObject("Empress Hollow Module"); val2.transform.SetParent(val.transform, false); _moduleRoot = val2.transform; val2.AddComponent().ObservedComponents = new List(); HollowAccess.ConfigureStartRoomModule(val2.AddComponent(), 0, 0); val2.AddComponent(); GameObject val3 = new GameObject("Empress Hollow Room Volume"); val3.transform.SetParent(val2.transform, false); RoomVolume roomVolume = val3.AddComponent(); BoxCollider obj = val3.AddComponent(); ((Collider)obj).isTrigger = true; float num2 = EmpressHollowPlugin.Settings.ForestRadius.Value * 2.4f; obj.size = new Vector3(num2, 80f, num2); obj.center = new Vector3(0f, 30f, 0f); _map = HollowForest.Build(val2.transform, _seed); GameObject val4 = new GameObject("Empress Hollow Entities"); val4.transform.SetParent(val.transform, false); _entityRoot = val4.transform; BuildSpawnPoints(val2.transform, roomVolume, generator); } private void BuildSpawnPoints(Transform parent, RoomVolume roomVolume, LevelGenerator generator) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _map.SpawnPositions.Count; i++) { GameObject val = new GameObject("Empress Hollow Spawn"); val.transform.SetParent(parent, false); val.transform.localPosition = _map.SpawnPositions[i]; val.transform.localRotation = Quaternion.LookRotation(Vector3.forward, Vector3.up); val.AddComponent(); } LevelPoint val2 = CreateLevelPoint(parent, roomVolume, generator, _map.PlayerStart, truck: true); LevelPoint val3 = CreateLevelPoint(parent, roomVolume, generator, _map.PlayerStart + new Vector3(3.5f, 0f, 1.5f), truck: false); val2.ConnectedPoints = new List { val3 }; val3.ConnectedPoints = new List { val2 }; } private static LevelPoint CreateLevelPoint(Transform parent, RoomVolume roomVolume, LevelGenerator generator, Vector3 localPosition, bool truck) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Level Point") { layer = LayerMask.NameToLayer("Other") }; val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; 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; HollowAccess.MarkLevelPointInStartRoom(val2, value: true); if (generator.LevelPathPoints == null) { generator.LevelPathPoints = new List(); } generator.LevelPathPoints.Add(val2); return val2; } private void Activate() { //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) _active = true; _syncTimer = 0f; _observeSendTimer = 0f; _remoteObservedUntil = 0f; _heartbeatTimer = 0f; _ambientTimer = Random.Range(35f, 65f); _completionStarted = false; HollowAudio.ApplyRepoMixer(_wind); HollowAudio.ApplyRepoMixer(_static); if ((Object)(object)_wind != (Object)null && (Object)(object)HollowAudio.WindClip != (Object)null) { _wind.volume = 0f; _wind.Play(); } if ((Object)(object)_static != (Object)null && (Object)(object)HollowAudio.StaticClip != (Object)null) { _static.volume = 0f; _static.Play(); } _notesCollected = 0; _noteCheckTimer = 0.5f; _notes = new List(); int num = ((_map != null) ? _map.NotePositions.Count : 0); _noteCollected = new bool[num]; _noteRaised = new bool[num]; if (_map != null && (Object)(object)_entityRoot != (Object)null) { for (int i = 0; i < _map.NotePositions.Count; i++) { _notes.Add(HollowNote.Create(_entityRoot, _map.NotePositions[i])); } bool isHost = SemiFunc.IsMasterClientOrSingleplayer(); _stalker = HollowStalker.Create(_entityRoot, isHost, _map, _seed ^ 0x51ED); _stalker.PlaceAt(_map.StalkerStart, _map.Center - _map.StalkerStart); _stalker.SetAggression(0f); } SemiFunc.UIFocusText("Gather the eight notes. Each one wakes the thing in the trees. Look at it to freeze it.", new Color(0.7f, 0.82f, 0.95f), Color.white, 6f); } private void Deactivate() { _active = false; if ((Object)(object)_wind != (Object)null && _wind.isPlaying) { _wind.Stop(); } if ((Object)(object)_static != (Object)null && _static.isPlaying) { _static.Stop(); } if ((Object)(object)_stalker != (Object)null) { _stalker.Dispose(); } _stalker = null; _map = null; _notes = null; _completionStarted = false; } 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 UpdateNotes(float dt) { //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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (_notes == null || _map == null) { return; } _noteCheckTimer -= dt; if (_noteCheckTimer > 0f) { return; } _noteCheckTimer = 0.25f; List list = PlayablePlayers(); for (int i = 0; i < _notes.Count; i++) { if (_noteRaised[i] || _noteCollected[i]) { continue; } Vector3 val = _map.NotePositions[i]; for (int j = 0; j < list.Count; j++) { Vector3 val2 = ((Component)list[j]).transform.position - val; Vector2 val3 = new Vector2(val2.x, val2.z); if (((Vector2)(ref val3)).magnitude < 1.9f && Mathf.Abs(val2.y) < 3.5f) { _noteRaised[i] = true; EmpressHollowPlugin.RaiseToAll(188, new object[1] { i }); break; } } } } internal void ReceiveNote(object[] data) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) if (data == null || data.Length < 1 || _noteCollected == null) { return; } int num = ToInt(data[0]); if (num >= 0 && num < _noteCollected.Length && !_noteCollected[num]) { _noteCollected[num] = true; _notesCollected++; if (_notes != null && num < _notes.Count && (Object)(object)_notes[num] != (Object)null) { Object.Destroy((Object)(object)_notes[num]); _notes[num] = null; } if ((Object)(object)_stalker != (Object)null) { _stalker.SetAggression((float)_notesCollected / 8f); } PlayerAvatar val = LocalAvatar(); HollowAudio.PlayWhisper(((Object)(object)val != (Object)null) ? StalkerDirectionSoundPosition(((Component)val).transform.position) : Vector3.zero); if ((Object)(object)CameraGlitch.Instance != (Object)null && _notesCollected >= 4) { CameraGlitch.Instance.PlayShort(); } SemiFunc.UIFocusText((_notesCollected >= 8) ? "8 / 8. The Hollow is breaking apart." : ("Note " + _notesCollected + " / 8. It stirs in the dark."), new Color(0.95f, 0.85f, 0.5f), Color.white, 4f); if (_notesCollected >= _noteCollected.Length && SemiFunc.IsMasterClientOrSingleplayer()) { CompleteNotesHost(); } } } private void CompleteNotesHost() { if (!_completionStarted) { int num = Random.Range(40, 71); SemiFunc.StatSetRunCurrency(SemiFunc.StatGetRunCurrency() + num); SemiFunc.StatSetRunTotalHaul(SemiFunc.StatGetRunTotalHaul() + num); if ((Object)(object)CurrencyUI.instance != (Object)null) { CurrencyUI.instance.FetchCurrency(); } if (SemiFunc.IsMultiplayer()) { EmpressHollowPlugin.RaiseToOthers(189, new object[1] { num }); } ReceiveCompletion(new object[1] { num }); } } internal void ReceiveCompletion(object[] data) { if (!_completionStarted) { int reward = ((data != null && data.Length != 0) ? ToInt(data[0]) : 40); _completionStarted = true; if ((Object)(object)_stalker != (Object)null) { _stalker.Dispose(); _stalker = null; } ((MonoBehaviour)this).StartCoroutine(CompletionSequence(reward)); } } private IEnumerator CompletionSequence(int reward) { PlayerAvatar val = LocalAvatar(); HollowAudio.PlayComplete(((Object)(object)val != (Object)null) ? ((Component)val).transform.position : Vector3.zero); SemiFunc.UIFocusText("ALL NOTES FOUND\n$" + reward + ",000 AWARDED", new Color(0.75f, 0.95f, 1f), Color.white, 4f); float timer = 4.2f; float pulse = 0f; while (timer > 0f) { timer -= Time.unscaledDeltaTime; pulse -= Time.unscaledDeltaTime; if (pulse <= 0f) { pulse = Random.Range(0.12f, 0.32f); if ((Object)(object)CameraGlitch.Instance != (Object)null) { CameraGlitch.Instance.PlayShort(); } SemiFunc.CameraShakeImpact(Random.Range(0.3f, 1.2f), 0.15f); } if ((Object)(object)_static != (Object)null) { _static.volume = Mathf.MoveTowards(_static.volume, EmpressHollowPlugin.Settings.MasterVolume.Value, Time.unscaledDeltaTime * 0.8f); } yield return null; } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)RunManager.instance != (Object)null && EmpressHollowPlugin.IsHollowLevel(RunManager.instance.levelCurrent)) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } internal void RefreshAudioClips() { HollowAudio.ApplyRepoMixer(_wind); HollowAudio.ApplyRepoMixer(_static); RefreshLoop(_wind, HollowAudio.WindClip); RefreshLoop(_static, HollowAudio.StaticClip); } private static void RefreshLoop(AudioSource source, AudioClip clip) { if (!((Object)(object)source == (Object)null) && !((Object)(object)clip == (Object)null) && !((Object)(object)source.clip == (Object)(object)clip)) { bool isPlaying = source.isPlaying; source.Stop(); source.clip = clip; if (isPlaying) { source.Play(); } } } private void UpdateStalkerBrain(float dt, bool observed) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_stalker == (Object)null || _map == null) { return; } List list = PlayablePlayers(); PlayerAvatar val = null; float num = float.MaxValue; for (int i = 0; i < list.Count; i++) { float num2 = Vector3.Distance(_stalker.Position, ((Component)list[i]).transform.position); if (num2 < num) { num = num2; val = list[i]; } } if (_stalker.HostThink(dt, val, num, observed, _map.Waypoints) && (Object)(object)val != (Object)null) { HostGrabKill(val); } } private void UpdateStalkerSync(float dt) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_stalker == (Object)null) && SemiFunc.IsMultiplayer()) { _syncTimer -= dt; if (!(_syncTimer > 0f)) { _syncTimer = 0.1f; Vector3 position = _stalker.Position; EmpressHollowPlugin.RaiseToOthers(184, new object[6] { position.x, position.y, position.z, _stalker.Yaw, _stalker.ArmExtend, _stalker.Hidden ? 1 : 0 }, reliable: false); } } } private void HostGrabKill(PlayerAvatar victim) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_0091: 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_012d: 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_009f: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)victim == (Object)null) && !((Object)(object)victim.playerHealth == (Object)null) && !HollowAccess.GetDeadSet(victim)) { int num = (((Object)(object)victim.photonView != (Object)null) ? victim.photonView.ViewID : (-1)); PlayerTumble playerTumble = HollowAccess.GetPlayerTumble(victim); if ((Object)(object)playerTumble != (Object)null) { playerTumble.TumbleRequest(true, false); Vector3 val = ((Component)victim).transform.position - _stalker.Position; val.y = 0f; val = ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : ((Component)victim).transform.forward); playerTumble.TumbleForce(val * 5f + Vector3.up * 8f); } if (SemiFunc.IsMultiplayer()) { victim.playerHealth.HurtOther(999, Vector3.zero, false, -1, false); } else { victim.playerHealth.Hurt(999, false, -1, false); } EmpressHollowPlugin.RaiseToAll(185, new object[4] { num, ((Component)victim).transform.position.x, ((Component)victim).transform.position.y, ((Component)victim).transform.position.z }); } } private bool ComputeLocalObservation() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_stalker == (Object)null || _stalker.Hidden) { return false; } Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return false; } if (_worldMask == -1) { _worldMask = LayerMask.GetMask(new string[1] { "Default" }); } foreach (Vector3 item in _stalker.SamplePoints()) { Vector3 val = main.WorldToViewportPoint(item); if (!(val.z <= 0f) && !(val.x < 0f) && !(val.x > 1f) && !(val.y < 0f) && !(val.y > 1f) && !(Vector3.Distance(((Component)main).transform.position, item) > 72f) && !Physics.Linecast(((Component)main).transform.position, item, _worldMask, (QueryTriggerInteraction)1)) { return true; } } return false; } private void UpdateLocalFeedback(float dt, bool localSees) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) float value = EmpressHollowPlugin.Settings.MasterVolume.Value; if ((Object)(object)_wind != (Object)null) { _wind.volume = Mathf.MoveTowards(_wind.volume, 0.32f * value, dt * 0.4f); } PlayerAvatar val = LocalAvatar(); float num = 0f; float num2 = float.MaxValue; if ((Object)(object)_stalker != (Object)null && !_stalker.Hidden && (Object)(object)val != (Object)null) { num2 = Vector3.Distance(((Component)val).transform.position, _stalker.Position); if (localSees && num2 < 32f) { num = Mathf.Clamp01(Mathf.InverseLerp(32f, 5f, num2)) * 0.55f * value; } } if ((Object)(object)_static != (Object)null) { _static.volume = Mathf.MoveTowards(_static.volume, num, dt * 1.6f); } if ((Object)(object)_stalker != (Object)null && !_stalker.Hidden && (Object)(object)val != (Object)null && num2 < 16f) { _heartbeatTimer -= dt; if (_heartbeatTimer <= 0f) { _heartbeatTimer = Mathf.Lerp(0.5f, 1.1f, Mathf.InverseLerp(4f, 16f, num2)); HollowAudio.PlayHeartbeat(((Component)val).transform.position); } } } private void UpdateAmbient(float dt) { //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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) _ambientTimer -= dt; if (!(_ambientTimer > 0f)) { _ambientTimer = Random.Range(45f, 95f); List list = PlayablePlayers(); if (list.Count != 0) { PlayerAvatar val = list[Random.Range(0, list.Count)]; int num = ((!(Random.value < 0.65f)) ? 1 : 0); Vector3 val2 = ((num == 0) ? RandomTreeSoundPosition(((Component)val).transform.position) : StalkerDirectionSoundPosition(((Component)val).transform.position)); PlayAmbient(num, val2); EmpressHollowPlugin.RaiseToOthers(187, new object[4] { num, val2.x, val2.y, val2.z }); } } } private Vector3 RandomTreeSoundPosition(Vector3 listener) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0056: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_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_0114: 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 (_map == null || _map.TreePositions.Count == 0) { return listener; } Vector3 val = _map.TreePositions[Random.Range(0, _map.TreePositions.Count)]; Vector3 result = (((Object)(object)_map.Root != (Object)null) ? _map.Root.TransformPoint(val) : val); float num = float.MaxValue; int num2 = Mathf.Min(32, _map.TreePositions.Count); for (int i = 0; i < num2; i++) { Vector3 val2 = _map.TreePositions[Random.Range(0, _map.TreePositions.Count)]; Vector3 val3 = (((Object)(object)_map.Root != (Object)null) ? _map.Root.TransformPoint(val2) : val2); float num3 = Vector3.Distance(listener, val3); float num4 = Mathf.Abs(num3 - 26f); if (num3 >= 9f && num3 <= 52f && num4 < num) { result = val3; num = num4; } } result.y += Random.Range(2f, 7f); return result; } private Vector3 StalkerDirectionSoundPosition(Vector3 listener) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_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_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_stalker == (Object)null) { return listener; } Vector3 val = _stalker.Position - listener; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { return _stalker.Position + Vector3.up * 3f; } float num = Mathf.Min(((Vector3)(ref val)).magnitude, Random.Range(14f, 24f)); Vector3 result = listener + ((Vector3)(ref val)).normalized * num; result.y = listener.y + Random.Range(1.5f, 4.5f); return result; } private static void PlayAmbient(int type, Vector3 position) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if (type == 0) { HollowAudio.PlayCreak(position); } else { HollowAudio.PlayWhisper(position); } } internal void ReceiveStalkerSync(object[] data) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)_stalker == (Object)null) && data != null && data.Length >= 6) { Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(ToFloat(data[0]), ToFloat(data[1]), ToFloat(data[2])); float yaw = ToFloat(data[3]); float armExtend = ToFloat(data[4]); bool hidden = ToInt(data[5]) != 0; _stalker.ClientApplySync(position, yaw, armExtend, hidden); } } internal void ReceiveObserve(object[] data) { if (SemiFunc.IsMasterClientOrSingleplayer()) { _remoteObservedUntil = Time.time + 0.4f; } } internal void ReceiveGrab(object[] data) { //IL_002b: 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) if (data == null || data.Length < 4) { return; } int num = ToInt(data[0]); Vector3 position = new Vector3(ToFloat(data[1]), ToFloat(data[2]), ToFloat(data[3])); PlayerAvatar val = LocalAvatar(); int num2 = (((Object)(object)val != (Object)null && (Object)(object)val.photonView != (Object)null) ? val.photonView.ViewID : (-1)); HollowAudio.PlayGrab(position); if (num > 0 && num2 == num) { SemiFunc.CameraShakeImpact(5f, 0.6f); if ((Object)(object)CameraGlitch.Instance != (Object)null) { CameraGlitch.Instance.PlayLong(); } SemiFunc.UIFocusText("It had its hands on you the whole time.", new Color(0.6f, 0.85f, 1f), Color.white, 4f); } } internal void ReceiveAmbient(object[] data) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (data != null && data.Length >= 4) { int type = ToInt(data[0]); Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(ToFloat(data[1]), ToFloat(data[2]), ToFloat(data[3])); PlayAmbient(type, position); } } 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 && !HollowAccess.GetIsDisabled(avatar)) { return !HollowAccess.GetDeadSet(avatar); } return false; } private List PlayablePlayers() { List list = new List(); if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null) { for (int i = 0; i < GameDirector.instance.PlayerList.Count; i++) { PlayerAvatar val = GameDirector.instance.PlayerList[i]; if (IsPlayable(val)) { list.Add(val); } } } if (list.Count == 0) { PlayerAvatar val2 = LocalAvatar(); if (IsPlayable(val2)) { list.Add(val2); } } return list; } private static bool GetAllPlayersReady(LevelGenerator generator) { return HollowAccess.GetAllPlayersReady(generator); } private int ComputeSeed() { int num = 173; if ((Object)(object)GameDirector.instance != (Object)null) { num = (num * 397) ^ GameDirector.instance.Seed; } if ((Object)(object)RunManager.instance != (Object)null) { num = (num * 397) ^ RunManager.instance.levelsCompleted; if ((Object)(object)RunManager.instance.levelCurrent != (Object)null) { num = (num * 397) ^ StableHash(((Object)RunManager.instance.levelCurrent).name); } } if (PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null) { num = (num * 397) ^ StableHash(PhotonNetwork.CurrentRoom.Name); } return num & 0x7FFFFFFF; } private static int StableHash(string text) { int num = 23; if (text == null) { return num; } for (int i = 0; i < text.Length; i++) { num = num * 31 + text[i]; } return num; } private static float ToFloat(object value) { if (value is float) { return (float)value; } return 0f; } private static int ToInt(object value) { if (value is int) { return (int)value; } return 0; } } internal static class HollowScenery { public static void Build(Transform parent, HollowMap map, Random random) { BuildMoss(parent, map, random); BuildUndergrowth(parent, map, random); BuildFallenTimber(parent, map, random); BuildFungi(parent, map, random); } private static void BuildMoss(Transform parent, HollowMap map, Random random) { //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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) HollowMesh hollowMesh = new HollowMesh(); int num = Mathf.Clamp(Mathf.RoundToInt(map.Radius * 0.75f), 34, 82); for (int i = 0; i < num; i++) { Vector2 val = Point(random, map.ClearingRadius * 0.45f, map.Radius - 2f); float num2 = Range(random, 0.8f, 3.2f); int num3 = random.Next(7, 13); Vector3 position = map.OnGround(val.x, val.y, 0.025f); int num4 = hollowMesh.AddVertex(position, Vector3.up, new Vector2(0.5f, 0.5f)); int num5 = num4 + 1; for (int j = 0; j <= num3; j++) { float num6 = (float)j / (float)num3 * MathF.PI * 2f; float num7 = num2 * Range(random, 0.68f, 1.12f); float x = val.x + Mathf.Cos(num6) * num7; float z = val.y + Mathf.Sin(num6) * num7; Vector3 position2 = map.OnGround(x, z, 0.03f); Vector2 uv = new Vector2(Mathf.Cos(num6), Mathf.Sin(num6)) * 0.5f + Vector2.one * 0.5f; hollowMesh.AddVertex(position2, Vector3.up, uv); } for (int k = 0; k < num3; k++) { hollowMesh.AddTriangle(0, num4, num5 + k + 1, num5 + k); } } GameObject val2 = new GameObject("Empress Hollow Moss"); val2.transform.SetParent(parent, false); val2.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Moss Mesh"); MeshRenderer obj = val2.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.MossMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = true; } private static void BuildUndergrowth(Transform parent, HollowMap map, Random random) { //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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_011b: 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_012e: 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_0132: 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) HollowMesh hollowMesh = new HollowMesh(); int num = Mathf.Clamp(Mathf.RoundToInt(map.Radius * 4.5f), 220, 520); Vector3 val3 = default(Vector3); for (int i = 0; i < num; i++) { Vector2 val = Point(random, map.ClearingRadius + 1f, map.Radius - 1.5f); Vector3 val2 = map.OnGround(val.x, val.y, 0.02f); int num2 = random.Next(3, 8); for (int j = 0; j < num2; j++) { float num3 = Range(random, 0f, MathF.PI * 2f); float num4 = Range(random, 0.22f, 0.78f); float num5 = Range(random, 0.045f, 0.14f); float num6 = Range(random, 0f, 0.34f); ((Vector3)(ref val3))..ctor(Mathf.Cos(num3) * num6, 0f, Mathf.Sin(num3) * num6); Vector3 lean = new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)) * num4 * Range(random, 0.08f, 0.32f); AddBlade(hollowMesh, val2 + val3, num3, num5, num4, lean); AddBlade(hollowMesh, val2 + val3, num3 + MathF.PI / 2f, num5 * 0.75f, num4, lean); } } GameObject val4 = new GameObject("Empress Hollow Undergrowth"); val4.transform.SetParent(parent, false); val4.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Undergrowth Mesh"); MeshRenderer obj = val4.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.FernMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = true; } private static void AddBlade(HollowMesh mesh, Vector3 position, float yaw, float width, float height, Vector3 lean) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Vector3 val = new Vector3(Mathf.Cos(yaw), 0f, Mathf.Sin(yaw)) * width; Vector3 val2 = position + Vector3.up * height + lean; Vector3 val3 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; int a = mesh.AddVertex(position - val, normalized, new Vector2(0f, 0f)); int b = mesh.AddVertex(position + val, normalized, new Vector2(1f, 0f)); int c = mesh.AddVertex(val2 + val * 0.08f, normalized, new Vector2(0.54f, 1f)); int d = mesh.AddVertex(val2 - val * 0.08f, normalized, new Vector2(0.46f, 1f)); mesh.AddQuad(0, a, b, c, d); } private static void BuildFallenTimber(Transform parent, HollowMap map, Random random) { //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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) HollowMesh hollowMesh = new HollowMesh(); int num = Mathf.Clamp(Mathf.RoundToInt(map.Radius * 0.22f), 12, 28); Vector3 val2 = default(Vector3); for (int i = 0; i < num; i++) { Vector2 val = Point(random, map.ClearingRadius + 3f, map.Radius - 5f); float num2 = Range(random, 0f, MathF.PI * 2f); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2), 0f, Mathf.Sin(num2)); float num3 = Range(random, 2.8f, 7.5f); float num4 = Range(random, 0.14f, 0.42f); Vector3 val3 = map.OnGround(val.x - val2.x * num3 * 0.5f, val.y - val2.z * num3 * 0.5f, num4 * 0.72f); Vector3 val4 = map.OnGround(val.x + val2.x * num3 * 0.5f, val.y + val2.z * num3 * 0.5f, num4 * 0.72f); hollowMesh.Tube(0, val3, val4, num4, num4 * Range(random, 0.58f, 0.86f), 8, 0f, num3 * 0.7f); int num5 = random.Next(1, 4); for (int j = 0; j < num5; j++) { float num6 = Range(random, 0.18f, 0.82f); Vector3 val5 = Vector3.Lerp(val3, val4, num6); float num7 = num2 + Range(random, -1.25f, 1.25f); Vector3 val6 = new Vector3(Mathf.Cos(num7), Range(random, 0.08f, 0.38f), Mathf.Sin(num7)); Vector3 normalized = ((Vector3)(ref val6)).normalized; float num8 = Range(random, 0.5f, 1.7f); hollowMesh.Tube(0, val5, val5 + normalized * num8, num4 * 0.22f, 0.025f, 6, 0f, 1f); } } GameObject val7 = new GameObject("Empress Hollow Fallen Timber"); val7.transform.SetParent(parent, false); val7.AddComponent().sharedMesh = hollowMesh.ToMesh("Empress Hollow Fallen Timber Mesh"); MeshRenderer obj = val7.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.BarkDarkMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)obj).receiveShadows = true; } private static void BuildFungi(Transform parent, HollowMap map, Random random) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) HollowMesh hollowMesh = new HollowMesh(); int num = Mathf.Clamp(Mathf.RoundToInt(map.Radius * 0.28f), 14, 34); for (int i = 0; i < num; i++) { Vector2 val = Point(random, map.ClearingRadius + 1f, map.Radius - 3f); int num2 = random.Next(2, 6); for (int j = 0; j < num2; j++) { float num3 = Range(random, 0f, MathF.PI * 2f); float num4 = Range(random, 0f, 0.48f); float x = val.x + Mathf.Cos(num3) * num4; float z = val.y + Mathf.Sin(num3) * num4; float num5 = Range(random, 0.14f, 0.42f); float num6 = num5 * Range(random, 0.32f, 0.48f); Vector3 val2 = map.OnGround(x, z, 0.02f); hollowMesh.Tube(0, val2, val2 + Vector3.up * num5, num6 * 0.3f, num6 * 0.18f, 6, 0f, 1f); hollowMesh.Blob(1, val2 + Vector3.up * num5, new Vector3(num6, num6 * 0.34f, num6), 8, 4, 0.12f, random.Next()); } } GameObject val3 = new GameObject("Empress Hollow Fungi"); val3.transform.SetParent(parent, false); Mesh sharedMesh = hollowMesh.ToMesh("Empress Hollow Fungi Mesh"); val3.AddComponent().sharedMesh = sharedMesh; MeshRenderer val4 = val3.AddComponent(); ((Renderer)val4).sharedMaterials = (Material[])(object)new Material[2] { HollowMaterials.FungusStemMaterial, HollowMaterials.FungusCapMaterial }; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)1; ((Renderer)val4).receiveShadows = true; } private static Vector2 Point(Random random, float minRadius, float maxRadius) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) float num = Range(random, 0f, MathF.PI * 2f); float num2 = Mathf.Lerp(minRadius, maxRadius, Mathf.Sqrt((float)random.NextDouble())); return new Vector2(Mathf.Cos(num) * num2, Mathf.Sin(num) * num2); } private static float Range(Random random, float min, float max) { return min + (float)random.NextDouble() * (max - min); } } internal enum HollowStalkerMode { Stalk, Grab, Sink } internal sealed class HollowStalker : MonoBehaviour { private const float SinkDuration = 2.4f; private const float ReappearDelay = 2.6f; private const float GrabWindup = 0.4f; private Transform _visual; private Transform[] _arms; private Renderer[] _eyes; private Material _eyeMaterial; private AudioSource _moveAudio; private Quaternion[] _armRetracted; private Quaternion[] _armExtended; private float _treeHeight = 16.5f; private HollowMap _map; private bool _isHost; private int _worldMask = -1; private float _armExtend; private float _armExtendTarget; private float _grabTimer; private float _sinkTimer; private float _reappearTimer; private bool _hidden; private bool _grabFired; private float _aggression; private float _stunTimer; private float _currentStun; private bool _wasObserved; private Vector3 _clientPosition; private float _clientYaw; private float _clientLerp; private Vector3 _lastTargetPosition; private Vector3 _lastAudioPosition; public HollowStalkerMode Mode { get; private set; } public Vector3 Position => ((Component)this).transform.position; public float Yaw => ((Component)this).transform.eulerAngles.y; public float ArmExtend => _armExtend; public bool Hidden => _hidden; public static HollowStalker Create(Transform parent, bool isHost, HollowMap map, int seed) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Hollow Stalker"); val.transform.SetParent(parent, false); HollowStalker hollowStalker = val.AddComponent(); hollowStalker._isHost = isHost; hollowStalker._map = map; hollowStalker._visual = HollowTree.BuildStalkerBody(val.transform, seed, out hollowStalker._arms, out hollowStalker._eyes).transform; hollowStalker._eyeMaterial = ((hollowStalker._eyes.Length != 0) ? hollowStalker._eyes[0].sharedMaterial : null); hollowStalker._moveAudio = val.AddComponent(); hollowStalker._moveAudio.loop = true; hollowStalker._moveAudio.playOnAwake = false; hollowStalker._moveAudio.spatialBlend = 1f; hollowStalker._moveAudio.rolloffMode = (AudioRolloffMode)1; hollowStalker._moveAudio.minDistance = 3f; hollowStalker._moveAudio.maxDistance = 42f; hollowStalker._moveAudio.dopplerLevel = 0f; HollowAudio.ApplyRepoMixer(hollowStalker._moveAudio); hollowStalker._armRetracted = (Quaternion[])(object)new Quaternion[hollowStalker._arms.Length]; hollowStalker._armExtended = (Quaternion[])(object)new Quaternion[hollowStalker._arms.Length]; for (int i = 0; i < hollowStalker._arms.Length; i++) { float num = ((float)i - 1.5f) * 0.55f; Vector3 val2 = new Vector3(Mathf.Sin(num) * 0.35f, 0.95f, Mathf.Cos(num) * 0.18f); Vector3 normalized = ((Vector3)(ref val2)).normalized; val2 = new Vector3(Mathf.Sin(num) * 0.85f, -0.12f, 0.62f); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; hollowStalker._armRetracted[i] = Quaternion.LookRotation(normalized, Vector3.up); hollowStalker._armExtended[i] = Quaternion.LookRotation(normalized2, Vector3.up); hollowStalker._arms[i].localRotation = hollowStalker._armRetracted[i]; } hollowStalker.ApplyArms(); hollowStalker.ApplyEyes(); return hollowStalker; } public void PlaceAt(Vector3 position, Vector3 facing) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) position.y = ((_map != null) ? _map.GroundHeight(position.x, position.z) : position.y); ((Component)this).transform.position = position; facing.y = 0f; if (((Vector3)(ref facing)).sqrMagnitude > 0.01f) { ((Component)this).transform.rotation = Quaternion.LookRotation(((Vector3)(ref facing)).normalized, Vector3.up); } _clientPosition = position; _clientYaw = ((Component)this).transform.eulerAngles.y; _lastAudioPosition = position; } public IEnumerable SamplePoints() { yield return ((Component)this).transform.position + Vector3.up * 1.4f; yield return ((Component)this).transform.position + Vector3.up * (_treeHeight * 0.45f); yield return ((Component)this).transform.position + Vector3.up * (_treeHeight * 0.75f); } public bool HostThink(float dt, PlayerAvatar target, float distance, bool observed, IList waypoints) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) switch (Mode) { case HollowStalkerMode.Sink: UpdateSink(dt, target, waypoints); UpdateVisual(dt); return false; case HollowStalkerMode.Grab: _grabTimer -= dt; _armExtendTarget = 1f; if ((Object)(object)target != (Object)null) { FaceTarget(((Component)target).transform.position, dt, 16f); } UpdateVisual(dt); if (_grabTimer <= 0f && !_grabFired) { _grabFired = true; BeginSink(); return true; } return false; default: return ThinkStalk(dt, target, distance, observed, waypoints); } } private bool ThinkStalk(float dt, PlayerAvatar target, float distance, bool observed, IList waypoints) { //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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) if (observed) { if (!_wasObserved) { _currentStun = Mathf.Lerp(10f, 5f, _aggression) + Random.Range(-0.5f, 0.5f); } _stunTimer = _currentStun; } else if (_stunTimer > 0f) { _stunTimer -= dt; } _wasObserved = observed; bool flag = _aggression <= 0.001f; if (!((Object)(object)target != (Object)null) || observed || !(_stunTimer <= 0f) || flag) { _armExtendTarget = 0f; UpdateVisual(dt); return false; } _lastTargetPosition = ((Component)target).transform.position; float num = EmpressHollowPlugin.Settings.GrabRange.Value * Mathf.Lerp(0.85f, 1.15f, _aggression); float speed = Mathf.Lerp(1.5f, EmpressHollowPlugin.Settings.StalkerSpeed.Value * 1.35f, _aggression); MoveToward(((Component)target).transform.position, speed, dt); FaceTarget(((Component)target).transform.position, dt, 7f); _armExtendTarget = Mathf.Clamp01(Mathf.InverseLerp(num * 4.5f, num * 1.3f, distance)) * 0.85f; if (distance <= num) { Mode = HollowStalkerMode.Grab; _grabTimer = 0.4f; _grabFired = false; HollowAudio.PlayGrab(((Component)this).transform.position); } UpdateVisual(dt); return false; } public void SetAggression(float aggression) { _aggression = Mathf.Clamp01(aggression); } private void MoveToward(Vector3 destination, float speed, float dt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) Vector3 val = destination - ((Component)this).transform.position; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.05f) { return; } Vector3 val2 = val / magnitude; if (_worldMask == -1) { _worldMask = LayerMask.GetMask(new string[1] { "Default" }); } RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(((Component)this).transform.position + Vector3.up * 1.6f, 0.7f, val2, ref val3, 2.4f, _worldMask, (QueryTriggerInteraction)1)) { Vector3 val4 = Vector3.Cross(Vector3.up, val2); if (Vector3.Dot(((RaycastHit)(ref val3)).normal, val4) < 0f) { val4 = -val4; } Vector3 val5 = val2 * 0.35f + val4; val2 = ((Vector3)(ref val5)).normalized; } Vector3 val6 = ((Component)this).transform.position + val2 * Mathf.Min(speed * dt, magnitude); if (_map != null) { val6.y = _map.GroundHeight(val6.x, val6.z); } ((Component)this).transform.position = val6; } private void FaceTarget(Vector3 target, float dt, float turnSpeed) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target - ((Component)this).transform.position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, dt * turnSpeed); } } private void BeginSink() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) Mode = HollowStalkerMode.Sink; _sinkTimer = 2.4f; _reappearTimer = 2.6f; _armExtendTarget = 0f; HollowAudio.PlaySink(((Component)this).transform.position); } private void UpdateSink(float dt, PlayerAvatar target, IList waypoints) { //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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (_sinkTimer > 0f) { _sinkTimer -= dt; if (_sinkTimer <= 0f) { _hidden = true; } return; } _reappearTimer -= dt; if (!(_reappearTimer > 0f)) { Vector3 val = PickFarWaypoint(target, waypoints); PlaceAt(val, _lastTargetPosition - val); _hidden = false; _armExtend = 0f; Mode = HollowStalkerMode.Stalk; } } private Vector3 PickFarWaypoint(PlayerAvatar target, IList waypoints) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_0074: Unknown result type (might be due to invalid IL or missing references) if (waypoints == null || waypoints.Count == 0) { return ((Component)this).transform.position; } Vector3 val = (((Object)(object)target != (Object)null) ? ((Component)target).transform.position : _lastTargetPosition); Vector3 result = waypoints[0]; float num = -1f; for (int i = 0; i < waypoints.Count; i++) { float num2 = Vector3.Distance(waypoints[i], val) + Random.Range(0f, 12f); if (num2 > num) { num = num2; result = waypoints[i]; } } return result; } private void UpdateVisual(float dt) { _armExtend = Mathf.MoveTowards(_armExtend, _armExtendTarget, dt * ((Mode == HollowStalkerMode.Grab) ? 6f : 2.2f)); ApplyArms(); ApplyEyes(); ApplySink(dt); UpdateMovementAudio(dt); } private void UpdateMovementAudio(float dt) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!((Object)(object)_moveAudio == (Object)null)) { if ((Object)(object)_moveAudio.outputAudioMixerGroup == (Object)null) { HollowAudio.ApplyRepoMixer(_moveAudio); } AudioClip stalkerMoveClip = HollowAudio.StalkerMoveClip; if ((Object)(object)_moveAudio.clip != (Object)(object)stalkerMoveClip) { _moveAudio.Stop(); _moveAudio.clip = stalkerMoveClip; } float num = ((dt > 0f) ? (Vector3.Distance(((Component)this).transform.position, _lastAudioPosition) / dt) : 0f); _lastAudioPosition = ((Component)this).transform.position; float num2 = ((EmpressHollowPlugin.Settings != null) ? EmpressHollowPlugin.Settings.MasterVolume.Value : 0.85f); float num3 = ((!_hidden && Mode == HollowStalkerMode.Stalk && num > 0.15f) ? (Mathf.Clamp01(num / 3f) * 0.8f * num2) : 0f); _moveAudio.volume = Mathf.MoveTowards(_moveAudio.volume, num3, dt * 2.5f); _moveAudio.pitch = Mathf.Lerp(0.85f, 1.15f, Mathf.Clamp01(num / 5f)); if ((Object)(object)stalkerMoveClip != (Object)null && !_moveAudio.isPlaying) { _moveAudio.Play(); } } } private void ApplyArms() { //IL_002c: 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_0043: 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) if (_arms == null) { return; } for (int i = 0; i < _arms.Length; i++) { if (!((Object)(object)_arms[i] == (Object)null)) { _arms[i].localRotation = Quaternion.Slerp(_armRetracted[i], _armExtended[i], _armExtend); _arms[i].localScale = new Vector3(1f, 1f, 0.7f + 0.6f * _armExtend); } } } private void ApplyEyes() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_eyeMaterial == (Object)null) && _eyeMaterial.HasProperty("_EmissionColor")) { float num = Mathf.Clamp01(_armExtend) * 5.5f; _eyeMaterial.SetColor("_EmissionColor", new Color(0.7f, 0.92f, 1f) * num); } } private void ApplySink(float dt) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_visual == (Object)null)) { float num = 0f; if (Mode == HollowStalkerMode.Sink && _sinkTimer > 0f) { num = (0f - _treeHeight) * (1f - Mathf.Clamp01(_sinkTimer / 2.4f)); } else if (_hidden) { num = 0f - _treeHeight; } Vector3 localPosition = _visual.localPosition; localPosition.y = Mathf.MoveTowards(localPosition.y, num, dt * _treeHeight); _visual.localPosition = localPosition; bool flag = !_hidden; if (((Component)_visual).gameObject.activeSelf != flag) { ((Component)_visual).gameObject.SetActive(flag); } } } public void ClientApplySync(Vector3 position, float yaw, float armExtend, bool hidden) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) _clientPosition = position; _clientYaw = yaw; _clientLerp = 0f; _armExtendTarget = armExtend; _armExtend = Mathf.MoveTowards(_armExtend, armExtend, 0.5f); _hidden = hidden; } public void ClientTick(float dt) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) _clientLerp = Mathf.Min(1f, _clientLerp + dt * 10f); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, _clientPosition, _clientLerp); float num = Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, _clientYaw, dt * 8f); ((Component)this).transform.rotation = Quaternion.Euler(0f, num, 0f); _armExtend = Mathf.MoveTowards(_armExtend, _armExtendTarget, dt * 3f); ApplyArms(); ApplyEyes(); ApplySink(dt); UpdateMovementAudio(dt); } public void Dispose() { Object.Destroy((Object)(object)((Component)this).gameObject); } } internal sealed class TreePrototype { public Mesh Mesh; public Material[] Materials; public float Height; public float Radius; } internal static class HollowTree { public static TreePrototype[] CreatePrototypes(int count, Random random) { TreePrototype[] array = new TreePrototype[count]; for (int i = 0; i < count; i++) { HollowMesh hollowMesh = new HollowMesh(); int num = random.Next(0, 3); float height = Range(random, 8f, 16f); float num2 = Range(random, 0.24f, 0.52f); bool num3 = num == 2; BuildTrunk(hollowMesh, random, height, num2, gnarled: false); BuildFoliage(hollowMesh, random, height, num2, num); Mesh val = hollowMesh.ToMesh("Empress Hollow Tree " + i); Material val2 = (num3 ? HollowMaterials.FoliageDeadMaterial : HollowMaterials.FoliageMaterial); array[i] = new TreePrototype { Mesh = val, Materials = (Material[])(object)((val.subMeshCount > 1) ? new Material[2] { HollowMaterials.BarkMaterial, val2 } : new Material[1] { HollowMaterials.BarkMaterial }), Height = height, Radius = num2 }; } return array; } public static GameObject BuildStalkerBody(Transform parent, int seed, out Transform[] arms, out Renderer[] eyes) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00d1: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(seed); float num = 16.5f; float num2 = 0.55f; GameObject val = new GameObject("Empress Hollow Stalker Body"); val.transform.SetParent(parent, false); HollowMesh hollowMesh = new HollowMesh(); BuildTrunk(hollowMesh, random, num, num2, gnarled: true); BuildFoliage(hollowMesh, random, num, num2, 2); GameObject val2 = new GameObject("Bark"); val2.transform.SetParent(val.transform, false); Mesh val3 = hollowMesh.ToMesh("Empress Hollow Stalker Mesh"); val2.AddComponent().sharedMesh = val3; MeshRenderer val4 = val2.AddComponent(); ((Renderer)val4).sharedMaterials = (Material[])(object)((val3.subMeshCount <= 1) ? new Material[1] { HollowMaterials.BarkDarkMaterial } : new Material[2] { HollowMaterials.BarkDarkMaterial, HollowMaterials.FoliageDeadMaterial }); ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; GameObject val5 = new GameObject("Arms"); val5.transform.SetParent(val.transform, false); val5.transform.localPosition = new Vector3(0f, num * 0.6f, 0f); arms = (Transform[])(object)new Transform[4]; Vector3 val7 = default(Vector3); Vector3 to = default(Vector3); for (int i = 0; i < arms.Length; i++) { float num3 = ((float)i - 1.5f) * 0.5f; GameObject val6 = new GameObject("Arm " + i); val6.transform.SetParent(val5.transform, false); val6.transform.localPosition = new Vector3(Mathf.Sin(num3) * num2, 0f, Mathf.Cos(num3) * num2); HollowMesh hollowMesh2 = new HollowMesh(); float num4 = Range(random, 5.5f, 7.5f); Vector3 zero = Vector3.zero; ((Vector3)(ref val7))..ctor(Range(random, -0.3f, 0.3f), Range(random, -0.1f, 0.2f), num4 * 0.5f); ((Vector3)(ref to))..ctor(Range(random, -0.5f, 0.5f), Range(random, -0.4f, 0.1f), num4); hollowMesh2.Tube(0, zero, val7, 0.16f, 0.1f, 5, 0f, 1f); hollowMesh2.Tube(0, val7, to, 0.1f, 0.03f, 5, 0f, 1f); val6.AddComponent().sharedMesh = hollowMesh2.ToMesh("Empress Hollow Arm " + i); MeshRenderer obj = val6.AddComponent(); ((Renderer)obj).sharedMaterial = HollowMaterials.BarkDarkMaterial; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; arms[i] = val6.transform; } eyes = (Renderer[])(object)new Renderer[2]; Material sharedMaterial = new Material(HollowMaterials.EyeMaterial); for (int j = 0; j < eyes.Length; j++) { GameObject obj2 = GameObject.CreatePrimitive((PrimitiveType)5); Object.Destroy((Object)(object)obj2.GetComponent()); ((Object)obj2).name = "Eye " + j; obj2.transform.SetParent(val.transform, false); obj2.transform.localPosition = new Vector3((j == 0) ? (-0.18f) : 0.18f, num * 0.64f, num2 * 0.92f); obj2.transform.localScale = new Vector3(0.16f, 0.32f, 0.16f); MeshRenderer component = obj2.GetComponent(); ((Renderer)component).sharedMaterial = sharedMaterial; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; eyes[j] = (Renderer)(object)component; } return val; } private static void BuildTrunk(HollowMesh mesh, Random random, float height, float baseRadius, bool gnarled) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: 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_01bf: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) int num = 6; Vector3 val = Vector3.zero; float num2 = 0f; float num3 = 0f; float num4 = Range(random, -0.18f, 0.18f); float num5 = Range(random, -0.18f, 0.18f); Vector3 val2 = default(Vector3); for (int i = 1; i <= num; i++) { float num6 = (float)i / (float)num; float num7 = (float)(i - 1) / (float)num; num4 += Range(random, -0.12f, 0.12f) * (gnarled ? 1.8f : 1f); num5 += Range(random, -0.12f, 0.12f) * (gnarled ? 1.8f : 1f); num2 += num4; num3 += num5; ((Vector3)(ref val2))..ctor(num2, num6 * height, num3); float radiusFrom = Mathf.Lerp(baseRadius, baseRadius * 0.18f, num7); float radiusTo = Mathf.Lerp(baseRadius, baseRadius * 0.18f, num6); mesh.Tube(0, val, val2, radiusFrom, radiusTo, 6, num7 * 4f, num6 * 4f); val = val2; } int num8 = (gnarled ? random.Next(4, 7) : random.Next(2, 4)); Vector3 val3 = default(Vector3); Vector3 val4 = default(Vector3); for (int j = 0; j < num8; j++) { float num9 = Range(random, 0.45f, 0.95f); ((Vector3)(ref val3))..ctor(num2 * num9, num9 * height, num3 * num9); float num10 = Range(random, 0f, MathF.PI * 2f); float num11 = Range(random, gnarled ? 0.1f : 0.4f, 0.9f); ((Vector3)(ref val4))..ctor(Mathf.Cos(num10) * Mathf.Cos(num11), Mathf.Sin(num11), Mathf.Sin(num10) * Mathf.Cos(num11)); float num12 = Range(random, 1.5f, 3.6f); Vector3 val5 = val3 + val4 * num12 * 0.5f + Vector3.up * Range(random, -0.2f, 0.4f); Vector3 to = val3 + val4 * num12 + Vector3.up * Range(random, -0.6f, 0.3f); float num13 = baseRadius * Range(random, 0.18f, 0.32f); mesh.Tube(0, val3, val5, num13, num13 * 0.6f, 5, 0f, 1f); mesh.Tube(0, val5, to, num13 * 0.6f, 0.02f, 5, 0f, 1f); } } private static void BuildFoliage(HollowMesh mesh, Random random, float height, float baseRadius, int archetype) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) switch (archetype) { case 0: { int num4 = random.Next(3, 5); float num5 = height * 1.02f; float num6 = height * 0.42f; for (int j = 0; j < num4; j++) { float num7 = (float)j / (float)Mathf.Max(1, num4 - 1); float num8 = Mathf.Lerp(num6, num5 - 1.5f, num7); float radius = Mathf.Lerp(height * 0.26f, height * 0.08f, num7); mesh.Cone(1, new Vector3(0f, num8, 0f), Mathf.Max(1.5f, height * 0.22f), radius, 8, doubleSided: true); } break; } case 1: { int num9 = random.Next(3, 6); Vector3 center2 = default(Vector3); for (int k = 0; k < num9; k++) { float num10 = Range(random, height * 0.65f, height * 1f); float num11 = height * 0.14f; ((Vector3)(ref center2))..ctor(Range(random, 0f - num11, num11), num10, Range(random, 0f - num11, num11)); float num12 = Range(random, height * 0.13f, height * 0.2f); mesh.Blob(1, center2, new Vector3(num12, num12 * 0.8f, num12), 7, 4, 0.28f, random.Next(), doubleSided: true); } break; } default: { int num = random.Next(0, 2); Vector3 center = default(Vector3); for (int i = 0; i < num; i++) { float num2 = Range(random, height * 0.7f, height * 0.95f); ((Vector3)(ref center))..ctor(Range(random, -1f, 1f), num2, Range(random, -1f, 1f)); float num3 = Range(random, height * 0.06f, height * 0.1f); mesh.Blob(1, center, new Vector3(num3, num3 * 0.7f, num3), 6, 3, 0.4f, random.Next(), doubleSided: true); } break; } } } private static float Range(Random random, float min, float max) { return min + (float)random.NextDouble() * (max - min); } } }